Skip to content

Commit

Permalink
[padrino-gen] Fix in my latest commit.
Browse files Browse the repository at this point in the history
  • Loading branch information
DAddYE committed May 3, 2010
1 parent e8dc96e commit 494739d
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions padrino-gen/lib/padrino-gen/generators/actions.rb
Expand Up @@ -107,10 +107,9 @@ def require_dependencies(*gem_names)
# insert_into_gemfile(name, :group => 'test', :require => 'foo')
def insert_into_gemfile(name, options={})
after_pattern = options[:group] ? "#{options[:group].to_s.capitalize} requirements\n" : "Component requirements\n"
gem_options = options.map { |k, v| "#{k.inspect} => #{v.inspect}" }.join(", ")
include_text = "gem '#{name}'" << (gem_options.present? ? ", #{gem_options}" : "") << "\n"
options.merge!(:content => include_text, :after => after_pattern)
inject_into_file('Gemfile', options[:content], :after => options[:after])
gem_options = options.map { |k, v| "#{k.inspect} => #{v.inspect}" }.join(", ")
include_text = "gem '#{name}'" << (gem_options.present? ? ", #{gem_options}" : "") << "\n"
inject_into_file('Gemfile', include_text, :after => after_pattern)
end

## Return true if our project has test component
Expand Down

0 comments on commit 494739d

Please sign in to comment.