Sha256: 695e238ca8e3212cec1528bc1bed57e7acb0c65fd518c05ab2d4a2af0f287308

Contents?: true

Size: 1.15 KB

Versions: 6

Compression:

Stored size: 1.15 KB

Contents

# The class serves as the parent for Trepan::CmdProcessor which is 
# quite large and spans over several files. By declaring initialize
# below, we have a consistent initialize routine and many of the
# others don't need to define initialize.

# Also, simple versions of the I/O routines make it possible
# to do testing without having to bring in the whole "Interface"
# and I/O routines that trepanning (and "main.rb") use.

# Note that via this file we can change 'module Trepan' to 'class
# Trepan' and this takes effect on all of the places which 
# subclass this. They use class 
#  Trepan::CmdProcessor < Trepan::VirtualCmdProcessor
# rather than breaking this down into to parts as below.
module Trepan
  class VirtualCmdProcessor
    attr_accessor :interfaces
    attr_accessor :state, :context, :settings
    def initialize(interfaces, settings={})
      @interfaces      = interfaces
      @intf            = interfaces[-1]
      @settings        = settings
    end
    def errmsg(message)
      puts "Error: #{message}"
    end
    def msg(message)
      puts message
    end
    def section(message, opts={})
      puts "Section: #{message}"
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
rb8-trepanning-0.1.6 processor/virtual.rb
rb8-trepanning-0.1.5 processor/virtual.rb
rb8-trepanning-0.1.4 processor/virtual.rb
rb8-trepanning-0.1.3 processor/virtual.rb
rb8-trepanning-0.1.3-universal-ruby-1.9.2 processor/virtual.rb
rb8-trepanning-0.1.3-universal-ruby-1.8.7 processor/virtual.rb