Class: Chekku::Fetcher
- Inherits:
-
Object
- Object
- Chekku::Fetcher
- Defined in:
- lib/chekku/fetcher.rb
Constant Summary collapse
- CHEKKU_PATH =
"#{Dir.home}/.chekku"
- CHEKKU_EXPORT_URL =
"http://chekku.co/definitions/export"
- CHEKKU_DEFINITION_FILE =
"#{CHEKKU_PATH}/def.yml"
- MAX_DAYS =
7
Instance Attribute Summary collapse
-
#dependencies ⇒ Object
Returns the value of attribute dependencies.
Class Method Summary collapse
-
.fetch_for_chekkufile(file_path) ⇒ Array
Fetch the Definitions from the file.
Instance Method Summary collapse
Instance Attribute Details
#dependencies ⇒ Object
Returns the value of attribute dependencies.
13 14 15 |
# File 'lib/chekku/fetcher.rb', line 13 def dependencies @dependencies end |
Class Method Details
.fetch_for_chekkufile(file_path) ⇒ Array
Fetch the Definitions from the file
19 20 21 22 |
# File 'lib/chekku/fetcher.rb', line 19 def self.fetch_for_chekkufile(file_path) fetcher = new fetcher.dependencies_from_file end |
Instance Method Details
#definitions_hash ⇒ Object
28 29 30 31 32 33 34 35 36 |
# File 'lib/chekku/fetcher.rb', line 28 def definitions_hash begin definitions_yaml = load_definitions_file rescue ensure definitions_yaml ||= {} end ensure_definitions_are_up_to_date(definitions_yaml) end |
#dependencies_from_file ⇒ Object
24 25 26 |
# File 'lib/chekku/fetcher.rb', line 24 def dependencies_from_file @dependencies = Chekku::Definition.load(definitions_hash) end |