Permalink
Browse files

fix template Gemfiles

  • Loading branch information...
1 parent faa1b82 commit f5ef5ed3d5f3d432715a2b187fe8f72f6d5acf6d @tenderlove tenderlove committed Oct 29, 2013
@@ -83,6 +83,17 @@ def initialize(*args)
protected
+ def gemfile_entries
+ @gemfile_entries ||= [
+ rails_gemfile_entry,
+ database_gemfile_entry,
+ assets_gemfile_entry,
+ javascript_gemfile_entry,
+ jbuilder_gemfile_entry,
+ webconsole_gemfile_entry,
+ sdoc_gemfile_entry].flatten
+ end
+
def builder
@builder ||= begin
builder_class = get_builder_class
@@ -164,17 +164,6 @@ def initialize(*args)
end
end
- def gemfile_entries
- @gemfile_entries ||= [
- rails_gemfile_entry,
- database_gemfile_entry,
- assets_gemfile_entry,
- javascript_gemfile_entry,
- jbuilder_gemfile_entry,
- webconsole_gemfile_entry,
- sdoc_gemfile_entry].flatten
- end
-
public_task :set_default_accessors!
public_task :create_root
@@ -23,7 +23,20 @@ end
<% if options.dev? || options.edge? -%>
# Your gem is dependent on dev or edge Rails. Once you can lock this
# dependency down to a specific version, move it to your gemspec.
-<%= rails_gemfile_entry -%>
+<% max_width = gemfile_entries.map { |g| g.name.length }.max -%>
+<% gemfile_entries.each do |gem| -%>
+<% if gem.comment -%>
+
+# <%= gem.comment %>
+<% end -%>
+<%= gem.commented_out ? '# ' : '' %>gem '<%= gem.name %>'<% if gem.version -%>
+, '<%= gem.version %>'
+<% elsif gem.options.any? -%>
+,<%= gem.padding(max_width) %><%= gem.options.map { |k,v|
+ "#{k}: #{v.inspect}" }.join(', ') %>
+<% else %>
+<% end -%>
+<% end -%>
<% end -%>
# To use debugger

0 comments on commit f5ef5ed

Please sign in to comment.