aboutsummaryrefslogtreecommitdiffstats
path: root/railties/lib/rails
diff options
context:
space:
mode:
Diffstat (limited to 'railties/lib/rails')
-rw-r--r--railties/lib/rails/commands/dbconsole.rb2
-rw-r--r--railties/lib/rails/generators/app_base.rb37
-rw-r--r--railties/lib/rails/generators/rails/app/templates/Gemfile4
-rw-r--r--railties/lib/rails/generators/rails/app/templates/config/databases/mysql.yml2
-rw-r--r--railties/lib/rails/tasks/statistics.rake6
5 files changed, 25 insertions, 26 deletions
diff --git a/railties/lib/rails/commands/dbconsole.rb b/railties/lib/rails/commands/dbconsole.rb
index 9014560611..0d8b3de0eb 100644
--- a/railties/lib/rails/commands/dbconsole.rb
+++ b/railties/lib/rails/commands/dbconsole.rb
@@ -178,7 +178,7 @@ module Rails
found = commands.detect do |cmd|
dirs_on_path.detect do |path|
full_path_command = File.join(path, cmd)
- File.executable? full_path_command
+ File.file?(full_path_command) && File.executable?(full_path_command)
end
end
diff --git a/railties/lib/rails/generators/app_base.rb b/railties/lib/rails/generators/app_base.rb
index 3ea50607a5..3db5b50ad6 100644
--- a/railties/lib/rails/generators/app_base.rb
+++ b/railties/lib/rails/generators/app_base.rb
@@ -111,7 +111,6 @@ module Rails
jbuilder_gemfile_entry,
sdoc_gemfile_entry,
psych_gemfile_entry,
- console_gemfile_entry,
@extra_entries].flatten.find_all(&@gem_filter)
end
@@ -181,8 +180,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)
@@ -196,9 +199,15 @@ module Rails
def rails_gemfile_entry
if options.dev?
- [GemfileEntry.path('rails', Rails::Generators::RAILS_DEV_PATH)]
+ [
+ GemfileEntry.path('rails', Rails::Generators::RAILS_DEV_PATH),
+ GemfileEntry.github('arel', 'rails/arel')
+ ]
elsif options.edge?
- [GemfileEntry.github('rails', 'rails/rails')]
+ [
+ GemfileEntry.github('rails', 'rails/rails'),
+ GemfileEntry.github('arel', 'rails/arel')
+ ]
else
[GemfileEntry.version('rails',
Rails::VERSION::STRING,
@@ -237,13 +246,8 @@ module Rails
return [] if options[:skip_sprockets]
gems = []
- if options.dev? || options.edge?
- gems << GemfileEntry.github('sass-rails', 'rails/sass-rails',
- 'Use SCSS for stylesheets')
- else
- gems << GemfileEntry.version('sass-rails', '~> 4.0',
+ gems << GemfileEntry.version('sass-rails', '~> 5.0',
'Use SCSS for stylesheets')
- end
gems << GemfileEntry.version('uglifier',
'>= 1.3.0',
@@ -262,19 +266,10 @@ module Rails
GemfileEntry.new('sdoc', '~> 0.4.0', comment, group: :doc)
end
- def console_gemfile_entry
- comment = 'Use Rails Console on the Browser'
- if options.dev? || options.edge?
- GemfileEntry.github 'web-console', 'rails/web-console', comment
- else
- []
- end
- end
-
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
diff --git a/railties/lib/rails/generators/rails/app/templates/Gemfile b/railties/lib/rails/generators/rails/app/templates/Gemfile
index 7027312aa9..c5bd98a30e 100644
--- a/railties/lib/rails/generators/rails/app/templates/Gemfile
+++ b/railties/lib/rails/generators/rails/app/templates/Gemfile
@@ -32,7 +32,11 @@ group :development, :test do
<%- end -%>
# Access an IRB console on exception pages or by using <%%= console %> in views
+ <%- if options.dev? || options.edge? -%>
+ gem 'web-console', github: "rails/web-console"
+ <%- else -%>
gem 'web-console', '~> 2.0'
+ <%- end -%>
<%- if spring_install? %>
# Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring
gem 'spring'
diff --git a/railties/lib/rails/generators/rails/app/templates/config/databases/mysql.yml b/railties/lib/rails/generators/rails/app/templates/config/databases/mysql.yml
index 4b2e6646c7..596c916573 100644
--- a/railties/lib/rails/generators/rails/app/templates/config/databases/mysql.yml
+++ b/railties/lib/rails/generators/rails/app/templates/config/databases/mysql.yml
@@ -1,6 +1,6 @@
# MySQL. Versions 5.0+ are recommended.
#
-# Install the MYSQL driver
+# Install the MySQL driver
# gem install mysql2
#
# Ensure the MySQL gem is defined in your Gemfile
diff --git a/railties/lib/rails/tasks/statistics.rake b/railties/lib/rails/tasks/statistics.rake
index 4f09ded31d..ba6168e208 100644
--- a/railties/lib/rails/tasks/statistics.rake
+++ b/railties/lib/rails/tasks/statistics.rake
@@ -1,6 +1,6 @@
-# while having global constant is not good,
-# many 3rd party tools depend on it, like rspec-rails, cucumber-rails, etc
-# so if will be removed - deprecation warning is needed
+# While global constants are bad, many 3rd party tools depend on this one (e.g
+# rspec-rails & cucumber-rails). So a deprecation warning is needed if we want
+# to remove it.
STATS_DIRECTORIES = [
%w(Controllers app/controllers),
%w(Helpers app/helpers),