lib/rails/generators/app_base.rb in railties-4.1.0.rc1 vs lib/rails/generators/app_base.rb in railties-4.1.0.rc2

- old
+ new

@@ -109,11 +109,10 @@ database_gemfile_entry, assets_gemfile_entry, javascript_gemfile_entry, jbuilder_gemfile_entry, sdoc_gemfile_entry, - platform_dependent_gemfile_entry, spring_gemfile_entry, @extra_entries].flatten.find_all(&@gem_filter) end def add_gem_entry_filter @@ -176,12 +175,16 @@ class GemfileEntry < Struct.new(:name, :version, :comment, :options, :commented_out) def initialize(name, version, comment, options = {}, commented_out = false) 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) new(name, version, comment) end @@ -196,14 +199,14 @@ end def rails_gemfile_entry if options.dev? [GemfileEntry.path('rails', Rails::Generators::RAILS_DEV_PATH), - GemfileEntry.github('arel', 'rails/arel')] + GemfileEntry.github('arel', 'rails/arel', '5-0-stable')] elsif options.edge? - [GemfileEntry.github('rails', 'rails/rails'), - GemfileEntry.github('arel', 'rails/arel')] + [GemfileEntry.github('rails', 'rails/rails', '4-1-stable'), + GemfileEntry.github('arel', 'rails/arel', '5-0-stable')] else [GemfileEntry.version('rails', Rails::VERSION::STRING, "Bundle edge Rails instead: gem 'rails', github: 'rails/rails'")] end @@ -239,35 +242,27 @@ def assets_gemfile_entry return [] if options[:skip_sprockets] gems = [] if options.dev? || options.edge? - gems << GemfileEntry.github('sprockets-rails', 'rails/sprockets-rails', + gems << GemfileEntry.github('sprockets-rails', 'rails/sprockets-rails', nil, 'Use edge version of sprockets-rails') - 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.1', + '~> 4.0.2', 'Use SCSS for stylesheets') end gems << GemfileEntry.version('uglifier', '>= 1.3.0', 'Use Uglifier as compressor for JavaScript assets') gems end - def platform_dependent_gemfile_entry - gems = [] - if RUBY_ENGINE == 'rbx' - gems << GemfileEntry.version('rubysl', nil) - end - gems - end - def jbuilder_gemfile_entry comment = 'Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder' GemfileEntry.version('jbuilder', '~> 2.0', comment) end @@ -277,10 +272,10 @@ end def coffee_gemfile_entry comment = 'Use CoffeeScript for .js.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.0.0', comment end end