From 46617f02c6e473b7e695330076d2039de1c9aff2 Mon Sep 17 00:00:00 2001 From: Godfrey Chan Date: Fri, 12 Dec 2014 11:23:13 -0800 Subject: Align the GemfileEntry API with stable branches See 63462ec --- railties/lib/rails/generators/app_base.rb | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/railties/lib/rails/generators/app_base.rb b/railties/lib/rails/generators/app_base.rb index 3ea50607a5..4ed7f8ddf5 100644 --- a/railties/lib/rails/generators/app_base.rb +++ b/railties/lib/rails/generators/app_base.rb @@ -181,8 +181,12 @@ module Rails super end - def self.github(name, github, comment = nil) - new(name, nil, comment, github: github) + def self.github(name, github, branch = nil, comment = nil) + if branch + new(name, nil, comment, github: github, branch: branch) + else + new(name, nil, comment, github: github) + end end def self.version(name, version, comment = nil) @@ -238,7 +242,7 @@ module Rails gems = [] if options.dev? || options.edge? - gems << GemfileEntry.github('sass-rails', 'rails/sass-rails', + gems << GemfileEntry.github('sass-rails', 'rails/sass-rails', nil, 'Use SCSS for stylesheets') else gems << GemfileEntry.version('sass-rails', '~> 4.0', @@ -265,7 +269,7 @@ module Rails def console_gemfile_entry comment = 'Use Rails Console on the Browser' if options.dev? || options.edge? - GemfileEntry.github 'web-console', 'rails/web-console', comment + GemfileEntry.github 'web-console', 'rails/web-console', nil, comment else [] end @@ -274,7 +278,7 @@ module Rails def coffee_gemfile_entry comment = 'Use CoffeeScript for .coffee assets and views' if options.dev? || options.edge? - GemfileEntry.github 'coffee-rails', 'rails/coffee-rails', comment + GemfileEntry.github 'coffee-rails', 'rails/coffee-rails', nil, comment else GemfileEntry.version 'coffee-rails', '~> 4.1.0', comment end -- cgit v1.2.3