Class: Yap::Addon::Path

Inherits:
Object
  • Object
show all
Defined in:
lib/yap/addon/path.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(paths, addons_config_hsh = {}) ⇒ Path

Returns a new instance of Path.



16
17
18
19
# File 'lib/yap/addon/path.rb', line 16

def initialize(paths, addons_config_hsh={})
  @paths = paths
  @addons_config_hsh = addons_config_hsh
end

Instance Attribute Details

#referencesObject (readonly)

Returns the value of attribute references.



14
15
16
# File 'lib/yap/addon/path.rb', line 14

def references
  @references
end

Class Method Details

.find_for_configuration(configuration) ⇒ Object



4
5
6
7
8
9
10
11
12
# File 'lib/yap/addon/path.rb', line 4

def self.find_for_configuration(configuration)
  addons_config_hsh = {}
  if File.exists?(configuration.yap_addons_configuration_path)
    addons_config_hsh = YAML.load_file(configuration.yap_addons_configuration_path)
  end

  new(configuration.addon_paths.flatten, addons_config_hsh).
    references.sort_by(&:name)
end