Sha256: 81c27222273771e5ba977b369212b928d0fec97e124de114e768937f2a28bcb7

Contents?: true

Size: 695 Bytes

Versions: 9

Compression:

Stored size: 695 Bytes

Contents

require 'junoser/input'
require 'junoser/display/config_store'
require 'junoser/parser'
require 'junoser/transformer'

module Junoser
  module Display
    class Structure
      def initialize(io_or_string)
        @input = io_or_string
        @config = Junoser::Display::ConfigStore.new
      end

      def transform
        parser = Junoser::Parser.new
        transform = Junoser::Transformer.new

        Junoser::Input.new(@input).read.split("\n").each do |line|
          transformed = transform.apply(parser.parse(line))
          raise "ERROR: parse failed" unless transformed.is_a?(String)
          @config << transformed
        end

        @config.to_s
      end
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
junoser-0.2.4 lib/junoser/display/structure.rb
junoser-0.2.3 lib/junoser/display/structure.rb
junoser-0.2.2 lib/junoser/display/structure.rb
junoser-0.2.1 lib/junoser/display/structure.rb
junoser-0.2.0 lib/junoser/display/structure.rb
junoser-0.1.6 lib/junoser/display/structure.rb
junoser-0.1.5 lib/junoser/display/structure.rb
junoser-0.1.4 lib/junoser/display/structure.rb
junoser-0.1.3 lib/junoser/display/structure.rb