Class: Loom::Facts::FactFileProvider

Inherits:
Provider
  • Object
show all
Defined in:
lib/loom/facts/fact_file_provider.rb

Direct Known Subclasses

TxtFileProvider, YAMLFactFileProvider

Constant Summary collapse

InvalidFactFileConversion =
Class.new Loom::LoomError
YAML_FILE_GLOBS =
[
  "facts.yml",
  "facts/**/*.yml",
  "facts/**/*.yaml"
]
TXT_FILE_GLOBS =
[
  "facts.txt",
  "facts/**/*.txt"
]
ALL_FILE_GLOBS =
[
  "facts/**/*"
]

Instance Attribute Summary

Attributes inherited from Provider

#fact_map, #namespace

Instance Method Summary collapse

Methods inherited from Provider

create_fact_providers, #disable, disable_for_host, disabled_for_host?, register_factory

Constructor Details

#initialize(paths) ⇒ FactFileProvider

Returns a new instance of FactFileProvider.



35
36
37
# File 'lib/loom/facts/fact_file_provider.rb', line 35

def initialize(paths)
  @fact_map = convert_file_paths paths
end

Instance Method Details

#collect_factsObject



39
40
41
# File 'lib/loom/facts/fact_file_provider.rb', line 39

def collect_facts
  @fact_map.dup
end