instance method
gem_group
Ruby on Rails 7.1.6
Since v3.2.22.5Signature
gem_group(*names, &block)
Wraps gem entries inside a group.
gem_group :development, :test do gem "rspec-rails" end
Parameters
-
namesrest -
blockblock
Source
# File railties/lib/rails/generators/actions.rb, line 111
def gem_group(*names, &block)
options = names.extract_options!
str = names.map(&:inspect)
str << quote(options) unless options.empty?
str = str.join(", ")
log :gemfile, "group #{str}"
in_root do
append_file_with_newline "Gemfile", "\ngroup #{str} do", force: true
with_indentation(&block)
append_file_with_newline "Gemfile", "end", force: true
end
end
Defined in railties/lib/rails/generators/actions.rb line 111
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in Rails::Generators::Actions