gem_group(*names, &block)
public
Wraps gem entries inside
a group.
gem_group :development, :test do
gem "rspec-rails"
end
# File railties/lib/rails/generators/actions.rb, line 49
def gem_group(*names, &block)
name = names.map(&:inspect).join(", ")
log :gemfile, "group #{name}"
in_root do
append_file "Gemfile", "\ngroup #{name} do", force: true
@in_group = true
instance_eval(&block)
@in_group = false
append_file "Gemfile", "\nend\n", force: true
end
end