Add coffee-rails and javascript runtime to gemfile if skip_javascript is

provided
上级 cf46c314
......@@ -192,6 +192,13 @@ def assets_gemfile_entry
GEMFILE
end
if options[:skip_javascript]
gemfile += <<-GEMFILE.gsub(/^ {12}/, '')
#{coffee_gemfile_entry}
#{javascript_runtime_gemfile_entry}
GEMFILE
end
gemfile.strip_heredoc.gsub(/^[ \t]*$/, '')
end
......@@ -220,7 +227,7 @@ def javascript_gemfile_entry
end
end
def javascript_runtime_gemfile_entry(n_spaces=0)
def javascript_runtime_gemfile_entry
runtime = if defined?(JRUBY_VERSION)
"gem 'therubyrhino'"
else
......@@ -228,7 +235,7 @@ def javascript_runtime_gemfile_entry(n_spaces=0)
end
<<-GEMFILE.gsub(/^ {10}/, '')
# See https://github.com/sstephenson/execjs#readme for more supported runtimes
#{" "*n_spaces}#{runtime}
#{runtime}
GEMFILE
end
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册