File tree Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -23,7 +23,7 @@ def controller_tests_dir
23
23
end
24
24
25
25
def bundles_spring?
26
- version >= Gem ::Version . new ( "4.1.0.beta1 " )
26
+ version . segments . take ( 2 ) == [ 4 , 1 ] || version > Gem ::Version . new ( "4.1" )
27
27
end
28
28
29
29
def major
@@ -33,6 +33,10 @@ def major
33
33
def minor
34
34
version . segments [ 1 ]
35
35
end
36
+
37
+ def to_s
38
+ version . to_s
39
+ end
36
40
end
37
41
38
42
class Application
@@ -270,12 +274,12 @@ def generate
270
274
system ( "gem list rails --installed --version '#{ version_constraint } ' || " \
271
275
"gem install rails --clear-sources --source http://rubygems.org --version '#{ version_constraint } '" )
272
276
277
+ @version = RailsVersion . new ( `ruby -e 'puts Gem::Specification.find_by_name("rails", "#{ version_constraint } ").version'` . chomp )
278
+
273
279
skips = %w( --skip-bundle --skip-javascript --skip-sprockets )
274
280
skips << "--skip-spring" if version . bundles_spring?
275
281
276
- rails = `ruby -e 'puts Gem.bin_path("railties", "rails", "#{ version_constraint } ")'` . chomp
277
- system ( "#{ rails } new #{ application . root } #{ skips . join ( ' ' ) } " )
278
-
282
+ system ( "rails _#{ version } _ new #{ application . root } #{ skips . join ( ' ' ) } " )
279
283
raise "application generation failed" unless application . exists?
280
284
281
285
FileUtils . mkdir_p ( application . gem_home )
You can’t perform that action at this time.
0 commit comments