-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathMakefile
More file actions
43 lines (36 loc) · 1.54 KB
/
Makefile
File metadata and controls
43 lines (36 loc) · 1.54 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
.PHONY: build install bump-minor clean test gallery help
help:
@echo "Available targets:"
@echo " build - Build the gem"
@echo " install - Build and install the gem locally"
@echo " bump-minor - Bump the minor version and build"
@echo " clean - Remove built gem files"
@echo " gallery - Generate all markdown files with all templates"
@echo " help - Show this help message"
build:
gem build mint.gemspec
install: build
@version=$$(ruby -e "require './lib/mint/version'; puts Mint::VERSION") && \
cd .. && gem install mint/mint-$$version.gem && cd - && \
trash mint-$$version.gem
bump-minor:
@echo "Current version: $$(ruby -e "require './lib/mint/version'; puts Mint::VERSION")"
@ruby -i -pe '$$_.gsub!(/VERSION = "(\d+)\.(\d+)\.(\d+)"/) { "VERSION = \"#{$$1}.#{$$2.to_i + 1}.0\"" }' lib/mint/version.rb
@echo "New version: $$(ruby -e "require './lib/mint/version'; puts Mint::VERSION")"
@$(MAKE) build
test:
@rbenv rehash && spec/run_cli_tests.rb
gallery:
@echo "Generating gallery with all templates..."
@for template in $(shell ls -d config/templates/*/ | grep -v '/base/'); do \
template_name=$$(basename "$$template"); \
echo "Processing template: $$template_name"; \
find examples -name "*.md" -type f | while read -r md_file; do \
output_file=$${md_file%.md}-$$template_name.html; \
echo " $$md_file -> $$output_file"; \
bin/mint "$$md_file" --template "$$template_name" --style-mode original --output-file "$$output_file"; \
done; \
done
@echo "Gallery generation complete!"
clean:
rm -f *.gem