class Lamma::Runtime

Constants

C_SHARP
EDGE_NODE_43
JAVA_8
NAME
NODE_43
PYTHON_27
PYTHON_36

Attributes

type[R]

Public Class Methods

all() click to toggle source
# File lib/lamma/runtime.rb, line 5
def self.all
  self.constants.map{|n| [n, self.const_get(n)] }.to_h
end
new(str) click to toggle source
# File lib/lamma/runtime.rb, line 16
def initialize(str)
  @type =
    case str
    when /^c[s#](harp)?$/i
      ::Lamma::Runtime::C_SHARP
    when /^java([-_\.\s]*8?)?$/i
      ::Lamma::Runtime::JAVA_8
    when /^node([-_\.\s]*4(\.?3)?)?$/i
      ::Lamma::Runtime::NODE_43
    when /^edge[-_\.\s]*node(\s*4(\.?3)?)?$/i
      ::Lamma::Runtime::EDGE_NODE_43
    when /^python([-_\.\s]*2(\.?7)?)?$/i
      ::Lamma::Runtime::PYTHON_27
    when /^python([-_\.\s]*3(\.?6)?)?$/i
      ::Lamma::Runtime::PYTHON_36
    else
      raise ArgumentError.new("invalid runtime. #{str}")
    end
end

Public Instance Methods

to_dirname() click to toggle source
# File lib/lamma/runtime.rb, line 49
def to_dirname
  NAME[@type].gsub(/[\.-]/, '_')
end
to_s() click to toggle source
# File lib/lamma/runtime.rb, line 45
def to_s
  NAME[@type]
end