Sha256: 39c1f973f81b7f20d84909c27665e0488f70298a7c9b237dd85758a25e713c67

Contents?: true

Size: 849 Bytes

Versions: 18

Compression:

Stored size: 849 Bytes

Contents

class Procurve < Oxidized::Model

  # FIXME: this is way too unsafe
  prompt /.*?(\w+# ).*/m

  comment  '! '

  expect /Press any key to continue/ do
     send ' '
     ""
  end

  cmd :all do |cfg|
    cfg = cfg.each_line.to_a[1..-3].join
    cfg = cfg.gsub /\r/, ''
    new_cfg = ''
    cfg.each_line do |line|
      line.sub! /^\e.*(\e.*)/, '\1'  #leave last escape
      line.sub! /\e\[24;1H/, ''      #remove last escape, is it always this?
      new_cfg << line
    end
    new_cfg
  end

  cmd 'show version' do |cfg|
    comment cfg
  end

  cmd 'show system-information' do |cfg|
    cfg = cfg.split("\n")[0..-8].join("\n")
    comment cfg
  end

  cmd 'show running-config'

  cfg :telnet do
    username /Username:/
    password /Password:/
  end

  cfg :telnet, :ssh do
    post_login 'no page'
    pre_logout "logout\ny\nn"
  end

end

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
oxidized-0.12.2 lib/oxidized/model/procurve.rb
oxidized-0.12.1 lib/oxidized/model/procurve.rb
oxidized-0.12.0 lib/oxidized/model/procurve.rb
oxidized-0.11.0 lib/oxidized/model/procurve.rb
oxidized-0.10.0 lib/oxidized/model/procurve.rb
oxidized-0.9.0 lib/oxidized/model/procurve.rb
oxidized-0.8.1 lib/oxidized/model/procurve.rb
oxidized-0.8.0 lib/oxidized/model/procurve.rb
oxidized-0.7.2 lib/oxidized/model/procurve.rb
oxidized-0.7.1 lib/oxidized/model/procurve.rb
oxidized-0.7.0 lib/oxidized/model/procurve.rb
oxidized-0.6.0 lib/oxidized/model/procurve.rb
oxidized-0.5.0 lib/oxidized/model/procurve.rb
oxidized-0.4.1 lib/oxidized/model/procurve.rb
oxidized-0.4.0 lib/oxidized/model/procurve.rb
oxidized-0.3.0 lib/oxidized/model/procurve.rb
oxidized-0.2.4 lib/oxidized/model/procurve.rb
oxidized-0.2.3 lib/oxidized/model/procurve.rb