Sha256: bfe002985fc85df9745b80f8f108380bad37ee4184883b94324f5b57924b074d

Contents?: true

Size: 1.08 KB

Versions: 4

Compression:

Stored size: 1.08 KB

Contents

module Inch
  module CLI
    module Command
      module Output
        class Console < Base
          extend Forwardable

          attr_reader :object, :objects, :source_parser

          def_delegators :source_parser, :all_objects, :find_object, :find_objects
          alias :all :all_objects
          alias :ff :find_objects
          alias :f :find_object
          alias :o :object

          COLOR = :color198     # magenta-ish
          BG_COLOR = :color207  # magenta-ish

          def initialize(options, object, objects, source_parser)
            @options = options
            @object = object
            @objects = objects
            @source_parser = source_parser

            run
          end

          def run
            trace
            trace_header("Welcome to Inch's console", COLOR, BG_COLOR)
            trace edged(COLOR, @options.usage)
            @options.descriptions.each do |line|
              trace edged(COLOR, line)
            end
            run_pry
          end

          def run_pry
            binding.pry
          end
        end
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
inch-0.1.3 lib/inch/cli/command/output/console.rb
inch-0.1.2 lib/inch/cli/command/output/console.rb
inch-0.1.1 lib/inch/cli/command/output/console.rb
inch-0.1.0 lib/inch/cli/command/output/console.rb