aboutsummaryrefslogtreecommitdiffstats
path: root/railties
diff options
context:
space:
mode:
Diffstat (limited to 'railties')
-rw-r--r--railties/CHANGELOG.md9
-rw-r--r--railties/lib/rails/commands/server.rb5
-rw-r--r--railties/lib/rails/generators/rails/app/app_generator.rb4
-rw-r--r--railties/lib/rails/generators/rails/app/templates/Gemfile5
-rw-r--r--railties/lib/rails/generators/rails/app/templates/config/databases/postgresql.yml2
-rw-r--r--railties/test/commands/server_test.rb10
6 files changed, 30 insertions, 5 deletions
diff --git a/railties/CHANGELOG.md b/railties/CHANGELOG.md
index 797cffc884..a4babbe8c3 100644
--- a/railties/CHANGELOG.md
+++ b/railties/CHANGELOG.md
@@ -1,3 +1,12 @@
+* Include `web-console` into newly generated applications' Gemfile.
+
+ *Genadi Samokovarov*
+
+* `rails server` will only extend the logger to output to STDOUT
+ in development environment.
+
+ *Richard Schneeman*
+
* Don't require passing path to app before options in `rails new`
and `rails plugin new`
diff --git a/railties/lib/rails/commands/server.rb b/railties/lib/rails/commands/server.rb
index 87d6505ed5..485bd1eb09 100644
--- a/railties/lib/rails/commands/server.rb
+++ b/railties/lib/rails/commands/server.rb
@@ -32,7 +32,8 @@ module Rails
opt_parser.parse! args
- options[:server] = args.shift
+ options[:log_stdout] = options[:daemonize].blank? && options[:environment] == "development"
+ options[:server] = args.shift
options
end
end
@@ -74,7 +75,7 @@ module Rails
FileUtils.mkdir_p(File.join(Rails.root, 'tmp', dir_to_make))
end
- unless options[:daemonize]
+ if options[:log_stdout]
wrapped_app # touch the app so the logger is set up
console = ActiveSupport::Logger.new($stdout)
diff --git a/railties/lib/rails/generators/rails/app/app_generator.rb b/railties/lib/rails/generators/rails/app/app_generator.rb
index cce11ba8bc..92c876c835 100644
--- a/railties/lib/rails/generators/rails/app/app_generator.rb
+++ b/railties/lib/rails/generators/rails/app/app_generator.rb
@@ -335,7 +335,7 @@ module Rails
def handle_rails_rc!
unless argv.delete("--no-rc")
- insert_railsrc(railsrc)
+ insert_railsrc_into_argv!(railsrc)
end
end
@@ -347,7 +347,7 @@ module Rails
end
end
- def insert_railsrc(railsrc)
+ def insert_railsrc_into_argv!(railsrc)
if File.exist?(railsrc)
extra_args_string = File.read(railsrc)
extra_args = extra_args_string.split(/\n+/).map {|l| l.split}.flatten
diff --git a/railties/lib/rails/generators/rails/app/templates/Gemfile b/railties/lib/rails/generators/rails/app/templates/Gemfile
index adc83353b4..edc76e6c34 100644
--- a/railties/lib/rails/generators/rails/app/templates/Gemfile
+++ b/railties/lib/rails/generators/rails/app/templates/Gemfile
@@ -10,13 +10,16 @@ source 'https://rubygems.org'
# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
gem 'jbuilder', '~> 1.2'
+# Run `rails console` in the browser. Read more: https://github.com/rails/web-console
+gem 'web-console', group: :development
+
group :doc do
# bundle exec rake doc:rails generates the API under doc/api.
gem 'sdoc', require: false
end
# Use ActiveModel has_secure_password
-# gem 'bcrypt-ruby', '~> 3.1.0'
+# gem 'bcrypt-ruby', '~> 3.1.2'
# Use unicorn as the app server
# gem 'unicorn'
diff --git a/railties/lib/rails/generators/rails/app/templates/config/databases/postgresql.yml b/railties/lib/rails/generators/rails/app/templates/config/databases/postgresql.yml
index eb569b7dab..0194dce6f3 100644
--- a/railties/lib/rails/generators/rails/app/templates/config/databases/postgresql.yml
+++ b/railties/lib/rails/generators/rails/app/templates/config/databases/postgresql.yml
@@ -55,6 +55,8 @@ production:
adapter: postgresql
encoding: unicode
database: <%= app_name %>_production
+ # For details on connection pooling, see rails configration guide
+ # http://guides.rubyonrails.org/configuring.html#database-pooling
pool: 5
username: <%= app_name %>
password:
diff --git a/railties/test/commands/server_test.rb b/railties/test/commands/server_test.rb
index cb57b3c0cd..20afca2618 100644
--- a/railties/test/commands/server_test.rb
+++ b/railties/test/commands/server_test.rb
@@ -39,4 +39,14 @@ class Rails::ServerTest < ActiveSupport::TestCase
assert_equal 'production', server.options[:environment]
end
end
+
+ def test_log_stdout
+ args = ["-e", "development"]
+ options = Rails::Server::Options.new.parse!(args)
+ assert_equal true, options[:log_stdout]
+
+ args = ["-e", "production"]
+ options = Rails::Server::Options.new.parse!(args)
+ assert_equal false, options[:log_stdout]
+ end
end