123456789_123456789_123456789_123456789_123456789_

Class: Rails::Application::RoutesReloader

Relationships & Source Files
Inherits: Object
Defined in: railties/lib/rails/application/routes_reloader.rb

Class Method Summary

Instance Attribute Summary

Instance Method Summary

Constructor Details

.newRoutesReloader

[ GitHub ]

  
# File 'railties/lib/rails/application/routes_reloader.rb', line 12

def initialize
  @paths      = []
  @route_sets = []
  @external_routes = []
  @eager_load = false
end

Instance Attribute Details

#eager_load (rw)

[ GitHub ]

  
# File 'railties/lib/rails/application/routes_reloader.rb', line 9

attr_accessor :eager_load

#execute (readonly)

[ GitHub ]

  
# File 'railties/lib/rails/application/routes_reloader.rb', line 10

delegate :execute_if_updated, :execute, :updated?, to: :updater

#execute_if_updated (readonly)

[ GitHub ]

  
# File 'railties/lib/rails/application/routes_reloader.rb', line 10

delegate :execute_if_updated, :execute, :updated?, to: :updater

#external_routes (readonly)

[ GitHub ]

  
# File 'railties/lib/rails/application/routes_reloader.rb', line 8

attr_reader :route_sets, :paths, :external_routes

#paths (readonly)

[ GitHub ]

  
# File 'railties/lib/rails/application/routes_reloader.rb', line 8

attr_reader :route_sets, :paths, :external_routes

#route_sets (readonly)

[ GitHub ]

  
# File 'railties/lib/rails/application/routes_reloader.rb', line 8

attr_reader :route_sets, :paths, :external_routes

Instance Method Details

#reload!

[ GitHub ]

  
# File 'railties/lib/rails/application/routes_reloader.rb', line 19

def reload!
  clear!
  load_paths
  finalize!
  route_sets.each(&:eager_load!) if eager_load
ensure
  revert
end

#updated?Boolean

[ GitHub ]

  
# File 'railties/lib/rails/application/routes_reloader.rb', line 10

delegate :execute_if_updated, :execute, :updated?, to: :updater