Module: Falcon::Command::Paths

Included in:
Host, Proxy, Redirect
Defined in:
lib/falcon/command/paths.rb

Overview

A helper for resolving wildcard configuration paths.

Instance Method Summary collapse

Instance Method Details

#configurationObject

Build a configuration based on the resolved paths.



21
22
23
24
25
26
27
28
29
30
31
# File 'lib/falcon/command/paths.rb', line 21

def configuration
	configuration = Configuration.new
	
	self.resolved_paths.each do |path|
		path = File.expand_path(path)
		
		configuration.load_file(path)
	end
	
	return configuration
end

#resolved_paths(&block) ⇒ Object

Resolve a set of ‘@paths` that may contain wildcards, into a sorted, unique array.



14
15
16
17
18
# File 'lib/falcon/command/paths.rb', line 14

def resolved_paths(&block)
	@paths.collect do |path|
		Dir.glob(path)
	end.flatten.sort.uniq.each(&block)
end