123456789_123456789_123456789_123456789_123456789_

Class: Rails::Application::RoutesReloader

Relationships & Source Files
Super Chains via Extension / Inclusion / Inheritance
Class Chain:
Instance Chain:
Inherits: Object
Defined in: railties/lib/rails/application/routes_reloader.rb

Constant Summary

::ActiveSupport::Callbacks - Included

CALLBACK_FILTER_TYPES

::ActiveSupport::Callbacks - Attributes & Methods

Class Method Summary

Instance Attribute Summary

Instance Method Summary

Constructor Details

.newRoutesReloader

[ GitHub ]

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

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

Class Attribute Details

.__callbacks (rw)

[ GitHub ]

  
# File 'activesupport/lib/active_support/callbacks.rb', line 69

class_attribute :__callbacks, instance_writer: false, instance_predicate: false, default: {}

Instance Attribute Details

#__callbacks (readonly)

[ GitHub ]

  
# File 'activesupport/lib/active_support/callbacks.rb', line 69

class_attribute :__callbacks, instance_writer: false, instance_predicate: false, default: {}

#eager_load (rw)

[ GitHub ]

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

attr_accessor :eager_load

#execute_if_updated (readonly)

[ GitHub ]

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

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

#external_routes (readonly)

[ GitHub ]

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

attr_reader :route_sets, :paths, :external_routes, :loaded

#loaded (readonly)

[ GitHub ]

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

attr_reader :route_sets, :paths, :external_routes, :loaded

#paths (readonly)

[ GitHub ]

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

attr_reader :route_sets, :paths, :external_routes, :loaded

#route_sets (readonly)

[ GitHub ]

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

attr_reader :route_sets, :paths, :external_routes, :loaded

Instance Method Details

#execute

[ GitHub ]

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

def execute
  @loaded = true
  updater.execute
end

#execute_unless_loaded

[ GitHub ]

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

def execute_unless_loaded
  unless @loaded
    execute
    ActiveSupport.run_load_hooks(:after_routes_loaded, Rails.application)
    true
  end
end

#reload!

[ GitHub ]

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

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 13

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