提交 94bcdd60 编写于 作者: G Guillermo Iguaran

Add therubyracer gem commented in default Gemfile

上级 31472ba6
......@@ -195,7 +195,9 @@ def assets_gemfile_entry
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 @@ def assets_gemfile_entry
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 @@ def javascript_gemfile_entry
"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 @@ def test_generator_if_skip_sprockets_is_given
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
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册