Permalink
Browse files

fix the class name

  • Loading branch information...
1 parent 9385752 commit 61c65a0aefc535d20c4ae5f4d51dbb3f624f1836 @tenderlove tenderlove committed Oct 27, 2013
Showing with 17 additions and 17 deletions.
  1. +17 −17 railties/lib/rails/generators/app_base.rb
@@ -122,7 +122,7 @@ def set_default_accessors!
def database_gemfile_entry
return [] if options[:skip_active_record]
- gem = GemfileGem.version gem_for_database, nil,
+ gem = GemfileEntry.version gem_for_database, nil,
"Use #{options[:database]} as the database for Active Record"
return [gem]
end
@@ -135,7 +135,7 @@ def comment_if(value)
options[value] ? '# ' : ''
end
- class GemfileGem < Struct.new(:name, :comment, :version, :options, :commented_out)
+ class GemfileEntry < Struct.new(:name, :comment, :version, :options, :commented_out)
@frodsan

frodsan Oct 27, 2013

Contributor

Is this part of the public API? (#nodoc it?)

@rafaelfranca

rafaelfranca Oct 27, 2013

Owner

I think it will part of public API since users will be able to use the methods to filter the gems they want

@frodsan

frodsan Oct 28, 2013

Contributor

cool 👍

def initialize(name, comment, version, options = {}, commented_out = false)
super
end
@@ -164,17 +164,17 @@ def padding(max_width)
def rails_gemfile_entry
if options.dev?
[
- GemfileGem.path('rails', Rails::Generators::RAILS_DEV_PATH),
- GemfileGem.github('arel', 'rails/arel'),
+ GemfileEntry.path('rails', Rails::Generators::RAILS_DEV_PATH),
+ GemfileEntry.github('arel', 'rails/arel'),
]
elsif options.edge?
[
- GemfileGem.path('rails', 'rails/rails'),
- GemfileGem.path('arel', 'rails/arel'),
+ GemfileEntry.path('rails', 'rails/rails'),
+ GemfileEntry.path('arel', 'rails/arel'),
]
else
[
- GemfileGem.new('rails', "Bundle edge Rails instead: gem 'rails', github: 'rails/rails'", Rails::VERSION::STRING)
+ GemfileEntry.new('rails', "Bundle edge Rails instead: gem 'rails', github: 'rails/rails'", Rails::VERSION::STRING)
]
end
end
@@ -211,17 +211,17 @@ def assets_gemfile_entry
gems = []
gemfile = if options.dev? || options.edge?
- gems << GemfileGem.github('sprockets-rails', 'rails/sprockets-rails',
+ gems << GemfileEntry.github('sprockets-rails', 'rails/sprockets-rails',
'Use edge version of sprockets-rails')
- gems << GemfileGem.github('sass-rails', 'rails/sass-rails',
+ gems << GemfileEntry.github('sass-rails', 'rails/sass-rails',
'Use SCSS for stylesheets')
else
- gems << GemfileGem.version('sass-rails',
+ gems << GemfileEntry.version('sass-rails',
'~> 4.0.0.rc1',
'Use SCSS for stylesheets')
end
- gems << GemfileGem.version('uglifier',
+ gems << GemfileEntry.version('uglifier',
'>= 1.3.0',
'Use Uglifier as compressor for JavaScript assets')
@@ -236,9 +236,9 @@ def assets_gemfile_entry
def coffee_gemfile_entry
comment = 'Use CoffeeScript for .js.coffee assets and views'
if options.dev? || options.edge?
- GemfileGem.github 'coffee-rails', 'rails/coffee-rails', comment
+ GemfileEntry.github 'coffee-rails', 'rails/coffee-rails', comment
else
- GemfileGem.version 'coffee-rails', '~> 4.0.0', comment
+ GemfileEntry.version 'coffee-rails', '~> 4.0.0', comment
end
end
@@ -247,20 +247,20 @@ def javascript_gemfile_entry
[]
else
gems = [coffee_gemfile_entry, javascript_runtime_gemfile_entry]
- gems << GemfileGem.version("#{options[:javascript]}-rails", nil,
+ gems << GemfileEntry.version("#{options[:javascript]}-rails", nil,
"Use #{options[:javascript]} as the JavaScript library")
- gems << GemfileGem.version("turbolinks", nil,
+ gems << GemfileEntry.version("turbolinks", nil,
"Turbolinks makes following links in your web application faster. Read more: https://github.com/rails/turbolinks")
end
end
def javascript_runtime_gemfile_entry
comment = 'See https://github.com/sstephenson/execjs#readme for more supported runtimes'
runtime = if defined?(JRUBY_VERSION)
- GemfileGem.version 'therubyrhino', comment, nil
+ GemfileEntry.version 'therubyrhino', comment, nil
@rubys

rubys Nov 1, 2013

Contributor

The order of the parameters appears to be wrong, perhaps the class itself could be made more consistent?

class GemfileEntry < Struct.new(:name, :comment, :version, :options, :commented_out)
def initialize(name, comment, version, options = {}, commented_out = false)
def self.version(name, version, comment = nil)
else
- GemfileGem.new 'therubyracer', comment, nil, { :platforms => :ruby }, true
+ GemfileEntry.new 'therubyracer', comment, nil, { :platforms => :ruby }, true
end
end

0 comments on commit 61c65a0

Please sign in to comment.