module Rails::Generators::Actions
def gem_group(*names, &block)
gem "rspec-rails"
gem_group :development, :test do
Wraps gem entries inside a group.
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