-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathRakefile
46 lines (38 loc) · 1018 Bytes
/
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
namespace :dojo do
desc "When you greet 'osu!' , gate of the 'dojo' would open."
task :osu! do
dir = ENV["dojo_name"]
fail "please specify 'dojo_name'" unless dir
sh "mkdir #{dir}"
Dir::chdir(dir) do
sh "bundle init"
if RUBY_PLATFORM =~ /(mingw|mswin)/
sh <<-EOS
echo gem 'rspec' >> Gemfile
EOS
else
sh <<-EOS
echo gem "'rspec'" >> Gemfile
EOS
end
sh <<-EOS
echo .bundle > .gitignore
EOS
sh "bundle install --path .bundle"
sh "bundle exec rspec --init"
sh "mkdir src"
sh "git branch #{dir}"
sh "git checkout #{dir}"
end
puts "\r\nMay The Code be with you..."
end
desc "Delete your dojo"
task :hamon do
dir = ENV["dojo_name"]
fail "please specify 'dojo_name'" unless dir
sh "rm -rf #{dir}"
sh "git checkout master"
sh "git branch -d #{dir}"
puts "You was 'Hamon'"
end
end