diff options
-rw-r--r-- | Gemfile | 35 | ||||
-rw-r--r-- | actionpack/lib/action_dispatch/journey/route.rb | 2 | ||||
-rw-r--r-- | actionpack/lib/action_dispatch/routing/inspector.rb | 4 | ||||
-rw-r--r-- | actionpack/test/dispatch/mapper_test.rb | 4 | ||||
-rw-r--r-- | actionpack/test/dispatch/routing/inspector_test.rb | 11 | ||||
-rw-r--r-- | guides/source/active_support_core_extensions.md | 2 | ||||
-rw-r--r-- | railties/lib/rails/generators/rails/plugin/plugin_generator.rb | 2 | ||||
-rw-r--r-- | railties/test/generators/plugin_generator_test.rb | 1 |
8 files changed, 34 insertions, 27 deletions
@@ -5,13 +5,12 @@ gemspec # We need a newish Rake since Active Job sets its test tasks' descriptions. gem 'rake', '>= 10.3' -# Active Job depends on the URI::GID::MissingModelIDError, which isn't released yet. +# Active Job depends on URI::GID::MissingModelIDError, which isn't released yet. gem 'globalid', github: 'rails/globalid', branch: 'master' gem 'rack', github: 'rack/rack', branch: 'master' -# This needs to be with require false as it is -# loaded after loading the test library to -# ensure correct loading order +# This needs to be with require false to ensure correct loading order, as has to +# be loaded after loading the test library. gem 'mocha', '~> 0.14', require: false gem 'rack-cache', '~> 1.2' @@ -26,15 +25,15 @@ gem 'sprockets-rails', '~> 3.0.0.beta3', github: 'rails/sprockets-rails', branch gem 'sass-rails', github: 'rails/sass-rails', branch: 'master' # require: false so bcrypt is loaded only when has_secure_password is used. -# This is to avoid ActiveModel (and by extension the entire framework) +# This is to avoid Active Model (and by extension the entire framework) # being dependent on a binary library. gem 'bcrypt', '~> 3.1.10', require: false -# This needs to be with require false to avoid -# it being automatically loaded by sprockets +# This needs to be with require false to avoid it being automatically loaded by +# sprockets. gem 'uglifier', '>= 1.3.0', require: false -# Track stable branch of sass because it doesn't have circular require warnings +# Track stable branch of sass because it doesn't have circular require warnings. gem 'sass', github: 'sass/sass', branch: 'stable', require: false group :doc do @@ -44,10 +43,10 @@ group :doc do gem 'kindlerb', '0.1.1' end -# ActiveSupport +# Active Support. gem 'dalli', '>= 2.2.1' -# ActiveJob +# Active Job. group :job do gem 'resque', require: false gem 'resque-scheduler', require: false @@ -64,12 +63,12 @@ group :job do gem 'sequel', require: false end -# Add your own local bundler stuff +# Add your own local bundler stuff. local_gemfile = File.dirname(__FILE__) + "/.Gemfile" instance_eval File.read local_gemfile if File.exist? local_gemfile group :test do - # FIX: Our test suite isn't ready to run in random order yet + # FIX: Our test suite isn't ready to run in random order yet. gem 'minitest', '< 5.3.4' platforms :mri do @@ -83,10 +82,10 @@ end platforms :ruby do gem 'nokogiri', '>= 1.6.7.rc3' - # Needed for compiling the ActionDispatch::Journey parser + # Needed for compiling the ActionDispatch::Journey parser. gem 'racc', '>=1.4.6', require: false - # ActiveRecord + # Active Record. gem 'sqlite3', '~> 1.3.6' group :db do @@ -114,12 +113,12 @@ platforms :jruby do end platforms :rbx do - # The rubysl-yaml gem doesn't ship with Psych by default - # as it needs libyaml that isn't always available. + # The rubysl-yaml gem doesn't ship with Psych by default as it needs + # libyaml that isn't always available. gem 'psych', '~> 2.0' end -# gems that are necessary for ActiveRecord tests with Oracle database +# Gems that are necessary for Active Record tests with Oracle. if ENV['ORACLE_ENHANCED'] platforms :ruby do gem 'ruby-oci8', '~> 2.2' @@ -127,6 +126,6 @@ if ENV['ORACLE_ENHANCED'] gem 'activerecord-oracle_enhanced-adapter', github: 'rsim/oracle-enhanced', branch: 'master' end -# A gem necessary for ActiveRecord tests with IBM DB +# A gem necessary for Active Record tests with IBM DB. gem 'ibm_db' if ENV['IBM_DB'] gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby] diff --git a/actionpack/lib/action_dispatch/journey/route.rb b/actionpack/lib/action_dispatch/journey/route.rb index f5c9abf1cc..35c2b1b86e 100644 --- a/actionpack/lib/action_dispatch/journey/route.rb +++ b/actionpack/lib/action_dispatch/journey/route.rb @@ -163,7 +163,7 @@ module ActionDispatch end def verb - %r[^#{verbs.join('|')}$] + verbs.join('|') end private diff --git a/actionpack/lib/action_dispatch/routing/inspector.rb b/actionpack/lib/action_dispatch/routing/inspector.rb index 48c10a7d4c..f3a5268d2e 100644 --- a/actionpack/lib/action_dispatch/routing/inspector.rb +++ b/actionpack/lib/action_dispatch/routing/inspector.rb @@ -16,10 +16,6 @@ module ActionDispatch app.app end - def verb - super.source.gsub(/[$^]/, '') - end - def path super.spec.to_s end diff --git a/actionpack/test/dispatch/mapper_test.rb b/actionpack/test/dispatch/mapper_test.rb index f35ffd8845..e783df855e 100644 --- a/actionpack/test/dispatch/mapper_test.rb +++ b/actionpack/test/dispatch/mapper_test.rb @@ -82,7 +82,7 @@ module ActionDispatch end assert_equal({:omg=>:awesome, :controller=>"posts", :action=>"index"}, fakeset.defaults.first) - assert_equal(/^GET$/, fakeset.routes.first.verb) + assert_equal("GET", fakeset.routes.first.verb) end def test_mapping_requirements @@ -99,7 +99,7 @@ module ActionDispatch mapper.scope(via: :put) do mapper.match '/', :to => 'posts#index', :as => :main end - assert_equal(/^PUT$/, fakeset.routes.first.verb) + assert_equal("PUT", fakeset.routes.first.verb) end def test_map_slash diff --git a/actionpack/test/dispatch/routing/inspector_test.rb b/actionpack/test/dispatch/routing/inspector_test.rb index 24bd4b04ec..a17d07c40b 100644 --- a/actionpack/test/dispatch/routing/inspector_test.rb +++ b/actionpack/test/dispatch/routing/inspector_test.rb @@ -77,6 +77,17 @@ module ActionDispatch ], output end + def test_articles_inspect_with_multiple_verbs + output = draw do + match 'articles/:id', to: 'articles#update', via: [:put, :patch] + end + + assert_equal [ + "Prefix Verb URI Pattern Controller#Action", + " PUT|PATCH /articles/:id(.:format) articles#update" + ], output + end + def test_inspect_shows_custom_assets output = draw do get '/custom/assets', :to => 'custom_assets#show' diff --git a/guides/source/active_support_core_extensions.md b/guides/source/active_support_core_extensions.md index 367a1bf7c0..5a68f6c869 100644 --- a/guides/source/active_support_core_extensions.md +++ b/guides/source/active_support_core_extensions.md @@ -172,7 +172,7 @@ NOTE: Defined in `active_support/core_ext/object/duplicable.rb`. ### `deep_dup` -The `deep_dup` method returns deep copy of a given object. Normally, when you `dup` an object that contains other objects, Ruby does not `dup` them, so it creates a shallow copy of the object. If you have an array with a string, for example, it will look like this: +The `deep_dup` method returns a deep copy of a given object. Normally, when you `dup` an object that contains other objects, Ruby does not `dup` them, so it creates a shallow copy of the object. If you have an array with a string, for example, it will look like this: ```ruby array = ['string'] diff --git a/railties/lib/rails/generators/rails/plugin/plugin_generator.rb b/railties/lib/rails/generators/rails/plugin/plugin_generator.rb index 910c4e743e..81bc902bde 100644 --- a/railties/lib/rails/generators/rails/plugin/plugin_generator.rb +++ b/railties/lib/rails/generators/rails/plugin/plugin_generator.rb @@ -226,7 +226,7 @@ task default: :test end def create_assets_manifest_file - build(:assets_manifest) unless api? + build(:assets_manifest) if !api? && engine? end def create_public_stylesheets_files diff --git a/railties/test/generators/plugin_generator_test.rb b/railties/test/generators/plugin_generator_test.rb index 0625e5fbd7..e57c61d47c 100644 --- a/railties/test/generators/plugin_generator_test.rb +++ b/railties/test/generators/plugin_generator_test.rb @@ -60,6 +60,7 @@ class PluginGeneratorTest < Rails::Generators::TestCase run_generator assert_file "README.rdoc", /Bukkits/ assert_no_file "config/routes.rb" + assert_no_file "app/assets/config/bukkits_manifest.js" assert_file "test/test_helper.rb" do |content| assert_match(/require.+test\/dummy\/config\/environment/, content) assert_match(/ActiveRecord::Migrator\.migrations_paths.+test\/dummy\/db\/migrate/, content) |