Top Level Namespace

Defined Under Namespace

Modules: Apache Classes: Array, Fixnum, Hash, String, Symbol

Constant Summary collapse

CONFIG =
Hash[YAML.load_file('config.yml').collect { |k,v| [ k.to_sym, v ]

Instance Method Summary collapse

Instance Method Details

#get_environmentsObject



9
10
11
12
13
14
15
# File 'lib/apache/rake/create.rb', line 9

def get_environments
  CONFIG[:source_path] = File.expand_path(CONFIG[:source])

  Dir[File.join(CONFIG[:source_path], '**', '*.rb')].collect { |file|
    File.readlines(file).find_all { |line| line[%r{(if_environment|build_if)}] }.collect { |line| line.scan(%r{:[a-z_]+}) }
  }.flatten.uniq.sort.collect { |name| name[1..-1] }
end