aboutsummaryrefslogtreecommitdiffstats
path: root/railties/lib/rails/generators/rails/plugin/templates/Gemfile
diff options
context:
space:
mode:
authorXavier Noria <fxn@hashref.com>2014-01-12 21:25:16 +0100
committerXavier Noria <fxn@hashref.com>2014-01-12 22:14:44 +0100
commit20a795f64d8a4f540004d7361f6a02e81eba79bb (patch)
tree0ce0533d0418f1788411f470dea18a1aeee14906 /railties/lib/rails/generators/rails/plugin/templates/Gemfile
parent75c271198ac2c94c58b46389383aef2df1afc572 (diff)
downloadrails-20a795f64d8a4f540004d7361f6a02e81eba79bb.tar.gz
rails-20a795f64d8a4f540004d7361f6a02e81eba79bb.tar.bz2
rails-20a795f64d8a4f540004d7361f6a02e81eba79bb.zip
fixes the Gemfile generator templates
The templates were written as if for a given gem you could either pass a version or options, but not both. But you may want to specify a version and also a group or whether the gem has to be required, for example.
Diffstat (limited to 'railties/lib/rails/generators/rails/plugin/templates/Gemfile')
-rw-r--r--railties/lib/rails/generators/rails/plugin/templates/Gemfile6
1 files changed, 2 insertions, 4 deletions
diff --git a/railties/lib/rails/generators/rails/plugin/templates/Gemfile b/railties/lib/rails/generators/rails/plugin/templates/Gemfile
index 88ec4e6354..f0a832f783 100644
--- a/railties/lib/rails/generators/rails/plugin/templates/Gemfile
+++ b/railties/lib/rails/generators/rails/plugin/templates/Gemfile
@@ -29,12 +29,10 @@ end
# <%= gem.comment %>
<% end -%>
-<%= gem.commented_out ? '# ' : '' %>gem '<%= gem.name %>'<% if gem.version -%>
-, '<%= gem.version %>'
-<% elsif gem.options.any? -%>
+<%= gem.commented_out ? '# ' : '' %>gem '<%= gem.name %>'<%= %(, '#{gem.version}') if gem.version -%>
+<% if gem.options.any? -%>
,<%= gem.padding(max_width) %><%= gem.options.map { |k,v|
"#{k}: #{v.inspect}" }.join(', ') %>
-<% else %>
<% end -%>
<% end -%>