class CaptainHoog::Hoogfile
Public Class Methods
new(path)
click to toggle source
Calls superclass method
# File lib/captain_hoog/hoogfile.rb, line 12 def initialize(path) @path = path super(hoogfile) end
read(path)
click to toggle source
# File lib/captain_hoog/hoogfile.rb, line 4 def self.read(path) self.send(:new,path) end
Public Instance Methods
plugins_config()
click to toggle source
# File lib/captain_hoog/hoogfile.rb, line 17 def plugins_config # select all plugin config into an env hash config = self.to_h.reduce({}) do |plugins_env_hash, (item_key, item_value)| unless reserved_keys.include?(item_key) plugins_env_hash.update(item_key => item_value) end end CaptainHoog::Struct.new(config) end
Also aliased as: plugins_env
Private Instance Methods
hoogfile()
click to toggle source
# File lib/captain_hoog/hoogfile.rb, line 30 def hoogfile config = File.read(File.join(@path, 'hoogfile.yml')) data = ERB.new(config).result interpreted_config = YAML.load(data) raise StandardError if interpreted_config.key?(:plugins_config) interpreted_config end
hook_types()
click to toggle source
# File lib/captain_hoog/hoogfile.rb, line 38 def hook_types @hook_types ||= YAML.load_file(File.join(File.dirname(__FILE__), 'config', 'hook_types.yml')) end
reserved_keys()
click to toggle source
# File lib/captain_hoog/hoogfile.rb, line 44 def reserved_keys hook_types + %w(project_dir plugins_dir) end