diff --git a/railties/lib/rails/generators/app_base.rb b/railties/lib/rails/generators/app_base.rb index 35c6ce1cf842d800df8d0e9d520f3cd01c049b79..ca299273ae6a8af6f009be66effaa5a0ef5b0bdd 100644 --- a/railties/lib/rails/generators/app_base.rb +++ b/railties/lib/rails/generators/app_base.rb @@ -6,6 +6,7 @@ require 'open-uri' require 'uri' require 'rails/generators/base' +require 'active_support/core_ext/array/extract_options' module Rails module Generators @@ -86,7 +87,12 @@ def initialize(*args) protected - def gemfile_entry(name, version = nil, github: nil, path: nil) + def gemfile_entry(name, *args) + options = args.extract_options! + version = args.first + github = options[:github] + path = options[:path] + if github @extra_entries << GemfileEntry.github(name, github) elsif path diff --git a/railties/test/generators/generator_test.rb b/railties/test/generators/generator_test.rb index dd4868585bf54cb803eb0695ad79cc44d50e7e10..7871399dd718cbf119edced9078c84f2f0f04048 100644 --- a/railties/test/generators/generator_test.rb +++ b/railties/test/generators/generator_test.rb @@ -6,7 +6,7 @@ module Rails module Generators class GeneratorTest < ActiveSupport::TestCase def make_builder_class - klass = Class.new(AppBase) do + Class.new(AppBase) do add_shared_options_for "application" # include a module to get around thor's method_added hook