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
|
# File 'lib/icebreaker/cli.rb', line 15
def new(project)
unless `rails -v`.chomp =~ /3.2.6/
puts "IceBreaker requires rails 3.2.6 or greater. Please install with the following command and then re-run the ice command:"
puts "$ gem install rails -v 3.2.6 --no-ri --no-rdoc"
puts "Currently getting #{`rails -v`}"
exit 0
end
gemset = `rvm gemset name`.chomp
unless gemset == project
say "Your current rvm gemset name is: #{gemset}"
say "It is recommend that you use a separate RVM gemset called '#{project}' when creating a Rails project with IceBreaker. This will keep your system gems clean."
say "You can exit now and create it by running this command: rvm use 1.9.2@#{project} --create"
if yes?("Would you like to exit now and create a separate RVM gemset for #{project}?")
exit 0
end
end
command = "rails new #{project} --skip-active-record --skip-test-unit --template=#{template} "
puts "Creating new Rails 3.2.6 project with: #{command}"
exec(command)
end
|