forked from crguezl/ull-etsii-grado-pl-jisoncalc
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathRakefile
77 lines (63 loc) · 1.77 KB
/
Rakefile
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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
desc "Run server"
task :default => [:jison] do
sh "node use-calculator.js 'a = 2*3;'"
end
desc "Run server"
task :web => [:use_keys, :jison] do
sh "rackup"
end
desc "Save config.yml out of the CVS"
task :keep_secrets do
sh "cp config/config_template.yml config/config.yml "
end
desc "Use the filled client_secrets"
task :use_keys do
sh "cp config/config_filled.yml config/config.yml"
end
desc "Go to console.developers.google"
task :link do
sh "open https://console.developers.google.com/project/apps~sinatra-ruby-gplus/apiui/api"
end
desc "Commit changes"
task :ci, [ :message ] => :keep_secrets do |t, args|
message = args[:message] || ''
sh "git ci -am '#{message}'"
end
task :jison => %w{public/calculator.js}
desc "Compile the grammar public/calculator.jison"
file "public/calculator.js" => %w{public/calculator.jison} do
sh "jison public/calculator.jison public/calculator.l -o public/calculator.js"
end
desc "Compile the sass public/styles.scss"
task :css do
sh "sass public/styles.scss public/styles.css"
end
task :testf do
sh " open -a firefox test/test.html"
end
task :tests do
sh " open -a safari test/test.html"
end
desc "Remove calculator.js"
task :clean do
sh "rm -f public/calculator.js"
sh "rm -f calculator*.tab.jison"
sh "rm -f calculator*.output"
sh "rm -f calculator*.vcg"
sh "rm -f calculator*.c"
end
desc "Open browser in GitHub repo"
task :github do
sh "open https://github.com/crguezl/ull-etsii-grado-pl-jisoncalc"
end
desc "DFA table using bison -v"
task :table do
sh "bison -v public/calculator.jison"
end
desc "push changes to origin and crguezl: rake push['message']"
task :push, [ :message ] do |t, args|
message = args[:message] || ''
sh "git ci -am '#{message}'"
sh "git push origin master"
sh "git push crguezl master"
end