-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathMakefile
More file actions
59 lines (40 loc) · 1.39 KB
/
Makefile
File metadata and controls
59 lines (40 loc) · 1.39 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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
## gem tasks ##
NAME = \
$(shell ruby -e "s = eval(File.read(Dir['*.gemspec'][0])); puts s.name")
VERSION = \
$(shell ruby -e "s = eval(File.read(Dir['*.gemspec'][0])); puts s.version")
count_lines:
find lib -name "*.rb" | xargs cat | ruby -e "p STDIN.readlines.count { |l| l = l.strip; l[0, 1] != '#' && l != '' }"
find spec -name "*_spec.rb" | xargs cat | ruby -e "p STDIN.readlines.count { |l| l = l.strip; l[0, 1] != '#' && l != '' }"
cl: count_lines
gemspec_validate:
@echo "---"
ruby -e "s = eval(File.read(Dir['*.gemspec'].first)); p s.validate"
@echo "---"
name: gemspec_validate
@echo "$(NAME) $(VERSION)"
cw:
find lib -name "*.rb" -exec ruby -cw {} \; | grep lib
#syncver:
# sed -E -i '' "s/VERSION = ['0-9.]+/VERSION = '$(shell grep -E "$(NAME) ([0-9.]+)" CHANGELOG.md | head -1 | sed -E 's/[^0-9\.]//g')'/" lib/$(NAME).rb
# bundle install
build: gemspec_validate
gem build $(NAME).gemspec
mkdir -p pkg
mv $(NAME)-$(VERSION).gem pkg/
push: build
gem push pkg/$(NAME)-$(VERSION).gem
## flor tasks ##
RUBY=bundle exec ruby
#RUBY=bundle exec ruby --disable-did_you_mean
# gem uninstall did_you_mean
FLOR_ENV?=dev
TO?=nil
FROM?=nil
#migrate:
# $(RUBY) -Ilib -e "require 'flor/unit'; Flor::Unit.new('envs/$(FLOR_ENV)/etc/conf.json').storage.migrate($(TO), $(FROM))"
clean:
rm -f flor_*.dump
rm -f tmp/florist_*.db
.PHONY: \
count_lines gemspec_validate name cw build push clean