Module: TurbotRunner

Defined in:
lib/turbot_runner.rb,
lib/turbot_runner/utils.rb,
lib/turbot_runner/runner.rb,
lib/turbot_runner/version.rb,
lib/turbot_runner/processor.rb,
lib/turbot_runner/validator.rb,
lib/turbot_runner/exceptions.rb,
lib/turbot_runner/base_handler.rb,
lib/turbot_runner/script_runner.rb

Defined Under Namespace

Modules: Utils, Validator Classes: BaseHandler, InterruptRun, InvalidDataType, Processor, Runner, ScriptRunner

Constant Summary collapse

SCHEMAS_PATH =
File.expand_path('../../schema/schemas', __FILE__)
VERSION =
'0.0.13'

Class Method Summary collapse

Class Method Details

.get_and_validate_schema_path(data_type) ⇒ Object



22
23
24
25
26
27
# File 'lib/turbot_runner.rb', line 22

def self.get_and_validate_schema_path(data_type)
  hyphenated_name = data_type.to_s.gsub("_", "-").gsub(" ", "-")
  path = File.join(SCHEMAS_PATH, "#{hyphenated_name}-schema.json")
  raise TurbotRunner::InvalidDataType.new("Could not find #{path}") unless File.exists?(path)
  path
end

.schema_path(data_type) ⇒ Object



15
16
17
18
19
20
# File 'lib/turbot_runner.rb', line 15

def self.schema_path(data_type)
  @schema_paths ||= Hash.new do |h, k|
    h[k] = get_and_validate_schema_path(k)
  end
  @schema_paths[data_type]
end