Module: Falcon::Command::Paths

Included in:
Proxy, Redirect, Virtual
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.



38
39
40
41
42
43
44
45
46
47
48
# File 'lib/falcon/command/paths.rb', line 38

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.



31
32
33
34
35
# File 'lib/falcon/command/paths.rb', line 31

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