Class: Rails::Application::RoutesReloader
- Inherits:
-
Object
- Object
- Rails::Application::RoutesReloader
- Defined in:
- lib/rails/application/routes_reloader.rb
Instance Attribute Summary collapse
-
#eager_load ⇒ Object
Returns the value of attribute eager_load.
-
#paths ⇒ Object
readonly
Returns the value of attribute paths.
-
#route_sets ⇒ Object
readonly
Returns the value of attribute route_sets.
Instance Method Summary collapse
- #execute ⇒ Object
- #execute_if_updated ⇒ Object
-
#initialize ⇒ RoutesReloader
constructor
A new instance of RoutesReloader.
- #reload! ⇒ Object
Constructor Details
#initialize ⇒ RoutesReloader
Returns a new instance of RoutesReloader.
10 11 12 13 14 |
# File 'lib/rails/application/routes_reloader.rb', line 10 def initialize @paths = [] @route_sets = [] @eager_load = false end |
Instance Attribute Details
#eager_load ⇒ Object
Returns the value of attribute eager_load.
7 8 9 |
# File 'lib/rails/application/routes_reloader.rb', line 7 def eager_load @eager_load end |
#paths ⇒ Object (readonly)
Returns the value of attribute paths.
6 7 8 |
# File 'lib/rails/application/routes_reloader.rb', line 6 def paths @paths end |
#route_sets ⇒ Object (readonly)
Returns the value of attribute route_sets.
6 7 8 |
# File 'lib/rails/application/routes_reloader.rb', line 6 def route_sets @route_sets end |
Instance Method Details
#execute ⇒ Object
24 25 26 27 28 |
# File 'lib/rails/application/routes_reloader.rb', line 24 def execute ret = updater.execute route_sets.each(&:eager_load!) if eager_load ret end |
#execute_if_updated ⇒ Object
30 31 32 33 34 35 |
# File 'lib/rails/application/routes_reloader.rb', line 30 def execute_if_updated if updated = updater.execute_if_updated route_sets.each(&:eager_load!) if eager_load end updated end |
#reload! ⇒ Object
16 17 18 19 20 21 22 |
# File 'lib/rails/application/routes_reloader.rb', line 16 def reload! clear! load_paths finalize! ensure revert end |