aboutsummaryrefslogtreecommitdiffstats
path: root/railties/lib/rails/engine.rb
Commit message (Collapse)AuthorAgeFilesLines
...
* Remove config.assetsJoshua Peek2015-01-211-6/+0
| | | | Provided by sprockets-rails plugin
* - Changed `paths` to `routing_paths` to avoid warning `possible reference to ↵Vipul A M2014-12-261-3/+3
| | | | past scope`
* FIX: absolute_path may be nil for code added via instance_evalSam2014-12-011-1/+1
|
* Use absolute_path of caller_locations to infer engine rootAlexander Mankuta2014-11-261-1/+1
| | | | | According to documentation `path` only returns file names. On MRI it's not the case but it's likely a bug in MRI.
* Minor English fixes in docs [ci skip]George Millo2014-11-171-2/+2
|
* add lib to $LOAD_PATH on application inhertence. fixes #17106Aaron Patterson2014-11-041-3/+6
|
* save a hash allocation per request.Aaron Patterson2014-08-081-1/+1
|
* Deprecate `*_path` methods in mailers@schneems and @sgrif2014-07-301-1/+1
| | | | | | | | | | | Email does not support relative links since there is no implicit host. Therefore all links inside of emails must be fully qualified URLs. All path helpers are now deprecated. When removed, the error will give early indication to developers to use `*_url` methods instead. Currently if a developer uses a `*_path` helper, their tests and `mail_view` will not catch the mistake. The only way to see the error is by sending emails in production. Preventing sending out emails with non-working path's is the desired end goal of this PR. Currently path helpers are mixed-in to controllers (the ActionMailer::Base acts as a controller). All `*_url` and `*_path` helpers are made available through the same module. This PR separates this behavior into two modules so we can extend the `*_path` methods to add a Deprecation to them. Once deprecated we can use this same area to raise a NoMethodError and add an informative message directing the developer to use `*_url` instead. The module with warnings is only mixed in when a controller returns false from the newly added `supports_relative_path?`. Paired @sgrif & @schneems
* Ensure we supply Kernel#y for 1.9 tooMatthew Draper2014-04-041-2/+0
| | | | | | | | In 1.9, it doesn't live in its own file, so we'll have to define it ourselves. Check RUBY_VERSION, instead of rescuing the require, because we want this to break if `psych/y` moves in a future Ruby release.
* Explicitly load Kernel#y when starting a consoleMatthew Draper2014-04-041-0/+1
| | | | | | | | Previously, we relied on the IRB-detection in Psych itself. But that doesn't work when we're running under spring: the application boots (and thus psych is required) before we switch to console mode and load IRB. Fixes #14587.
* pass strings to the underscore methodAaron Patterson2014-02-261-1/+1
|
* rbconfig is not used in these filesArun Agrawal2013-12-261-1/+0
| | | | remove unused requires
* Merge remote-tracking branch 'docrails/master'Xavier Noria2013-11-241-2/+2
|\ | | | | | | | | | | Conflicts: activesupport/lib/active_support/core_ext/hash/deep_merge.rb activesupport/lib/active_support/core_ext/hash/keys.rb
| * Change syntax format for example returned valuesPrem Sichanugrist2013-11-111-2/+2
| | | | | | | | | | | | | | | | | | According to our guideline, we leave 1 space between `#` and `=>`, so we want `# =>` instead of `#=>`. Thanks to @fxn for the suggestion. [ci skip]
* | Instrument each load config initializerPaul Nikitochkin2013-11-161-1/+7
| | | | | | | | | | | | In order to simplify profiling loading of initializers, added instument for tracking load config initializer event from `config/initializers`
* | Allow Pathnames to be added to eager load pathsMike Pack2013-11-111-1/+1
|/
* Use Ruby 2.0 caller_locations instead of caller if availableAkira Matsuda2013-09-101-2/+7
| | | | | | | | | * we no more have to manipulate the each caller strings by ourselves using caller_locations * caller_locations runs slightly faster, and creates less objects than good old caller Benchmark (loading an Engine 1000 times): caller: 262.89 ms caller_locations: 186.068 ms
* Fix typo in file path, should include extension.Semyon Perepelitsa2013-08-231-1/+1
|
* Revert "Merge branch 'master' of github.com:rails/docrails"Vijay Dev2013-08-171-7/+2
| | | | | | | This reverts commit 70d6e16fbad75b89dd1798ed697e7732b8606fa3, reversing changes made to ea4db3bc078fb3093ecdddffdf4f2f4ff3e1e8f9. Seems to be a code merge done by mistake.
* Revert "Removing obsolete html tags in favor of markdown code block"Avner Cohen2013-08-061-44/+44
| | | | This reverts commit 157dc275da0ad38635337b7c1d96de656d91de8e.
* Removing obsolete html tags in favor of markdown code block.Avner Cohen2013-08-061-44/+44
|
* Use Ruby 2.0 caller_locations instead of caller if availableAkira Matsuda2013-07-251-2/+7
| | | | | | | | | * we no more have to manipulate the each caller strings by ourselves using caller_locations * caller_locations runs slightly faster, and creates less objects than good old caller Benchmark (loading an Engine 1000 times): caller: 262.89 ms caller_locations: 186.068 ms
* rails -> Rails [ci skip]Prathamesh Sonpatki2013-05-091-1/+1
|
* Removing the app constant and replacing it with Rails.applicationwangjohn2013-04-301-4/+4
| | | | | syntax. This helps removing the class level abstraction of an application.
* Removing Railtie::Configurable from the base Railtie object and makingwangjohn2013-04-291-4/+4
| | | | | Railtie itself abstract. This stops the weird behavior of forcing subclasses of Railtie to include the Configurable module.
* remove unused variablesVipul A M2013-04-061-1/+1
|
* Fix missing closing <tt> tagPatrick Helm2013-03-121-1/+1
|
* There's no need to access Railties through self.classSantiago Pastorino2013-02-271-1/+2
| | | | Closes #9386
* Revert "Deprecate the `eager_load_paths` configuration"Andrew White2013-02-191-5/+7
| | | | | | | | | | | Because of the possibility of lib being unintentionally eager loaded it's been agreed that we'll leave autoload paths and eager load paths separate for Rails 4.0. This reverts commit 0757b3388ffe4f44b60de950d40e18ef05055931. Conflicts: railties/CHANGELOG.md
* Deprecate the `eager_load_paths` configurationAndrew White2013-01-241-7/+5
| | | | | | | | | | Since the default in Rails 4.0 is to run in 'threadsafe' mode we need to eager load all of the paths in `autoload_paths` so we alias `eager_load_paths` to it. This may have unintended consequences if you have added 'lib' to `autoload_paths` such as loading unneeded code or code intended only for development and/or test environments. If this applies to your application you should thoroughly check what is being eager loaded.
* Merge pull request #8557 from timraymond/add_back_engines_and_deprecateRafael Mendonça França2013-01-221-0/+4
|\ | | | | | | | | | | | | Adding Back Rails::Engine::Railties#engines Conflicts: railties/CHANGELOG.md
| * Adding Back Rails::Engine::Railties#enginesTim Raymond2013-01-031-0/+4
| | | | | | | | | | Removing it breaks functionality with gems such as Thinking Sphinx. This restores it with a deprecation warning. Closes #8551
* | Merge branch 'master' of github.com:lifo/docrailsVijay Dev2013-01-091-1/+1
|\ \ | | | | | | | | | | | | Conflicts: guides/source/getting_started.md
| * | make symbol reference in docs appear as codeGosha Arinich2013-01-031-1/+1
| |/
* | Revert some warning removals related to Ruby 2.0Carlos Antonio da Silva2013-01-071-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | These warnings were actually a bug in Ruby 2.0, the accessors should not be raising such warnings, they are only meant for ivars. - Revert "fix warnings in Ruby 2.0" This reverts commit 26702a6d3461f4a1c75165030b96886514ecb877. - Revert "Merge pull request #8282 from arunagw/warning_removed_for_ruby2" This reverts commit f63d6544e45e78cda29c0c56fbdf3d9e1f405340, reversing changes made to 3a890681fad8218305585036abed6d7463a44e41.
* | delegate to :class rather than 'self.class'Gosha Arinich2013-01-061-1/+1
|/
* Remove observers and sweepersRafael Mendonça França2012-11-281-1/+1
| | | | | | | | They was extracted from a plugin. See https://github.com/rails/rails-observers [Rafael Mendonça França + Steve Klabnik]
* Initialize accessors to remove some warnings in Ruby 2.0Arun Agrawal2012-11-211-0/+2
|
* Use Ruby 1.9 Hash syntax in railtiesRobin Dupret2012-10-141-8/+8
|
* Updated description of what engines are used forStephan Hagemann2012-09-211-2/+2
|
* Get rid of config.preload_frameworks in favor of config.eager_load_namespacesJosé Valim2012-08-211-0/+5
| | | | | | | The new option allows any Ruby namespace to be registered and set up for eager load. We are effectively exposing the structure existing in Rails since v3.0 for all developers in order to make their applications thread-safe and CoW friendly.
* Fix handling SCRIPT_NAME from within mounted engine'sPiotr Sarnacki2012-08-111-1/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When you mount your application at a path, for example /myapp, server should set SCRIPT_NAME to /myapp. With such information, rails application knows that it's mounted at /myapp path and it should generate routes relative to that path. Before this patch, rails handled SCRIPT_NAME correctly only for regular apps, but it failed to do it for mounted engines. The solution was to hardcode default_url_options[:script_name], which is not the best answer - it will work only when application is mounted at a fixed path. This patch fixes the situation by respecting original value of SCRIPT_NAME when generating application's routes from engine and the other way round - when you generate engine's routes from application. This is done by using one of 2 pieces of information in env - current SCRIPT_NAME or SCRIPT_NAME for a corresponding router. This is because we have 2 cases to handle: - generating engine's route from application: in this situation SCRIPT_NAME is basically SCRIPT_NAME set by the server and it indicates the place where application is mounted, so we can just pass it as :original_script_name in url_options. :original_script_name is used because if we use :script_name, router will ignore generating prefix for engine - generating application's route from engine: in this situation we already lost information about the SCRIPT_NAME that server used. For example if application is mounted at /myapp and engine is mounted at /blog, at this point SCRIPT_NAME is equal /myapp/blog. Because of that we need to keep reference to /myapp SCRIPT_NAME by binding it to the current router. Later on we can extract it and use when generating url Please note that starting from now you *should not* use default_url_options[:script_name] explicitly if your server already passes correct SCRIPT_NAME to rack env. (closes #6933)
* There is only task for installing migrations when using enginesWojciech Wnętrzak2012-07-041-2/+1
|
* Revert "Allow loading external route files from the router"José Valim2012-06-291-6/+1
| | | | | | | | | | | | | | This reverts commit 6acebb38bc0637bc05c19d87f8767f16ce79189b. Usage of this feature did not reveal any improvement in existing apps. Conflicts: actionpack/lib/action_dispatch/routing/mapper.rb guides/source/routing.textile railties/lib/rails/engine.rb railties/lib/rails/paths.rb railties/test/paths_test.rb
* Remove unused responsibilities and add a few load definitions to enginesJosé Valim2012-06-291-64/+59
| | | | | | | | Since plugins were removed, we can clean up a few methods in engines. We also use this opportunity to move `load_console`, `load_tasks` and `load_runner` to Rails::Engine. This means that, if someone wants to improve script/rails for engines to support console or runner commands, part of the work is already done.
* Remove unnecessary Railties structure now that plugins are goneJosé Valim2012-06-291-12/+12
|
* Add support runner hook.kennyj2012-05-291-0/+5
|
* Fixed backward incompatibility for engines.Philip Arndt2012-05-241-1/+1
| | | | | | | | | | | | - Many engines rely on being able to join directories to the Rails root: Rails.root.join('somedir') - This was now impossible because Rails.root returned a String: NoMethodError: undefined method `join' for "/code/myrailsapp":String - This was broken in 4001835db00ce44cb75bca33ec02cd76b8ccc790
* removing more pathnameismsAaron Patterson2012-05-231-3/+3
|
* I guess we have to return a pathname object. o_OAaron Patterson2012-05-221-1/+1
|