Skip to content

Commit

Permalink
fix template Gemfiles
Browse files Browse the repository at this point in the history
  • Loading branch information
tenderlove committed Oct 29, 2013
1 parent faa1b82 commit f5ef5ed
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 12 deletions.
11 changes: 11 additions & 0 deletions railties/lib/rails/generators/app_base.rb
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -83,6 +83,17 @@ def initialize(*args)


protected 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 def builder
@builder ||= begin @builder ||= begin
builder_class = get_builder_class builder_class = get_builder_class
Expand Down
11 changes: 0 additions & 11 deletions railties/lib/rails/generators/rails/app/app_generator.rb
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -164,17 +164,6 @@ def initialize(*args)
end end
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 :set_default_accessors!
public_task :create_root public_task :create_root


Expand Down
15 changes: 14 additions & 1 deletion railties/lib/rails/generators/rails/plugin/templates/Gemfile
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -23,7 +23,20 @@ end
<% if options.dev? || options.edge? -%> <% if options.dev? || options.edge? -%>
# Your gem is dependent on dev or edge Rails. Once you can lock this # 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. # 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 -%> <% end -%>
# To use debugger # To use debugger
Expand Down

0 comments on commit f5ef5ed

Please sign in to comment.