Module: ClientReloader

Extended by:
ActiveSupport::Concern
Defined in:
lib/daylight/client_reloader.rb

Overview

Runs ‘alias_api` in the console during API development to re-alias the reloaded constants. Otherwise, they will hold onto the old un-reloaded constants in memory.

This is not intended for end-users of the API, but can be used by them if needed.

You must enable this functionality:

require 'daylight/client_reloader'

NOTE: Currently only works with IRB

Class Method Summary collapse

Class Method Details

.consoleObject



38
39
40
41
# File 'lib/daylight/client_reloader.rb', line 38

def console
  # we'll figure a way to set other consoles (eg. pry) later if neccessary
  @console ||= IRB rescue nil
end

.includeObject



30
31
32
33
34
35
36
# File 'lib/daylight/client_reloader.rb', line 30

def include
  if console && defined?(console::ExtendCommandBundle)
    console::ExtendCommandBundle.class_eval do
      include ClientReloader
    end
  end
end