Class: Falcon::Configuration::Loader

Inherits:
Async::Service::Loader
  • Object
show all
Defined in:
lib/falcon/configuration.rb

Overview

The domain specific language for loading configuration files.

Instance Method Summary collapse

Instance Method Details

#host(name, *parents, &block) ⇒ Object

Deprecated.

Use ‘service` and `include Falcon::Environment::Server` instead.

Define a host with the specified name. Adds ‘root` and `authority` keys.



41
42
43
44
45
# File 'lib/falcon/configuration.rb', line 41

def host(name, *parents, &block)
	@configuration.add(
		merge(*parents, name: name, root: @root, authority: name, &block)
	)
end

#load(*features) ⇒ Object

Deprecated.

Use ‘require` instead.

Load specific features into the current configuration.



26
27
28
29
30
31
32
33
34
35
# File 'lib/falcon/configuration.rb', line 26

def load(*features)
	features.each do |feature|
		case feature
		when Symbol
			require File.join(__dir__, "environment", "#{feature}.rb")
		else
			raise LoadError, "Unsure about how to load #{feature}!"
		end
	end
end

#proxy(name, *parents, &block) ⇒ Object

Deprecated.

Use ‘service` and `include Falcon::Environment::Proxy` instead.

Define a proxy with the specified name. Adds ‘root` and `authority` keys.



51
52
53
54
55
# File 'lib/falcon/configuration.rb', line 51

def proxy(name, *parents, &block)
	@configuration.add(
		merge(:proxy, *parents, name: name, root: @root, authority: name, &block)
	)
end

#rack(name, *parents, &block) ⇒ Object

Deprecated.

Use ‘service` and `include Falcon::Environment::Rack` instead.

Define a rack application with the specified name. Adds ‘root` and `authority` keys.



61
62
63
64
65
# File 'lib/falcon/configuration.rb', line 61

def rack(name, *parents, &block)
	@configuration.add(
		merge(:rack, *parents, name: name, root: @root, authority: name, &block)
	)
end

#supervisor(&block) ⇒ Object

Deprecated.

Use ‘service` and `include Falcon::Environment::Supervisor` instead.

Define a supervisor instance



69
70
71
72
73
74
75
# File 'lib/falcon/configuration.rb', line 69

def supervisor(&block)
	name = File.join(@root, "supervisor")
	
	@configuration.add(
		merge(:supervisor, name: name, root: @root, &block)
	)
end