Commit c0efd8ea7cd9b3d38e297306ad6961b4ca533ac8

Authored by Dan Croak
1 parent bd12d7ff

cucumber won't install as part of rake gems:install RAILS_ENV=cucumber because i…

…t is considered part of the framework. have to do a manual check to see if it is installed as part of script/create_project. doing the same thing for the rails gem.
Showing 1 changed file with 17 additions and 0 deletions   Show diff stats
script/create_project
@@ -37,6 +37,11 @@ def search_and_replace(file, search, replace) @@ -37,6 +37,11 @@ def search_and_replace(file, search, replace)
37 end 37 end
38 end 38 end
39 39
  40 +def not_installed?(gem_name)
  41 + gems = Gem.source_index.find_name(gem_name)
  42 + gems.detect { |gem| gem.name == gem_name }.nil?
  43 +end
  44 +
40 run("mkdir #{project_directory}") 45 run("mkdir #{project_directory}")
41 Dir.chdir(project_directory) or fail("Couldn't change to #{project_directory}") 46 Dir.chdir(project_directory) or fail("Couldn't change to #{project_directory}")
42 run("git init") 47 run("git init")
@@ -54,10 +59,22 @@ end @@ -54,10 +59,22 @@ end
54 59
55 run("git commit -a -m 'New Heroku Suspenders app'") 60 run("git commit -a -m 'New Heroku Suspenders app'")
56 61
  62 +if not_installed?("rails")
  63 + run "sudo gem install rails"
  64 +end
  65 +
57 run("sudo rake gems:install RAILS_ENV=development") 66 run("sudo rake gems:install RAILS_ENV=development")
58 run("sudo rake gems:install RAILS_ENV=test") 67 run("sudo rake gems:install RAILS_ENV=test")
59 run("sudo rake gems:install RAILS_ENV=cucumber") 68 run("sudo rake gems:install RAILS_ENV=cucumber")
60 69
  70 +if not_installed?("cucumber")
  71 + run "sudo gem install cucumber --version='0.3.11'"
  72 +end
  73 +
  74 +if not_installed?("webrat")
  75 + run "sudo gem install webrat --version='0.4.4'"
  76 +end
  77 +
61 run("sudo touch log/development.log") 78 run("sudo touch log/development.log")
62 run("sudo chmod 0666 log/development.log") 79 run("sudo chmod 0666 log/development.log")
63 run("sudo touch log/test.log") 80 run("sudo touch log/test.log")