aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArun Agrawal <arunagw@gmail.com>2013-11-01 11:11:52 +0100
committerArun Agrawal <arunagw@gmail.com>2013-11-01 13:44:49 +0100
commite42fb393c25e80a423e75e598e6988a0a35389b9 (patch)
tree0192c6a616436dede540a9eb0a9413405e0ddea3
parent2e7ee652d2c1466787b45de59464ca096019e784 (diff)
downloadrails-e42fb393c25e80a423e75e598e6988a0a35389b9.tar.gz
rails-e42fb393c25e80a423e75e598e6988a0a35389b9.tar.bz2
rails-e42fb393c25e80a423e75e598e6988a0a35389b9.zip
Passing args for gemfile entry
Fixing build
-rw-r--r--railties/lib/rails/generators/app_base.rb8
-rw-r--r--railties/test/generators/generator_test.rb2
2 files changed, 8 insertions, 2 deletions
diff --git a/railties/lib/rails/generators/app_base.rb b/railties/lib/rails/generators/app_base.rb
index 35c6ce1cf8..ca299273ae 100644
--- a/railties/lib/rails/generators/app_base.rb
+++ b/railties/lib/rails/generators/app_base.rb
@@ -6,6 +6,7 @@ require 'rbconfig'
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 @@ module Rails
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 dd4868585b..7871399dd7 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