Class: AIPP::Runner Abstract

Inherits:
Object
  • Object
show all
Includes:
Debugger
Defined in:
lib/aipp/runner.rb

Overview

This class is abstract.

Direct Known Subclasses

AIP::Runner, NOTAM::Runner, SHOOT::Runner

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Debugger

#info, #original_warn, #verbose_info, #warn, #with_debugger

Constructor Details

#initializeRunner

Returns a new instance of Runner.



11
12
13
14
15
16
17
18
# File 'lib/aipp/runner.rb', line 11

def initialize
  AIPP.options.storage = AIPP.options.storage.join(AIPP.options.region, AIPP.options.scope.downcase)
  AIPP.options.storage.mkpath
  @dependencies = THash.new
  @aixm = AIXM.document(effective_at: effective_at, expiration_at: expiration_at)
  AIXM.send("#{AIPP.options.schema}!")
  AIXM.config.region = AIPP.options.region
end

Instance Attribute Details

#aixmAIXM::Document (readonly)

Returns target document.

Returns:

  • (AIXM::Document)

    target document



9
10
11
# File 'lib/aipp/runner.rb', line 9

def aixm
  @aixm
end

Instance Method Details

#builds_dirPathname

Returns directory containing the builds.

Returns:

  • (Pathname)

    directory containing the builds



56
57
58
# File 'lib/aipp/runner.rb', line 56

def builds_dir
  AIPP.options.storage.join('builds')
end

#config_filePathname

Returns config file for the current region.

Returns:

  • (Pathname)

    config file for the current region



61
62
63
# File 'lib/aipp/runner.rb', line 61

def config_file
  AIPP.options.storage.join('config.yml')
end

#effective_atObject

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_atObject

This method is abstract.


31
32
33
# File 'lib/aipp/runner.rb', line 31

def expiration_at
  nil
end

#inspectString

Returns:



21
22
23
# File 'lib/aipp/runner.rb', line 21

def inspect
  "#<#{self.class}>"
end

#output_fileObject



51
52
53
# File 'lib/aipp/runner.rb', line 51

def output_file
  "#{AIPP.options.region}_#{AIPP.options.scope}_#{effective_at.strftime('%F_%HZ')}.#{AIPP.options.schema}"
end

#region_dirPathname

Returns directory containing all files for the current region.

Returns:

  • (Pathname)

    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.options.region)
end

#runObject

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_fileString

Returns sources file name (default: xmlschema representation of effective_at date/time).

Returns:

  • (String)

    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