Skip to content
This repository
Browse code

build using rails_apps_composer 2.2.38

  • Loading branch information...
commit 6392d80709562267d6e70c17ca51617677daa874 1 parent 6303376
Daniel Kehoe authored March 29, 2013

Showing 1 changed file with 15 additions and 4 deletions. Show diff stats Hide diff stats

  1. 19  composer.rb
19  composer.rb
@@ -2111,8 +2111,12 @@ def which(cmd)
2111 2111
   rvmrc_file = File.read('.rvmrc')
2112 2112
   rvmrc_detected = rvmrc_file.include? app_name
2113 2113
 end
  2114
+if File.exist?('.ruby-gemset')
  2115
+  rvmrc_file = File.read('.ruby-gemset')
  2116
+  rvmrc_detected = rvmrc_file.include? app_name
  2117
+end
2114 2118
 unless rvmrc_detected || prefs[:rvmrc]
2115  
-  prefs[:rvmrc] = yes_wizard? "Use or create a project-specific rvm gemset and .rvmrc?"
  2119
+  prefs[:rvmrc] = yes_wizard? "Use or create a project-specific rvm gemset?"
2116 2120
 end
2117 2121
 if prefs[:rvmrc]
2118 2122
   if which("rvm")
@@ -2151,9 +2155,16 @@ def which(cmd)
2151 2155
       raise
2152 2156
     end
2153 2157
     run "rvm gemset list"
2154  
-    copy_from_repo '.rvmrc'
2155  
-    gsub_file '.rvmrc', /App_Name/, "#{app_name}"
2156  
-    gsub_file '.rvmrc', /-2.0.0/, "-#{RUBY_VERSION}"
  2158
+    if File.exist?('.ruby-version')
  2159
+      say_wizard ".ruby-version file already exists"
  2160
+    else
  2161
+      create_file '.ruby-version', "#{RUBY_VERSION}\n"
  2162
+    end
  2163
+    if File.exist?('.ruby-gemset')
  2164
+      say_wizard ".ruby-gemset file already exists"
  2165
+    else
  2166
+      create_file '.ruby-gemset', "#{app_name}\n"
  2167
+    end
2157 2168
   else
2158 2169
     say_wizard "WARNING! RVM does not appear to be available."
2159 2170
   end

0 notes on commit 6392d80

Please sign in to comment.
Something went wrong with that request. Please try again.