Module: Egads::Config

Extended by:
CommonConfig
Defined in:
lib/egads/config.rb

Overview

Local config in the tarball or current working directory

Class Method Summary collapse

Methods included from CommonConfig

config, s3_bucket, s3_prefix

Class Method Details

.build_extra_pathsObject



42
43
44
# File 'lib/egads/config.rb', line 42

def self.build_extra_paths
  config['build'] && Array(config['build']['extra_paths'])
end

.config_pathObject



24
25
26
27
28
29
30
# File 'lib/egads/config.rb', line 24

def self.config_path
  path = ENV['EGADS_CONFIG'] || File.join(Dir.pwd, 'egads.yml')
  unless path && File.readable?(path)
    raise ArgumentError.new("Could not read config file. Set either EGADS_CONFIG, or create egads.yml in the current directory")
  end
  path
end

.hooks_for(cmd, hook) ⇒ Object

Returns the hooks in the config for cmd and hook. E.g. hooks_for(:build, :post)



34
35
36
37
38
39
40
# File 'lib/egads/config.rb', line 34

def self.hooks_for(cmd, hook)
  if Hash === config[cmd.to_s]
    Array(config[cmd.to_s][hook.to_s])
  else
    []
  end
end

.seed_branchObject



46
47
48
# File 'lib/egads/config.rb', line 46

def self.seed_branch
  config['seed_branch'] || "egads-seed"
end