aboutsummaryrefslogtreecommitdiffstats
path: root/railties/lib/rails/engine.rb
Commit message (Collapse)AuthorAgeFilesLines
* Enable `Layout/EmptyLinesAroundAccessModifier` copRyuta Kamizono2019-06-131-2/+0
| | | | | | | | | | | We sometimes say "✂️ newline after `private`" in a code review (e.g. https://github.com/rails/rails/pull/18546#discussion_r23188776, https://github.com/rails/rails/pull/34832#discussion_r244847195). Now `Layout/EmptyLinesAroundAccessModifier` cop have new enforced style `EnforcedStyle: only_before` (https://github.com/rubocop-hq/rubocop/pull/7059). That cop and enforced style will reduce the our code review cost.
* new config to opt-out from adding app directories to $LOAD_PATHXavier Noria2019-04-281-5/+8
|
* [#35782] Allow loading seeds without ActiveJob (~> 5.2.3)Jeremy Weathers2019-04-191-1/+1
|
* Only override async adapter when seedingBatedUrGonnaDie2019-04-091-1/+7
|
* url -> URL where apt except inside actionpack/Sharang Dashputre2019-04-011-4/+4
|
* optimizes eager loading in :zeitwerk modeXavier Noria2019-03-301-22/+9
| | | | | | | | | | | During initialization, the eager load paths of engines are unshifted into AS::Dependencies.autoload_paths. After that, the collection is frozen. (See the initializers in railties/lib/rails/engine.rb.) Hence, there is no eager load path that is not an autoload path too, and so the array difference in the deleted code is always an empty array. Just do nothing.
* fixes eager loading edge case in :zeitwerk modeXavier Noria2019-03-301-2/+5
|
* Merge pull request #35121 from utilum/warning_tried_to_create_proc_without_blockKasper Timm Hansen2019-03-101-2/+2
|\ | | | | Ruby 2.7 warning: creating a Proc without a block
| * Ruby 2.7 warning: creating a Proc without a blockutilum2019-02-131-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As of [Revision 66772]( https://bugs.ruby-lang.org/projects/ruby-trunk/repository/trunk/revisions/66772) `Proc.new` without giving a block emits `warning: tried to create Proc object without a block`. This commit fixes cases where Rails test suit tickles this warning. See CI logs: https://travis-ci.org/rails/rails/jobs/487205819#L1161-L1190 https://travis-ci.org/rails/rails/jobs/487205821#L1154-1159 https://travis-ci.org/rails/rails/jobs/487205821#L1160-L1169 https://travis-ci.org/rails/rails/jobs/487205821#L1189 https://travis-ci.org/rails/rails/jobs/487254404#L1307-L1416 https://travis-ci.org/rails/rails/jobs/487254405#L1174-L1191
* | Replace autoloader accessors with Rails.autoloaders.{main,once}Xavier Noria2019-02-141-1/+1
|/ | | | | | | | | | | | | | | | Rails.autoloader and Rails.once_autoloader was just tentative API good enough for a first patch. Rails.autoloader is singular and does not convey in its name that there is another autoloader. That might be confusing, for example if you set a logger and miss traces. On the other hand, the name `once_autoloader` is very close to being horrible. Rails.autoloaders.main and Rails.autoloaders.once read better for my taste, and have a nice symmetry. Also, both "main" and "once" are four letters long, short and same length. They are tagged as "rails.main" and "rails.once", respectively. References #35235.
* Zeitwerk integrationXavier Noria2019-02-121-6/+20
|
* Convert path to string before call `length`yuuji.yaginuma2019-01-281-1/+1
| | | | | | | | Because eager load paths support to using `Pathname`, and `Pathname` doesn't have `length` method. Ref: https://travis-ci.org/rails/rails/jobs/485088071#L5140-L5143 Follow up aadeed1518b9092ea21adf49c728172368129f0e.
* Simplify path prefix extractionXavier Noria2019-01-271-2/+3
|
* Seed database with inline ActiveJob job adapterGannon McGibbon2019-01-171-1/+13
|
* Revert "Merge pull request #33970 from rails/eager-url-helpers"schneems2018-10-031-13/+3
| | | | | | | Until #34050 can be resolved This reverts commit 7f870a5ba2aa9177aa4a0e03a9d027928ba60e49, reversing changes made to 6556898884d636c59baae008e42783b8d3e16440.
* Routes from Engine Railties should not be an infinite loopAaron Patterson2018-09-261-0/+6
|
* Eager load supports individual filesAaron Patterson2018-09-261-3/+7
| | | | Also we want to eager load routes before anything else.
* [Railties] require_relative => requireAkira Matsuda2017-10-211-5/+5
| | | | This basically reverts 618268b4b9382f4bcf004a945fe2d85c0bd03e32
* Adding frozen_string_literal pragma to Railties.Pat Allan2017-08-141-0/+2
|
* [Railties] require => require_relativeAkira Matsuda2017-07-011-5/+5
|
* Define path with __dir__bogdanvlviv2017-05-231-1/+1
| | | | | | ".. with __dir__ we can restore order in the Universe." - by @fxn Related to 5b8738c2df003a96f0e490c43559747618d10f5f
* Add `Style/EmptyLinesAroundMethodBody` in `.rubocop.yml` and remove extra ↵Ryuta Kamizono2017-02-121-1/+0
| | | | empty lines
* Merge branch 'master' of github.com:rails/docrailsVijay Dev2017-01-111-4/+4
|\ | | | | | | | | Conflicts: railties/lib/rails/generators.rb
| * Capitalize Ruby and small grammar fixJon Moss2016-12-191-1/+1
| | | | | | | | [ci skip]
| * Capitalize Rack gem nameJon Moss2016-12-191-3/+3
| | | | | | | | [ci skip]
* | `self.` is not needed when calling its own instance methodAkira Matsuda2017-01-051-2/+2
| | | | | | | | Actually, private methods cannot be called with `self.`, so it's not just redundant, it's a bad habit in Ruby
* | Privatize unneededly protected methods in RailtiesAkira Matsuda2016-12-251-13/+13
|/
* Add more rubocop rules about whitespacesRafael Mendonça França2016-10-291-5/+5
|
* [ci skip] Fixed commas according to Oxford comma in rdoc and guidesAndrey Molchanov2016-09-171-1/+1
|
* Add three new rubocop rulesRafael Mendonça França2016-08-161-3/+3
| | | | | | | | Style/SpaceBeforeBlockBraces Style/SpaceInsideBlockBraces Style/SpaceInsideHashLiteralBraces Fix all violations in the repository.
* code gardening: removes redundant selfsXavier Noria2016-08-081-1/+1
| | | | | | | | | A few have been left for aesthetic reasons, but have made a pass and removed most of them. Note that if the method `foo` returns an array, `foo << 1` is a regular push, nothing to do with assignments, so no self required.
* normalizes indentation and whitespace across the projectXavier Noria2016-08-061-42/+42
|
* applies new string literal convention in railties/libXavier Noria2016-08-061-6/+6
| | | | | The current code base is not uniform. After some discussion, we have chosen to go with double quotes by default.
* Fix some typos in comments.Joe Rafaniello2016-05-041-1/+1
| | | | [ci skip]
* Merge pull request #20986 from radar/rails-engine-caller-locationsArthur Nogueira Neves2015-10-041-6/+1
|\ | | | | Remove check for caller_locations in Rails::Engine
| * Remove check for caller_locations in Rails::EngineRyan Bigg2015-07-231-6/+1
| | | | | | | | This is no longer necessary, as the minimum version requirement for Ruby is 2.2.2, and the `caller_locations` feature was added in Ruby 2.0.0. Since Rails no longer supports pre 2.0 versions of Ruby, there is no need to check first if the Kernel does respond to `caller_locations`. The answer is: yes it does.
* | only construct one request in an engineAaron Patterson2015-09-301-5/+10
| |
* | call `default_middleware_stack` before merging stacksAaron Patterson2015-09-291-1/+2
| | | | | | | | | | | | | | `default_middleware_stack` seems to kick off the `on_load` calls that may mutate the middleware stack. We have to call that method before merging middleware stacks, otherwise the middleware stacks get mutated *after* the app middleware stack is built.
* | Engines get different middleware than appsAaron Patterson2015-09-291-1/+7
| | | | | | | | | | We shouldn't merge the app middleware in to the config middleware for engines.
* | Make app building threadsafeeileencodes2015-09-291-4/+8
| |
* | Stop modifying global variableseileencodes2015-09-291-1/+1
| | | | | | | | | | | | Allocating a new middleware proxy in each application configuration and then merging the app specific config with the global config when the app is built.
* | Merge pull request #21124 from kirs/feature/reload-i18nKasper Timm Hansen2015-08-101-1/+1
|\ \ | | | | | | Reload I18n.load_path in development
| * | Reload I18n locales in developmentKir Shatrov2015-08-101-1/+1
| |/
* | routes in the env via the request objectAaron Patterson2015-08-051-3/+2
| |
* | allocate a request object to avoid hash allocationsAaron Patterson2015-08-051-3/+2
|/ | | | | This decouples the `call` method from knowing the SCRIPT_NAME key and offloads decisions about how to access script_name
* [ci skip] Remove comments about Rails 3.1claudiob2015-05-111-9/+7
| | | | | | | | | Stems from https://github.com/rails/rails/pull/20105#issuecomment-100900939 where @senny said: > From my point of view, all the docs (guides, API) are version bound. > They should describe that version and continue to be available when newer versions are released. > The cross referencing can be done by the interested user.
* Merge pull request #19756 from georgemillo/docsRobin Dupret2015-05-051-17/+26
|\ | | | | fixing English in Rails::Engine docs
| * fixing English in Rails::Engine docsGeorge Millo2015-04-231-17/+26
| | | | | | | | [ci skip]
* | Added missing fullstop in engine API docs [ci skip]Prathamesh Sonpatki2015-05-021-2/+2
|/
* pass a config to the route setAaron Patterson2015-03-051-1/+1
| | | | | This way we can get the relative_url_root from the application without setting another global value