Stop using padding in the generated Gemfile -- it looks shit

上级 b89c5a04
......@@ -195,10 +195,6 @@ def self.version(name, version, comment = nil)
def self.path(name, path, comment = nil)
new(name, nil, comment, path: path)
end
def padding(max_width)
' ' * (max_width - name.length + 2)
end
end
def rails_gemfile_entry
......
source 'https://rubygems.org'
<% max_width = gemfile_entries.map { |g| g.name.length }.max -%>
<% gemfile_entries.each do |gem| -%>
<% if gem.comment -%>
......@@ -8,7 +7,7 @@ source 'https://rubygems.org'
<% end -%>
<%= gem.commented_out ? '# ' : '' %>gem '<%= gem.name %>'<%= %(, '#{gem.version}') if gem.version -%>
<% if gem.options.any? -%>
,<%= gem.padding(max_width) %><%= gem.options.map { |k,v|
, <%= gem.options.map { |k,v|
"#{k}: #{v.inspect}" }.join(', ') %>
<% end -%>
<% end -%>
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册