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
|
# File 'lib/kwoon/cli.rb', line 18
def create(kata_name)
@kata_name = kata_name
@gemset = "kwoon_" + kata_name
@ruby_version = options[:"ruby-version"]
Bundler.with_clean_env do
puts "*** Creating kata directory"
FileUtils.mkdir(kata_name)
template "templates/autotest.tt", "#{kata_name}/.autotest"
template "templates/gitignore.tt", "#{kata_name}/.gitignore"
template "templates/rspec.tt", "#{kata_name}/.rspec"
template "templates/rvmrc.tt", "#{kata_name}/.rvmrc"
template "templates/Gemfile.tt", "#{kata_name}/Gemfile"
template "templates/autotest/discover.rb.tt", "#{kata_name}/autotest/discover.rb"
template "templates/autotest/kwoon_rspec2.rb.tt", "#{kata_name}/autotest/kwoon_rspec2.rb"
template "templates/lib/kata_name.rb.tt", "#{kata_name}/lib/#{kata_name}.rb"
template "templates/spec/kata_name_spec.rb.tt", "#{kata_name}/spec/#{kata_name}_spec.rb"
template "templates/spec/spec_helper.rb.tt", "#{kata_name}/spec/spec_helper.rb"
puts
puts "*** Creating kata gemset"
system "rvm #{@ruby_version} gemset create #{@gemset}"
puts
Dir.chdir(kata_name) do
puts "*** Installing & updating bundler"
system "rvm #{@ruby_version}@#{@gemset} exec gem install bundler"
system "rvm #{@ruby_version}@#{@gemset} exec gem update bundler"
puts
puts "*** Bundling kata gems"
system "rvm #{@ruby_version}@#{@gemset} exec bundle"
system "rvm #{@ruby_version}@#{@gemset} gem install #{options[:"kwoon-gem"]}"
puts
end
puts "*** Now run the following commands:"
puts " cd #{kata_name}"
puts " kwoon git REPO_NAME"
puts " kwoon start USERNAME_1 USERNAME_2 ... USERNAME_N"
puts " autotest"
puts
puts "e.g."
puts " kwoon git [email protected]:account_name/repo.git"
puts " kwoon start fred wilma"
puts
end
end
|