Sha256: 62b8d95bcdc28a27c4cc7673b07a1adc650e19aab7be57e474cb5fad6b9b6795

Contents?: true

Size: 756 Bytes

Versions: 3

Compression:

Stored size: 756 Bytes

Contents

require 'yaml'

module Jeka
  class Implementation
    attr_reader :database
    attr_accessor :name
    attr_accessor :compiler
    
    def initialize(name)
      @name = name
      @information = {}
    end
    
    def information=(info)
      if info.kind_of? Hash
        @information = info
      else
        @yaml = YAML::load(File.open(info))
        @yaml.each_key {|key| @information[key.to_sym] = @yaml[key]}
      end
    end
    
    def information
      @information
    end
    
    def jekafy
      @database = Jeka::Analysis::Implementation.create(
        name: @name,
        compiler: @compiler.jekafy,
        implementation_information: Jeka::Analysis::ImplementationInformation.convert(@information)
      )
    end
    
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
jeka-0.2.2 lib/jeka/implementation.rb
jeka-0.2.1 lib/jeka/implementation.rb
jeka-0.2.0 lib/jeka/implementation.rb