-
Notifications
You must be signed in to change notification settings - Fork 21.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
9385752
commit 61c65a0
Showing
1 changed file
with
17 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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) | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
rafaelfranca
Member
|
||
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 | ||
This comment has been minimized.
Sorry, something went wrong.
rubys
Contributor
|
||
else | ||
GemfileGem.new 'therubyracer', comment, nil, { :platforms => :ruby }, true | ||
GemfileEntry.new 'therubyracer', comment, nil, { :platforms => :ruby }, true | ||
end | ||
end | ||
|
||
|
Is this part of the public API? (#nodoc it?)