Class: Afterlife::Repo::Provider

Inherits:
Object
  • Object
show all
Defined in:
lib/afterlife/repo/provider.rb

Overview

Reads (and builds) the .afterlife.yml file in the repo

Constant Summary collapse

CONFIG_NAME =
'.afterlife.yml'

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(full_path) ⇒ Provider

Returns a new instance of Provider.



11
12
13
# File 'lib/afterlife/repo/provider.rb', line 11

def initialize(full_path)
  @full_path = full_path
end

Instance Attribute Details

#full_pathObject (readonly)

Returns the value of attribute full_path.



9
10
11
# File 'lib/afterlife/repo/provider.rb', line 9

def full_path
  @full_path
end

Instance Method Details

#configObject



15
16
17
18
19
20
21
22
23
24
# File 'lib/afterlife/repo/provider.rb', line 15

def config
  return @config if defined?(@config)

  if config_file.exist?
    @config = base_config
    @config = deep_merge(parent, base_config) if parent
  end

  @config ||= {}
end