Sha256: 2b9e7b58df80c1e9983a634751a945c7c2d0aa410e3c9c1fa39c876fe40c5ff0

Contents?: true

Size: 674 Bytes

Versions: 3

Compression:

Stored size: 674 Bytes

Contents

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

module Junoser
  module Display
    class Structure
      include Base

      def initialize(io_or_string)
        super
        @config = Junoser::Display::ConfigStore.new
      end

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

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

        @output.puts @config.to_s
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
junoser-0.1.2 lib/junoser/display/structure.rb
junoser-0.1.1 lib/junoser/display/structure.rb
junoser-0.1.0 lib/junoser/display/structure.rb