mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Add therubyracer gem commented in default Gemfile
This commit is contained in:
parent
31472ba632
commit
94bcdd60ea
2 changed files with 16 additions and 6 deletions
|
@ -195,7 +195,9 @@ module Rails
|
|||
group :assets do
|
||||
gem 'sass-rails', :git => 'https://github.com/rails/sass-rails.git'
|
||||
gem 'coffee-rails', :git => 'https://github.com/rails/coffee-rails.git'
|
||||
#{"gem 'therubyrhino'\n" if defined?(JRUBY_VERSION)}
|
||||
|
||||
# See https://github.com/sstephenson/execjs#readme for more supported runtimes
|
||||
#{javascript_runtime_gemfile_entry}
|
||||
gem 'uglifier', '>= 1.0.3'
|
||||
end
|
||||
GEMFILE
|
||||
|
@ -206,7 +208,9 @@ module Rails
|
|||
group :assets do
|
||||
gem 'sass-rails', '~> 4.0.0.beta'
|
||||
gem 'coffee-rails', '~> 4.0.0.beta'
|
||||
#{"gem 'therubyrhino'\n" if defined?(JRUBY_VERSION)}
|
||||
|
||||
# See https://github.com/sstephenson/execjs#readme for more supported runtimes
|
||||
#{javascript_runtime_gemfile_entry}
|
||||
gem 'uglifier', '>= 1.0.3'
|
||||
end
|
||||
GEMFILE
|
||||
|
@ -219,6 +223,14 @@ module Rails
|
|||
"gem '#{options[:javascript]}-rails'" unless options[:skip_javascript]
|
||||
end
|
||||
|
||||
def javascript_runtime_gemfile_entry
|
||||
if defined?(JRUBY_VERSION)
|
||||
"gem 'therubyrhino'\n"
|
||||
else
|
||||
"# gem 'therubyracer'\n"
|
||||
end
|
||||
end
|
||||
|
||||
def bundle_command(command)
|
||||
say_status :run, "bundle #{command}"
|
||||
|
||||
|
|
|
@ -229,14 +229,12 @@ class AppGeneratorTest < Rails::Generators::TestCase
|
|||
assert_file "test/performance/browsing_test.rb"
|
||||
end
|
||||
|
||||
def test_inclusion_of_therubyrhino_under_jruby
|
||||
def test_inclusion_of_javascript_runtime
|
||||
run_generator([destination_root])
|
||||
if defined?(JRUBY_VERSION)
|
||||
assert_file "Gemfile", /gem\s+["']therubyrhino["']$/
|
||||
else
|
||||
assert_file "Gemfile" do |content|
|
||||
assert_no_match(/gem\s+["']therubyrhino["']$/, content)
|
||||
end
|
||||
assert_file "Gemfile", /# gem\s+["']therubyracer["']$/
|
||||
end
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in a new issue