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



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

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

.config_pathObject



29
30
31
32
33
34
35
# File 'lib/egads/config.rb', line 29

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)



39
40
41
42
43
44
45
# File 'lib/egads/config.rb', line 39

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



51
52
53
# File 'lib/egads/config.rb', line 51

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