From b1867c85fa934caad1cd7410e1bd9bc0463a2f42 Mon Sep 17 00:00:00 2001 From: Guillermo Iguaran Date: Fri, 21 Feb 2014 09:50:19 -0500 Subject: Revert "Only lookup `config.log_level` for stdlib `::Logger`. Closes #11665." This reverts commit e0a521cfcd13e4d1f0ae8ab96004289e1c020f71. Conflicts: railties/CHANGELOG.md We expect loggers to quack like stdlib logger. If log4r needs different level= assignment, using a Logger-quacking wrapper is the way to do it. Fixes #14114. --- railties/CHANGELOG.md | 7 ------- railties/lib/rails/application/bootstrap.rb | 6 +----- railties/test/application/configuration_test.rb | 15 +-------------- 3 files changed, 2 insertions(+), 26 deletions(-) (limited to 'railties') diff --git a/railties/CHANGELOG.md b/railties/CHANGELOG.md index bade9ef543..bb3cc1760e 100644 --- a/railties/CHANGELOG.md +++ b/railties/CHANGELOG.md @@ -25,13 +25,6 @@ *Cristian Mircea Messel*, *Chulki Lee* -* Only lookup `config.log_level` for stdlib `::Logger` instances. - Assign it as is for third party loggers like `Log4r::Logger`. - - Fixes #13421. - - *Yves Senn* - * The `Gemfile` of new applications depends on SDoc ~> 0.4.0. *Xavier Noria* diff --git a/railties/lib/rails/application/bootstrap.rb b/railties/lib/rails/application/bootstrap.rb index 33bcab1e57..a26d41c0cf 100644 --- a/railties/lib/rails/application/bootstrap.rb +++ b/railties/lib/rails/application/bootstrap.rb @@ -53,11 +53,7 @@ INFO logger end - if ::Logger === Rails.logger - Rails.logger.level = ActiveSupport::Logger.const_get(config.log_level.to_s.upcase) - else - Rails.logger.level = config.log_level - end + Rails.logger.level = ActiveSupport::Logger.const_get(config.log_level.to_s.upcase) end # Initialize cache early in the stack so railties can make use of it. diff --git a/railties/test/application/configuration_test.rb b/railties/test/application/configuration_test.rb index b2d0e7e202..b39cd3747b 100644 --- a/railties/test/application/configuration_test.rb +++ b/railties/test/application/configuration_test.rb @@ -762,7 +762,7 @@ module ApplicationTests end end - test "lookup config.log_level with custom logger (stdlib Logger)" do + test "config.log_level with custom logger" do make_basic_app do |app| app.config.logger = Logger.new(STDOUT) app.config.log_level = :info @@ -770,19 +770,6 @@ module ApplicationTests assert_equal Logger::INFO, Rails.logger.level end - test "assign log_level as is with custom logger (third party logger)" do - logger_class = Class.new do - attr_accessor :level - end - logger_instance = logger_class.new - make_basic_app do |app| - app.config.logger = logger_instance - app.config.log_level = :info - end - assert_equal logger_instance, Rails.logger - assert_equal :info, Rails.logger.level - end - test "respond_to? accepts include_private" do make_basic_app -- cgit v1.2.3 From de8bef98785a78332db037b1cd6f602b2a30026d Mon Sep 17 00:00:00 2001 From: Kuldeep Aggarwal Date: Sun, 23 Feb 2014 13:10:41 +0530 Subject: Add warning when user tried to create model with pluralize name. 1. Generate model with correct_name. 2. It will help new users to avoid mistakes when tried to create model with wrong name. --- railties/lib/rails/generators/model_helpers.rb | 26 ++++++++++++++++++++++ .../generators/rails/model/model_generator.rb | 4 ++++ railties/lib/rails/generators/resource_helpers.rb | 13 ++--------- railties/test/generators/model_generator_test.rb | 7 ++++++ .../test/generators/resource_generator_test.rb | 2 +- 5 files changed, 40 insertions(+), 12 deletions(-) create mode 100644 railties/lib/rails/generators/model_helpers.rb (limited to 'railties') diff --git a/railties/lib/rails/generators/model_helpers.rb b/railties/lib/rails/generators/model_helpers.rb new file mode 100644 index 0000000000..1309446995 --- /dev/null +++ b/railties/lib/rails/generators/model_helpers.rb @@ -0,0 +1,26 @@ +require 'rails/generators/active_model' + +module Rails + module Generators + module ModelHelpers # :nodoc: + PLURAL_MODEL_NAME_WARN_MESSAGE = 'Plural version of the model detected, using singularized version. Override with --force-plural or setup custom inflection rules for this noun before running the generator.' + mattr_accessor :skip_warn + + def self.included(base) #:nodoc: + base.class_option :force_plural, type: :boolean, default: false, desc: 'Forces the use of a plural model name' + end + + def initialize(args, *_options) + super + if name == name.pluralize && name.singularize != name.pluralize && !options[:force_plural] + unless ModelHelpers.skip_warn + say PLURAL_MODEL_NAME_WARN_MESSAGE + ModelHelpers.skip_warn = true + end + name.replace name.singularize + assign_names!(name) + end + end + end + end +end diff --git a/railties/lib/rails/generators/rails/model/model_generator.rb b/railties/lib/rails/generators/rails/model/model_generator.rb index ea3d69d7c9..87bab129bb 100644 --- a/railties/lib/rails/generators/rails/model/model_generator.rb +++ b/railties/lib/rails/generators/rails/model/model_generator.rb @@ -1,6 +1,10 @@ +require 'rails/generators/model_helpers' + module Rails module Generators class ModelGenerator < NamedBase # :nodoc: + include Rails::Generators::ModelHelpers + argument :attributes, type: :array, default: [], banner: "field[:type][:index] field[:type][:index]" hook_for :orm, required: true end diff --git a/railties/lib/rails/generators/resource_helpers.rb b/railties/lib/rails/generators/resource_helpers.rb index 7329ee9f48..4669935156 100644 --- a/railties/lib/rails/generators/resource_helpers.rb +++ b/railties/lib/rails/generators/resource_helpers.rb @@ -1,14 +1,14 @@ require 'rails/generators/active_model' +require 'rails/generators/model_helpers' module Rails module Generators # Deal with controller names on scaffold and add some helpers to deal with # ActiveModel. module ResourceHelpers # :nodoc: - mattr_accessor :skip_warn def self.included(base) #:nodoc: - base.class_option :force_plural, type: :boolean, desc: "Forces the use of a plural ModelName" + base.send :include, Rails::Generators::ModelHelpers base.class_option :model_name, type: :string, desc: "ModelName to be used" end @@ -21,15 +21,6 @@ module Rails assign_names!(self.name) end - if name == name.pluralize && name.singularize != name.pluralize && !options[:force_plural] - unless ResourceHelpers.skip_warn - say "Plural version of the model detected, using singularized version. Override with --force-plural." - ResourceHelpers.skip_warn = true - end - name.replace name.singularize - assign_names!(name) - end - assign_controller_names!(controller_name.pluralize) end diff --git a/railties/test/generators/model_generator_test.rb b/railties/test/generators/model_generator_test.rb index 01ab77ee20..cf307d23e1 100644 --- a/railties/test/generators/model_generator_test.rb +++ b/railties/test/generators/model_generator_test.rb @@ -34,6 +34,13 @@ class ModelGeneratorTest < Rails::Generators::TestCase assert_no_migration "db/migrate/create_accounts.rb" end + def test_plural_names_are_singularized + content = run_generator ["accounts".freeze] + assert_file "app/models/account.rb", /class Account < ActiveRecord::Base/ + assert_file "test/models/account_test.rb", /class AccountTest/ + assert_match(/Plural version of the model detected, using singularized version. Override with --force-plural or setup custom inflection rules for this noun before running the generator./, content) + end + def test_model_with_underscored_parent_option run_generator ["account", "--parent", "admin/account"] assert_file "app/models/account.rb", /class Account < Admin::Account/ diff --git a/railties/test/generators/resource_generator_test.rb b/railties/test/generators/resource_generator_test.rb index 3d4e694361..297cf99998 100644 --- a/railties/test/generators/resource_generator_test.rb +++ b/railties/test/generators/resource_generator_test.rb @@ -63,7 +63,7 @@ class ResourceGeneratorTest < Rails::Generators::TestCase content = run_generator ["accounts".freeze] assert_file "app/models/account.rb", /class Account < ActiveRecord::Base/ assert_file "test/models/account_test.rb", /class AccountTest/ - assert_match(/Plural version of the model detected, using singularized version. Override with --force-plural./, content) + assert_match(/Plural version of the model detected, using singularized version. Override with --force-plural or setup custom inflection rules for this noun before running the generator./, content) end def test_plural_names_can_be_forced -- cgit v1.2.3 From c554d170e6b3e7ebe783ab356e16abc9bfd56615 Mon Sep 17 00:00:00 2001 From: Yves Senn Date: Sun, 23 Feb 2014 13:14:43 +0100 Subject: update version to 4.2.0.alpha --- railties/lib/rails/version.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'railties') diff --git a/railties/lib/rails/version.rb b/railties/lib/rails/version.rb index e4fd798d18..79313c936a 100644 --- a/railties/lib/rails/version.rb +++ b/railties/lib/rails/version.rb @@ -1,9 +1,9 @@ module Rails module VERSION MAJOR = 4 - MINOR = 1 + MINOR = 2 TINY = 0 - PRE = "beta2" + PRE = "alpha" STRING = [MAJOR, MINOR, TINY, PRE].compact.join(".") end -- cgit v1.2.3 From 2403869966c2d9adc0413e30d4855f8df2c5487b Mon Sep 17 00:00:00 2001 From: Carlos Antonio da Silva Date: Sun, 23 Feb 2014 22:45:16 -0300 Subject: Group assets options in production env template --- .../rails/app/templates/config/environments/production.rb.tt | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'railties') diff --git a/railties/lib/rails/generators/rails/app/templates/config/environments/production.rb.tt b/railties/lib/rails/generators/rails/app/templates/config/environments/production.rb.tt index d9cc60d656..b789ed9a94 100644 --- a/railties/lib/rails/generators/rails/app/templates/config/environments/production.rb.tt +++ b/railties/lib/rails/generators/rails/app/templates/config/environments/production.rb.tt @@ -35,6 +35,10 @@ Rails.application.configure do # Version of your assets, change this if you want to expire all your assets. config.assets.version = '1.0' + + # Precompile additional assets. + # application.js, application.css, and all non-JS/CSS in app/assets folder are already added. + # config.assets.precompile += %w( search.js ) <%- end -%> # Specifies the header that your server uses for sending files. @@ -59,12 +63,6 @@ Rails.application.configure do # Enable serving of images, stylesheets, and JavaScripts from an asset server. # config.action_controller.asset_host = "http://assets.example.com" - <%- unless options.skip_sprockets? -%> - # Precompile additional assets. - # application.js, application.css, and all non-JS/CSS in app/assets folder are already added. - # config.assets.precompile += %w( search.js ) - <%- end -%> - # Ignore bad email addresses and do not raise email delivery errors. # Set this to true and configure the email server for immediate delivery to raise delivery errors. # config.action_mailer.raise_delivery_errors = false -- cgit v1.2.3 From 174c9f0df39cd338a4871f82794256cc64f68a81 Mon Sep 17 00:00:00 2001 From: Yves Senn Date: Mon, 24 Feb 2014 09:43:30 +0100 Subject: include names in model generator warning message. refs #13515. This is a follow up to #13515. It includes the name given and the singularized version in the warning message. This will aide the user to see wether the detected singular was right or not. --- railties/lib/rails/generators/model_helpers.rb | 10 ++++++---- railties/test/generators/model_generator_test.rb | 2 +- 2 files changed, 7 insertions(+), 5 deletions(-) (limited to 'railties') diff --git a/railties/lib/rails/generators/model_helpers.rb b/railties/lib/rails/generators/model_helpers.rb index 1309446995..c4f45d344b 100644 --- a/railties/lib/rails/generators/model_helpers.rb +++ b/railties/lib/rails/generators/model_helpers.rb @@ -3,21 +3,23 @@ require 'rails/generators/active_model' module Rails module Generators module ModelHelpers # :nodoc: - PLURAL_MODEL_NAME_WARN_MESSAGE = 'Plural version of the model detected, using singularized version. Override with --force-plural or setup custom inflection rules for this noun before running the generator.' + PLURAL_MODEL_NAME_WARN_MESSAGE = "The model name '%s' was recognized as a plural, using the singular '%s'. " \ + "Override with --force-plural or setup custom inflection rules for this noun before running the generator." mattr_accessor :skip_warn def self.included(base) #:nodoc: - base.class_option :force_plural, type: :boolean, default: false, desc: 'Forces the use of a plural model name' + base.class_option :force_plural, type: :boolean, default: false, desc: 'Forces the use of the given model name' end def initialize(args, *_options) super if name == name.pluralize && name.singularize != name.pluralize && !options[:force_plural] + singular = name.singularize unless ModelHelpers.skip_warn - say PLURAL_MODEL_NAME_WARN_MESSAGE + say PLURAL_MODEL_NAME_WARN_MESSAGE % [name, singular] ModelHelpers.skip_warn = true end - name.replace name.singularize + name.replace singular assign_names!(name) end end diff --git a/railties/test/generators/model_generator_test.rb b/railties/test/generators/model_generator_test.rb index cf307d23e1..bdf51b457c 100644 --- a/railties/test/generators/model_generator_test.rb +++ b/railties/test/generators/model_generator_test.rb @@ -38,7 +38,7 @@ class ModelGeneratorTest < Rails::Generators::TestCase content = run_generator ["accounts".freeze] assert_file "app/models/account.rb", /class Account < ActiveRecord::Base/ assert_file "test/models/account_test.rb", /class AccountTest/ - assert_match(/Plural version of the model detected, using singularized version. Override with --force-plural or setup custom inflection rules for this noun before running the generator./, content) + assert_match(/The model name 'accounts' was recognized as a plural, using the singular 'account'\. Override with --force-plural or setup custom inflection rules for this noun before running the generator\./, content) end def test_model_with_underscored_parent_option -- cgit v1.2.3 From b5c6c31dba40b0c868cd71d3d903f92ed2e50543 Mon Sep 17 00:00:00 2001 From: Yves Senn Date: Mon, 24 Feb 2014 10:09:56 +0100 Subject: build fix. follow up to 174c9f0df39cd338a4871f82794256cc64f68a81 --- railties/test/generators/resource_generator_test.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'railties') diff --git a/railties/test/generators/resource_generator_test.rb b/railties/test/generators/resource_generator_test.rb index 297cf99998..55c8d92ee8 100644 --- a/railties/test/generators/resource_generator_test.rb +++ b/railties/test/generators/resource_generator_test.rb @@ -63,7 +63,7 @@ class ResourceGeneratorTest < Rails::Generators::TestCase content = run_generator ["accounts".freeze] assert_file "app/models/account.rb", /class Account < ActiveRecord::Base/ assert_file "test/models/account_test.rb", /class AccountTest/ - assert_match(/Plural version of the model detected, using singularized version. Override with --force-plural or setup custom inflection rules for this noun before running the generator./, content) + assert_match(/The model name 'accounts' was recognized as a plural, using the singular 'account'\. Override with --force-plural or setup custom inflection rules for this noun before running the generator\./, content) end def test_plural_names_can_be_forced -- cgit v1.2.3 From 71b3910a7d6c9c9a94af31510683390c2b3a1b23 Mon Sep 17 00:00:00 2001 From: Carlos Antonio da Silva Date: Tue, 25 Feb 2014 09:14:35 -0300 Subject: Point master changelogs to 4-1-stable branch Remove 4-1 related entries from master [ci skip] --- railties/CHANGELOG.md | 313 +------------------------------------------------- 1 file changed, 1 insertion(+), 312 deletions(-) (limited to 'railties') diff --git a/railties/CHANGELOG.md b/railties/CHANGELOG.md index bb3cc1760e..18f2546c73 100644 --- a/railties/CHANGELOG.md +++ b/railties/CHANGELOG.md @@ -1,312 +1 @@ -* Do not crash when `config/secrets.yml` is empty. - - *Yves Senn* - -* Set `dump_schema_after_migration` config values in production. - - Set `config.active_record.dump_schema_after_migration` as false - in the generated `config/environments/production.rb` file. - - *Emil Soman* - -* Added Thor-action for creation of migrations. - - Fixes #13588, #12674. - - *Gert Goet* - -* Ensure that `bin/rails` is a file before trying to execute it. - - Fixes #13825. - - *bronzle* - -* Use single quotes in generated files. - - *Cristian Mircea Messel*, *Chulki Lee* - -* The `Gemfile` of new applications depends on SDoc ~> 0.4.0. - - *Xavier Noria* - -* `test_help.rb` now automatically checks/maintains your test database - schema. (Use `config.active_record.maintain_test_schema = false` to - disable.) - - *Jon Leighton* - -* Configure `secrets.yml` and `database.yml` to read configuration - from the system environment by default for production. - - *José Valim* - -* `config.assets.raise_runtime_errors` is set to true by default - - This option has been introduced in - [sprockets-rails#100][https://github.com/rails/sprockets-rails/pull/100] - and defaults to true in new applications in development. - - *Richard Schneeman* - -* Generates `html` and `text` templates for mailers by default. - - *Kassio Borges* - -* Move `secret_key_base` from `config/initializers/secret_token.rb` - to `config/secrets.yml`. - - `secret_key_base` is now saved in `Rails.application.secrets.secret_key_base` - and it fallbacks to the value of `config.secret_key_base` when it is not - present in `config/secrets.yml`. - - `config/initializers/secret_token.rb` is not generated by default - in new applications. - - *Guillermo Iguaran* - -* Generate a new `secrets.yml` file in the `config` folder for new - applications. By default, this file contains the application's `secret_key_base`, - but it could also be used to store other secrets such as access keys for external - APIs. - - The secrets added to this file will be accessible via `Rails.application.secrets`. - For example, with the following `secrets.yml`: - - development: - secret_key_base: 3b7cd727ee24e8444053437c36cc66c3 - some_api_key: SOMEKEY - - `Rails.application.secrets.some_api_key` will return `SOMEKEY` in the development - environment. - - *Guillermo Iguaran* - -* Add `ENV['DATABASE_URL']` support in `rails dbconsole`. Fixes #13320. - - *Huiming Teo* - -* Add `Application#message_verifier` method to return a message verifier. - - This verifier can be used to generate and verify signed messages in the application. - - message = Rails.application.message_verifier(:sensitive_data).generate('my sensible data') - Rails.application.message_verifier(:sensitive_data).verify(message) - # => 'my sensible data' - - It is recommended not to use the same verifier for different things, so you can get different - verifiers passing the name argument. - - message = Rails.application.message_verifier(:cookies).generate('my sensible cookie data') - - See the `ActiveSupport::MessageVerifier` documentation for more information. - - *Rafael Mendonça França* - -* The [Spring application - preloader](https://github.com/rails/spring) is now installed - by default for new applications. It uses the development group of - the Gemfile, so will not be installed in production. - - *Jon Leighton* - -* Uses .railsrc while creating new plugin if it is available. - Fixes #10700. - - *Prathamesh Sonpatki* - -* Remove turbolinks when generating a new application based on a template that skips it. - - Example: - - Skips turbolinks adding `add_gem_entry_filter { |gem| gem.name != "turbolinks" }` - to the template. - - *Lauro Caetano* - -* Instrument an `load_config_initializer.railties` event on each load of configuration initializer - from `config/initializers`. Subscribers should be attached before `load_config_initializers` - initializer completed. - - Registering subscriber examples: - - # config/application.rb - module RailsApp - class Application < Rails::Application - ActiveSupport::Notifications.subscribe('load_config_initializer.railties') do |*args| - event = ActiveSupport::Notifications::Event.new(*args) - puts "Loaded initializer #{event.payload[:initializer]} (#{event.duration}ms)" - end - end - end - - # my_engine/lib/my_engine/engine.rb - module MyEngine - class Engine < ::Rails::Engine - config.before_initialize do - ActiveSupport::Notifications.subscribe('load_config_initializer.railties') do |*args| - event = ActiveSupport::Notifications::Event.new(*args) - puts "Loaded initializer #{event.payload[:initializer]} (#{event.duration}ms)" - end - end - end - end - - *Paul Nikitochkin* - -* Support for Pathnames in eager load paths. - - *Mike Pack* - -* Fixed missing line and shadow on service pages(404, 422, 500). - - *Dmitry Korotkov* - -* `BACKTRACE` environment variable to show unfiltered backtraces for - test failures. - - Example: - - $ BACKTRACE=1 ruby -Itest ... - # or with rake - $ BACKTRACE=1 bin/rake - - *Yves Senn* - -* Removal of all javascript stuff (gems and files) when generating a new - application using the `--skip-javascript` option. - - *Robin Dupret* - -* Make the application name snake cased when it contains spaces - - The application name is used to fill the `database.yml` and - `session_store.rb` files ; previously, if the provided name - contained whitespaces, it led to unexpected names in these files. - - *Robin Dupret* - -* Added `--model-name` option to `ScaffoldControllerGenerator`. - - *yalab* - -* Expose MiddlewareStack#unshift to environment configuration. - - *Ben Pickles* - -* `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` - - *Piotr Sarnacki* - -* rake notes now searches *.less files - - *Josh Crowder* - -* Generate nested route for namespaced controller generated using - `rails g controller`. - Fixes #11532. - - Example: - - rails g controller admin/dashboard index - - # Before: - get "dashboard/index" - - # After: - namespace :admin do - get "dashboard/index" - end - - *Prathamesh Sonpatki* - -* Fix the event name of action_dispatch requests. - - *Rafael Mendonça França* - -* Make `config.log_level` work with custom loggers. - - *Max Shytikov* - -* Changed stylesheet load order in the stylesheet manifest generator. - Fixes #11639. - - *Pawel Janiak* - -* Added generated unit test for generator generator using new - `test:generators` rake task. - - *Josef Šimánek* - -* Removed `update:application_controller` rake task. - - *Josef Šimánek* - -* Fix `rake environment` to do not eager load modules - - *Paul Nikitochkin* - -* Fix `rake notes` to look into `*.sass` files - - *Yuri Artemev* - -* Removed deprecated `Rails.application.railties.engines`. - - *Arun Agrawal* - -* Removed deprecated threadsafe! from Rails Config. - - *Paul Nikitochkin* - -* Remove deprecated `ActiveRecord::Generators::ActiveModel#update_attributes` in - favor of `ActiveRecord::Generators::ActiveModel#update`. - - *Vipul A M* - -* Remove deprecated `config.whiny_nils` option. - - *Vipul A M* - -* Rename `commands/plugin_new.rb` to `commands/plugin.rb` and fix references - - *Richard Schneeman* - -* Fix `rails plugin --help` command. - - *Richard Schneeman* - -* Omit turbolinks configuration completely on skip_javascript generator option. - - *Nikita Fedyashev* - -* Removed deprecated rake tasks for running tests: `rake test:uncommitted` and - `rake test:recent`. - - *John Wang* - -* Clearing autoloaded constants triggers routes reloading. - Fixes #10685. - - *Xavier Noria* - -* Fixes bug with scaffold generator with `--assets=false --resource-route=false`. - Fixes #9525. - - *Arun Agrawal* - -* Rails::Railtie no longer forces the Rails::Configurable module on everything - that subclasses it. Instead, the methods from Rails::Configurable have been - moved to class methods in Railtie and the Railtie has been made abstract. - - *John Wang* - -* Changes repetitive th tags to use colspan attribute in `index.html.erb` template. - - *Sıtkı Bağdat* - -Please check [4-0-stable](https://github.com/rails/rails/blob/4-0-stable/railties/CHANGELOG.md) for previous changes. +Please check [4-1-stable](https://github.com/rails/rails/blob/4-1-stable/railties/CHANGELOG.md) for previous changes. -- cgit v1.2.3 From 53f1ab523bbf4f1764e3e24f26c4ed1db61b69e7 Mon Sep 17 00:00:00 2001 From: "T.J. Schuck" Date: Fri, 21 Feb 2014 15:58:09 -0500 Subject: Bump version of bcrypt gem --- railties/lib/rails/generators/rails/app/templates/Gemfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'railties') diff --git a/railties/lib/rails/generators/rails/app/templates/Gemfile b/railties/lib/rails/generators/rails/app/templates/Gemfile index 6d017e187d..a9b6787894 100644 --- a/railties/lib/rails/generators/rails/app/templates/Gemfile +++ b/railties/lib/rails/generators/rails/app/templates/Gemfile @@ -14,7 +14,7 @@ source 'https://rubygems.org' <% end -%> # Use ActiveModel has_secure_password -# gem 'bcrypt-ruby', '~> 3.1.2' +# gem 'bcrypt', '~> 3.1.7' # Use unicorn as the app server # gem 'unicorn' -- cgit v1.2.3 From ad75539a0cf55a67c0a1db1bfc76d10083c6f4ab Mon Sep 17 00:00:00 2001 From: Spencer Rogers Date: Tue, 25 Feb 2014 16:45:43 -0500 Subject: [skip ci] Fix test name typo in app generator tests. --- railties/test/generators/app_generator_test.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'railties') diff --git a/railties/test/generators/app_generator_test.rb b/railties/test/generators/app_generator_test.rb index 5811379e35..3bf08b105a 100644 --- a/railties/test/generators/app_generator_test.rb +++ b/railties/test/generators/app_generator_test.rb @@ -265,7 +265,7 @@ class AppGeneratorTest < Rails::Generators::TestCase end end - def test_inclusion_of_plateform_dependent_gems + def test_inclusion_of_platform_dependent_gems run_generator([destination_root]) if RUBY_ENGINE == 'rbx' assert_gem 'rubysl' -- cgit v1.2.3 From 1d298bd6217d6c0feb3aa698d65289b92b11ab8d Mon Sep 17 00:00:00 2001 From: Carlos Antonio da Silva Date: Tue, 25 Feb 2014 21:46:55 -0300 Subject: Remove inclusion of rubysl gem for rbx on generated Gemfile From #14026: Specific rbx-2 to limit testing on Rubinius 2.x (since there will be other versions of Rubinius > 2.x soon). Also, as of Rubinius 2.2.5, it is no longer necessary to bundle the rubysl gem. This is what Rails master/4.1 supports, so we don't need to add rubysl to gemfiles anymore. --- railties/lib/rails/generators/app_base.rb | 9 --------- railties/test/generators/app_generator_test.rb | 7 ------- 2 files changed, 16 deletions(-) (limited to 'railties') diff --git a/railties/lib/rails/generators/app_base.rb b/railties/lib/rails/generators/app_base.rb index f1f79d8378..b2ecc22294 100644 --- a/railties/lib/rails/generators/app_base.rb +++ b/railties/lib/rails/generators/app_base.rb @@ -111,7 +111,6 @@ module Rails javascript_gemfile_entry, jbuilder_gemfile_entry, sdoc_gemfile_entry, - platform_dependent_gemfile_entry, spring_gemfile_entry, @extra_entries].flatten.find_all(&@gem_filter) end @@ -258,14 +257,6 @@ module Rails 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) diff --git a/railties/test/generators/app_generator_test.rb b/railties/test/generators/app_generator_test.rb index 3bf08b105a..5ebdadacbf 100644 --- a/railties/test/generators/app_generator_test.rb +++ b/railties/test/generators/app_generator_test.rb @@ -265,13 +265,6 @@ class AppGeneratorTest < Rails::Generators::TestCase end end - def test_inclusion_of_platform_dependent_gems - run_generator([destination_root]) - if RUBY_ENGINE == 'rbx' - assert_gem 'rubysl' - end - end - def test_jquery_is_the_default_javascript_library run_generator assert_file "app/assets/javascripts/application.js" do |contents| -- cgit v1.2.3