3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
|
# File 'lib/quiver/application.rb', line 3
def self.included(host)
host.send(:extend, ClassMethods)
host.root_module = host.parent
host.root_module.const_set(:Adapters, Module.new)
host.root_module.const_set(:Duties, Module.new)
host.root_module.const_set(:Endpoints, Module.new)
host.root_module.const_set(:Models, Module.new)
host.root_module.const_set(:Mappers, Quiver::Mappers.dup)
host.root_module.const_set(:Serializers, Module.new)
host.root_module.const_set(:Tasks, Quiver::Tasks.dup)
host.root_module.const_set(:Logger, Quiver::Logger.dup)
host.root_module.const_set(:DutyMaster, Quiver::DutyMaster.dup)
host.root_module.const_set(:DutyTestHelper, Quiver::DutyTestHelper.dup)
host.memory_adapter_store = Quiver::Adapter::MemoryAdapterStore.new
application_file = caller[0].partition(':').first
host.app_root = File.expand_path('..', File.dirname(application_file))
host.lib_dir = File.join(host.app_root, 'lib', File.basename(application_file, '.rb'))
host.default_adapter_type = :memory
host.default_duty_queue_backend = :memory
end
|