Class: AIPP::Runner Abstract
Overview
This class is abstract.
Direct Known Subclasses
Instance Attribute Summary collapse
-
#aixm ⇒ AIXM::Document
readonly
Target document.
Instance Method Summary collapse
-
#builds_dir ⇒ Pathname
Directory containing the builds.
-
#config_file ⇒ Pathname
Config file for the current region.
- #effective_at ⇒ Object abstract
- #expiration_at ⇒ Object abstract
-
#initialize ⇒ Runner
constructor
A new instance of Runner.
- #inspect ⇒ String
- #output_file ⇒ Object
-
#region_dir ⇒ Pathname
Directory containing all files for the current region.
- #run ⇒ Object abstract
-
#sources_file ⇒ String
Sources file name (default: xmlschema representation of effective_at date/time).
Methods included from Debugger
#info, #original_warn, #verbose_info, #warn, #with_debugger
Constructor Details
#initialize ⇒ Runner
Returns a new instance of Runner.
11 12 13 14 15 16 17 18 |
# File 'lib/aipp/runner.rb', line 11 def initialize AIPP..storage = AIPP..storage.join(AIPP..region, AIPP..scope.downcase) AIPP..storage.mkpath @dependencies = THash.new @aixm = AIXM.document(effective_at: effective_at, expiration_at: expiration_at) AIXM.send("#{AIPP..schema}!") AIXM.config.region = AIPP..region end |
Instance Attribute Details
#aixm ⇒ AIXM::Document (readonly)
Returns target document.
9 10 11 |
# File 'lib/aipp/runner.rb', line 9 def aixm @aixm end |
Instance Method Details
#builds_dir ⇒ Pathname
Returns directory containing the builds.
56 57 58 |
# File 'lib/aipp/runner.rb', line 56 def builds_dir AIPP..storage.join('builds') end |
#config_file ⇒ Pathname
Returns config file for the current region.
61 62 63 |
# File 'lib/aipp/runner.rb', line 61 def config_file AIPP..storage.join('config.yml') end |
#effective_at ⇒ Object
This method is abstract.
26 27 28 |
# File 'lib/aipp/runner.rb', line 26 def effective_at fail "effective_at method must be implemented by module runner" end |
#expiration_at ⇒ Object
This method is abstract.
31 32 33 |
# File 'lib/aipp/runner.rb', line 31 def expiration_at nil end |
#output_file ⇒ Object
51 52 53 |
# File 'lib/aipp/runner.rb', line 51 def output_file "#{AIPP..region}_#{AIPP..scope}_#{effective_at.strftime('%F_%HZ')}.#{AIPP..schema}" end |
#region_dir ⇒ Pathname
Returns directory containing all files for the current region.
41 42 43 |
# File 'lib/aipp/runner.rb', line 41 def region_dir Pathname(__FILE__).dirname.join('regions', AIPP..region) end |
#run ⇒ Object
This method is abstract.
36 37 38 |
# File 'lib/aipp/runner.rb', line 36 def run fail "run method must be implemented by module runner" end |
#sources_file ⇒ String
Returns sources file name (default: xmlschema representation of effective_at date/time).
47 48 49 |
# File 'lib/aipp/runner.rb', line 47 def sources_file effective_at.xmlschema end |