oxidized 0.29.0 → 0.29.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (174) hide show
  1. checksums.yaml +4 -4
  2. data/.github/dependabot.yml +31 -0
  3. data/.github/workflows/codeql.yml +76 -0
  4. data/.github/workflows/publishdocker.yml +3 -1
  5. data/.github/workflows/stale.yml +16 -0
  6. data/.rubocop_todo.yml +3 -3
  7. data/CHANGELOG.md +10 -0
  8. data/Dockerfile +2 -0
  9. data/README.md +3 -6
  10. data/docs/Creating-Models.md +14 -15
  11. data/docs/Ruby-API.md +12 -8
  12. data/lib/oxidized/model/acmepacket.rb +2 -0
  13. data/lib/oxidized/model/acos.rb +3 -1
  14. data/lib/oxidized/model/acsw.rb +2 -0
  15. data/lib/oxidized/model/adtran.rb +2 -0
  16. data/lib/oxidized/model/adva.rb +2 -0
  17. data/lib/oxidized/model/aen.rb +2 -0
  18. data/lib/oxidized/model/aireos.rb +2 -0
  19. data/lib/oxidized/model/airfiber.rb +2 -0
  20. data/lib/oxidized/model/airos.rb +2 -0
  21. data/lib/oxidized/model/alteonos.rb +2 -0
  22. data/lib/oxidized/model/alvarion.rb +2 -0
  23. data/lib/oxidized/model/aos.rb +2 -0
  24. data/lib/oxidized/model/aos7.rb +2 -0
  25. data/lib/oxidized/model/aoscx.rb +2 -0
  26. data/lib/oxidized/model/aosw.rb +3 -1
  27. data/lib/oxidized/model/apc_aos.rb +2 -0
  28. data/lib/oxidized/model/arbos.rb +2 -0
  29. data/lib/oxidized/model/aricentiss.rb +2 -0
  30. data/lib/oxidized/model/asa.rb +2 -0
  31. data/lib/oxidized/model/asyncos.rb +2 -0
  32. data/lib/oxidized/model/audiocodes.rb +2 -0
  33. data/lib/oxidized/model/audiocodesmp.rb +2 -0
  34. data/lib/oxidized/model/awplus.rb +2 -0
  35. data/lib/oxidized/model/axos.rb +2 -0
  36. data/lib/oxidized/model/bdcom.rb +2 -0
  37. data/lib/oxidized/model/boss.rb +3 -1
  38. data/lib/oxidized/model/br6910.rb +2 -0
  39. data/lib/oxidized/model/c4cmts.rb +2 -0
  40. data/lib/oxidized/model/cambium.rb +2 -0
  41. data/lib/oxidized/model/cambiumepmp.rb +2 -0
  42. data/lib/oxidized/model/casa.rb +2 -0
  43. data/lib/oxidized/model/catos.rb +2 -0
  44. data/lib/oxidized/model/ciscoce.rb +2 -0
  45. data/lib/oxidized/model/cisconga.rb +2 -0
  46. data/lib/oxidized/model/ciscosma.rb +2 -0
  47. data/lib/oxidized/model/ciscosmb.rb +2 -0
  48. data/lib/oxidized/model/ciscovpn3k.rb +2 -0
  49. data/lib/oxidized/model/cnos.rb +2 -0
  50. data/lib/oxidized/model/comnetms.rb +2 -0
  51. data/lib/oxidized/model/comtrol.rb +2 -0
  52. data/lib/oxidized/model/comware.rb +1 -0
  53. data/lib/oxidized/model/coriant8600.rb +2 -0
  54. data/lib/oxidized/model/coriantgroove.rb +2 -0
  55. data/lib/oxidized/model/corianttmos.rb +2 -0
  56. data/lib/oxidized/model/cumulus.rb +2 -0
  57. data/lib/oxidized/model/datacom.rb +2 -0
  58. data/lib/oxidized/model/dcnos.rb +2 -0
  59. data/lib/oxidized/model/dellx.rb +2 -0
  60. data/lib/oxidized/model/dlink.rb +2 -0
  61. data/lib/oxidized/model/dnos.rb +2 -0
  62. data/lib/oxidized/model/eciapollo.rb +2 -0
  63. data/lib/oxidized/model/edgecos.rb +2 -0
  64. data/lib/oxidized/model/edgeos.rb +2 -0
  65. data/lib/oxidized/model/edgeswitch.rb +2 -0
  66. data/lib/oxidized/model/eltex.rb +2 -0
  67. data/lib/oxidized/model/enterasys.rb +2 -0
  68. data/lib/oxidized/model/enterasys800.rb +2 -0
  69. data/lib/oxidized/model/eos.rb +2 -0
  70. data/lib/oxidized/model/fabricos.rb +2 -0
  71. data/lib/oxidized/model/fastiron.rb +2 -0
  72. data/lib/oxidized/model/fiberdriver.rb +2 -0
  73. data/lib/oxidized/model/firebrick.rb +2 -0
  74. data/lib/oxidized/model/firelinuxos.rb +2 -0
  75. data/lib/oxidized/model/firewareos.rb +2 -0
  76. data/lib/oxidized/model/fortios.rb +2 -0
  77. data/lib/oxidized/model/fortiwlc.rb +2 -0
  78. data/lib/oxidized/model/ftos.rb +2 -0
  79. data/lib/oxidized/model/fujitsupy.rb +2 -0
  80. data/lib/oxidized/model/gaiaos.rb +2 -0
  81. data/lib/oxidized/model/gcombnps.rb +2 -0
  82. data/lib/oxidized/model/grandstream.rb +2 -0
  83. data/lib/oxidized/model/h3c.rb +2 -0
  84. data/lib/oxidized/model/hatteras.rb +2 -0
  85. data/lib/oxidized/model/hios.rb +2 -0
  86. data/lib/oxidized/model/hirschmann.rb +2 -0
  87. data/lib/oxidized/model/hpebladesystem.rb +2 -0
  88. data/lib/oxidized/model/hpemsa.rb +2 -0
  89. data/lib/oxidized/model/hpmsm.rb +2 -0
  90. data/lib/oxidized/model/ibos.rb +2 -0
  91. data/lib/oxidized/model/icotera.rb +2 -0
  92. data/lib/oxidized/model/ios.rb +2 -0
  93. data/lib/oxidized/model/iosxr.rb +2 -0
  94. data/lib/oxidized/model/ipos.rb +2 -0
  95. data/lib/oxidized/model/ironware.rb +2 -0
  96. data/lib/oxidized/model/isam.rb +2 -0
  97. data/lib/oxidized/model/junos.rb +2 -0
  98. data/lib/oxidized/model/lancom.rb +2 -0
  99. data/lib/oxidized/model/lenovonos.rb +2 -0
  100. data/lib/oxidized/model/linksyssrw.rb +2 -0
  101. data/lib/oxidized/model/linuxgeneric.rb +2 -0
  102. data/lib/oxidized/model/masteros.rb +2 -0
  103. data/lib/oxidized/model/mlnxos.rb +2 -0
  104. data/lib/oxidized/model/model.rb +6 -5
  105. data/lib/oxidized/model/mtrlrfs.rb +2 -0
  106. data/lib/oxidized/model/ndms.rb +3 -1
  107. data/lib/oxidized/model/necix.rb +2 -0
  108. data/lib/oxidized/model/netgear.rb +2 -0
  109. data/lib/oxidized/model/netonix.rb +2 -0
  110. data/lib/oxidized/model/netscaler.rb +2 -0
  111. data/lib/oxidized/model/nodegrid.rb +2 -0
  112. data/lib/oxidized/model/nos.rb +2 -0
  113. data/lib/oxidized/model/nsxconfig.rb +2 -0
  114. data/lib/oxidized/model/nsxfirewall.rb +2 -0
  115. data/lib/oxidized/model/nxos.rb +2 -0
  116. data/lib/oxidized/model/oneos.rb +2 -0
  117. data/lib/oxidized/model/openbsd.rb +2 -0
  118. data/lib/oxidized/model/opengear.rb +2 -0
  119. data/lib/oxidized/model/openwrt.rb +2 -0
  120. data/lib/oxidized/model/opnsense.rb +2 -0
  121. data/lib/oxidized/model/os10.rb +2 -0
  122. data/lib/oxidized/model/outputs.rb +2 -0
  123. data/lib/oxidized/model/panos.rb +2 -0
  124. data/lib/oxidized/model/panos_api.rb +2 -0
  125. data/lib/oxidized/model/pfsense.rb +2 -0
  126. data/lib/oxidized/model/planet.rb +2 -0
  127. data/lib/oxidized/model/powerconnect.rb +2 -0
  128. data/lib/oxidized/model/procurve.rb +2 -0
  129. data/lib/oxidized/model/purityos.rb +2 -0
  130. data/lib/oxidized/model/qtech.rb +2 -0
  131. data/lib/oxidized/model/quantaos.rb +2 -0
  132. data/lib/oxidized/model/raisecom.rb +2 -0
  133. data/lib/oxidized/model/routeros.rb +2 -0
  134. data/lib/oxidized/model/saos.rb +2 -0
  135. data/lib/oxidized/model/screenos.rb +2 -0
  136. data/lib/oxidized/model/sgos.rb +2 -0
  137. data/lib/oxidized/model/siklu.rb +2 -0
  138. data/lib/oxidized/model/slxos.rb +2 -0
  139. data/lib/oxidized/model/smartax.rb +2 -0
  140. data/lib/oxidized/model/smartcs.rb +2 -0
  141. data/lib/oxidized/model/sonicos.rb +2 -0
  142. data/lib/oxidized/model/speedtouch.rb +2 -0
  143. data/lib/oxidized/model/sros.rb +3 -1
  144. data/lib/oxidized/model/srosmd.rb +2 -0
  145. data/lib/oxidized/model/stoneos.rb +2 -0
  146. data/lib/oxidized/model/swos.rb +2 -0
  147. data/lib/oxidized/model/tdre.rb +2 -0
  148. data/lib/oxidized/model/telco.rb +2 -0
  149. data/lib/oxidized/model/tmos.rb +3 -1
  150. data/lib/oxidized/model/tplink.rb +2 -0
  151. data/lib/oxidized/model/trango.rb +2 -0
  152. data/lib/oxidized/model/truenas.rb +2 -0
  153. data/lib/oxidized/model/ucs.rb +2 -0
  154. data/lib/oxidized/model/viptela.rb +2 -0
  155. data/lib/oxidized/model/voltaire.rb +2 -0
  156. data/lib/oxidized/model/voss.rb +2 -0
  157. data/lib/oxidized/model/vrp.rb +2 -0
  158. data/lib/oxidized/model/vyatta.rb +2 -0
  159. data/lib/oxidized/model/weos.rb +2 -0
  160. data/lib/oxidized/model/xos.rb +2 -0
  161. data/lib/oxidized/model/yamaha.rb +2 -0
  162. data/lib/oxidized/model/zhoneolt.rb +2 -0
  163. data/lib/oxidized/model/zteolt.rb +2 -0
  164. data/lib/oxidized/model/zy1308.rb +2 -0
  165. data/lib/oxidized/model/zynos.rb +2 -0
  166. data/lib/oxidized/model/zynoscli.rb +2 -0
  167. data/lib/oxidized/model/zynosgs.rb +2 -0
  168. data/lib/oxidized/output/git.rb +2 -1
  169. data/lib/oxidized/version.rb +2 -2
  170. data/lib/oxidized.rb +1 -1
  171. data/lib/refinements.rb +43 -0
  172. metadata +6 -4
  173. data/.github/no-response.yml +0 -13
  174. data/lib/oxidized/string.rb +0 -42
@@ -1,4 +1,6 @@
1
1
  class Comtrol < Oxidized::Model
2
+ using Refinements
3
+
2
4
  # Used in Comtrol Industrial Switches, such as RocketLinx ES8510
3
5
 
4
6
  # Typical prompt "<hostname>#"
@@ -1,5 +1,6 @@
1
1
  class Comware < Oxidized::Model
2
2
  # HP (A-series)/H3C/3Com Comware
3
+ using Refinements
3
4
 
4
5
  # sometimes the prompt might have a leading nul or trailing ASCII Bell (^G)
5
6
  prompt /^\0*(<[\w.-]+>).?$/
@@ -1,4 +1,6 @@
1
1
  class Coriant8600 < Oxidized::Model
2
+ using Refinements
3
+
2
4
  comment '# '
3
5
 
4
6
  prompt /^[^\s#>]+[#>]$/
@@ -1,4 +1,6 @@
1
1
  class CoriantGroove < Oxidized::Model
2
+ using Refinements
3
+
2
4
  comment '# '
3
5
 
4
6
  prompt /^(\w+@.*>\s*)$/
@@ -1,4 +1,6 @@
1
1
  class CoriantTmos < Oxidized::Model
2
+ using Refinements
3
+
2
4
  comment '# '
3
5
 
4
6
  prompt /^[^\s#]+#\s$/
@@ -1,4 +1,6 @@
1
1
  class Cumulus < Oxidized::Model
2
+ using Refinements
3
+
2
4
  prompt /^((\w*)@(.*)):/
3
5
  comment '# '
4
6
 
@@ -1,4 +1,6 @@
1
1
  class DataCom < Oxidized::Model
2
+ using Refinements
3
+
2
4
  comment '! '
3
5
 
4
6
  expect /^--More--\s+$/ do |data, re|
@@ -5,6 +5,8 @@
5
5
  # Developed against SNR S2950-24G 7.0.3.5
6
6
 
7
7
  class DCNOS < Oxidized::Model
8
+ using Refinements
9
+
8
10
  comment '! '
9
11
 
10
12
  cmd :all do |cfg|
@@ -1,4 +1,6 @@
1
1
  class DellX < Oxidized::Model
2
+ using Refinements
3
+
2
4
  # Used in Dell X-Series Switches
3
5
 
4
6
  prompt /[#>]$/
@@ -1,4 +1,6 @@
1
1
  class Dlink < Oxidized::Model
2
+ using Refinements
3
+
2
4
  # D-LINK Switches
3
5
  # Add support dgs 1100 series (tested only with dgs-1100-10/me)
4
6
 
@@ -1,4 +1,6 @@
1
1
  class DNOS < Oxidized::Model
2
+ using Refinements
3
+
2
4
  # Force10 DNOS model #
3
5
 
4
6
  comment '! '
@@ -2,6 +2,8 @@
2
2
  # Tested on OPT9608 systems via SSH and telnet
3
3
 
4
4
  class ECIapollo < Oxidized::Model
5
+ using Refinements
6
+
5
7
  prompt /^([\w.@()-]+[#>]\s?)$/
6
8
  comment '# '
7
9
 
@@ -1,4 +1,6 @@
1
1
  class EdgeCOS < Oxidized::Model
2
+ using Refinements
3
+
2
4
  comment '! '
3
5
 
4
6
  # Handle pager for ES3526XA-V2
@@ -1,4 +1,6 @@
1
1
  class Edgeos < Oxidized::Model
2
+ using Refinements
3
+
2
4
  # EdgeOS #
3
5
 
4
6
  prompt /@.*?:~\$\s/
@@ -1,4 +1,6 @@
1
1
  class EdgeSwitch < Oxidized::Model
2
+ using Refinements
3
+
2
4
  # Ubiquiti EdgeSwitch #
3
5
 
4
6
  comment '!'
@@ -1,4 +1,6 @@
1
1
  class Eltex < Oxidized::Model
2
+ using Refinements
3
+
2
4
  # Tested with MES2324FB Version: 4.0.7.1 Build: 37 (master)
3
5
 
4
6
  prompt /^\s?[\w.@\(\)-]+[#>]\s?$/
@@ -1,4 +1,6 @@
1
1
  class Enterasys < Oxidized::Model
2
+ using Refinements
3
+
2
4
  # Enterasys B3/C3 models #
3
5
 
4
6
  prompt /^.+\w\((su|rw)\)->\s?$/
@@ -1,4 +1,6 @@
1
1
  class Enterasys800 < Oxidized::Model
2
+ using Refinements
3
+
2
4
  # Enterasys 800 models #
3
5
  # Tested with 08H20G4-24 Fast Ethernet Switch Firmware: Build 01.01.01.0017
4
6
  comment '# '
@@ -1,4 +1,6 @@
1
1
  class EOS < Oxidized::Model
2
+ using Refinements
3
+
2
4
  # Arista EOS model #
3
5
 
4
6
  prompt /^.+[#>]$/
@@ -1,4 +1,6 @@
1
1
  class FabricOS < Oxidized::Model
2
+ using Refinements
3
+
2
4
  # Brocade Fabric OS model #
3
5
  ## FIXME: Only ssh exec mode support, no telnet, no ssh screenscraping
4
6
 
@@ -1,4 +1,6 @@
1
1
  class FastIron < Oxidized::Model
2
+ using Refinements
3
+
2
4
  prompt /^([\w.@()-]+[#>]\s?)$/
3
5
  comment '! '
4
6
 
@@ -1,4 +1,6 @@
1
1
  class FiberDriver < Oxidized::Model
2
+ using Refinements
3
+
2
4
  prompt /\w+#/
3
5
  comment "! "
4
6
 
@@ -1,4 +1,6 @@
1
1
  class Firebrick < Oxidized::Model
2
+ using Refinements
3
+
2
4
  # Firebrick #
3
5
  prompt /\x0a\x1b\x5b\x32\x4b\x0d.*>\s/
4
6
 
@@ -1,4 +1,6 @@
1
1
  class FireLinuxOS < Oxidized::Model
2
+ using Refinements
3
+
2
4
  # Fire Linux OS is what the new FTD (FirePOWER) series devices from Cisco run. At the backend, it's mostly identical to ASA's.
3
5
 
4
6
  prompt /^[#>]\(?.+\)?\s?/
@@ -1,4 +1,6 @@
1
1
  class FirewareOS < Oxidized::Model
2
+ using Refinements
3
+
2
4
  prompt /^\[?\w*\]?\w*?(<\w*>)?(#|>)\s*$/
3
5
  comment '-- '
4
6
 
@@ -1,4 +1,6 @@
1
1
  class FortiOS < Oxidized::Model
2
+ using Refinements
3
+
2
4
  comment '# '
3
5
 
4
6
  prompt /^([-\w.~]+(\s[(\w\-.)]+)?~?\s?[#>$]\s?)$/
@@ -1,4 +1,6 @@
1
1
  class FortiWLC < Oxidized::Model
2
+ using Refinements
3
+
2
4
  comment '# '
3
5
 
4
6
  cmd :all do |cfg, cmdstring|
@@ -1,4 +1,6 @@
1
1
  class FTOS < Oxidized::Model
2
+ using Refinements
3
+
2
4
  # Force10 FTOS model #
3
5
 
4
6
  comment '! '
@@ -1,4 +1,6 @@
1
1
  class FujitsuPY < Oxidized::Model
2
+ using Refinements
3
+
2
4
  prompt /^(\([\w.-]*\)\s#|^\S+#\s)$/
3
5
  comment '! '
4
6
 
@@ -1,4 +1,6 @@
1
1
  class GaiaOS < Oxidized::Model
2
+ using Refinements
3
+
2
4
  # CheckPoint - Gaia OS Model
3
5
 
4
6
  # Gaia Prompt
@@ -1,4 +1,6 @@
1
1
  class GcomBNPS < Oxidized::Model
2
+ using Refinements
3
+
2
4
  # For switches from GCOM Technologies Co.,Ltd. running the "Broadband Network Platform Software"
3
5
  # Author: Frederik Kriewitz <frederik@kriewitz.eu>
4
6
  #
@@ -1,4 +1,6 @@
1
1
  class GrandStream < Oxidized::Model
2
+ using Refinements
3
+
2
4
  cmd "/cgi-bin/dologin?password=%<password>s" do |cfg| # rubocop:disable Style/FormatStringToken
3
5
  sid = JSON.parse(cfg)["body"]["sid"]
4
6
  cmd "/cgi-bin/download_cfg?sid=#{sid}"
@@ -1,4 +1,6 @@
1
1
  class H3C < Oxidized::Model
2
+ using Refinements
3
+
2
4
  # H3C
3
5
 
4
6
  prompt /^.*(<[\w.-]+>)$/
@@ -1,4 +1,6 @@
1
1
  class Hatteras < Oxidized::Model
2
+ using Refinements
3
+
2
4
  # Hatteras Networks
3
5
 
4
6
  prompt /^(\r?[\w.@()-]+[#>]\s?)$/
@@ -1,4 +1,6 @@
1
1
  class Hios < Oxidized::Model
2
+ using Refinements
3
+
2
4
  ## Docker location: /var/lib/gems/2.7.0/gems/oxidized-0.28.0/lib/oxidized/model/hios.rb
3
5
  prompt /^\[[\w\s\W]+\][>|#]+?$/
4
6
 
@@ -1,4 +1,6 @@
1
1
  class Hirschmann < Oxidized::Model
2
+ using Refinements
3
+
2
4
  prompt /^[(\w\s)]+\s[>|#]+?$/
3
5
 
4
6
  comment '## '
@@ -1,4 +1,6 @@
1
1
  class HPEBladeSystem < Oxidized::Model
2
+ using Refinements
3
+
2
4
  # HPE Onboard Administrator
3
5
 
4
6
  prompt /.*> /
@@ -1,4 +1,6 @@
1
1
  class HpeMsa < Oxidized::Model
2
+ using Refinements
3
+
2
4
  prompt /^#\s?$/
3
5
 
4
6
  cmd 'show configuration'
@@ -1,4 +1,6 @@
1
1
  class HPMSM < Oxidized::Model
2
+ using Refinements
3
+
2
4
  prompt /^CLI[>#] +$/
3
5
 
4
6
  comment '! '
@@ -1,4 +1,6 @@
1
1
  class IBOS < Oxidized::Model
2
+ using Refinements
3
+
2
4
  # IBOS model, Intelligent Broadband Operating System (iBOS)
3
5
  # Used in Waystream (previously PacketFront) Routers and Switches
4
6
 
@@ -1,4 +1,6 @@
1
1
  class Icotera < Oxidized::Model
2
+ using Refinements
3
+
2
4
  comment '## '
3
5
 
4
6
  cmd :all do |cfg|
@@ -1,4 +1,6 @@
1
1
  class IOS < Oxidized::Model
2
+ using Refinements
3
+
2
4
  prompt /^([\w.@()-]+[#>]\s?)$/
3
5
  comment '! '
4
6
 
@@ -1,4 +1,6 @@
1
1
  class IOSXR < Oxidized::Model
2
+ using Refinements
3
+
2
4
  # IOS XR model #
3
5
 
4
6
  prompt /^(\r?[\w.@:\/-]+[#>]\s?)$/
@@ -1,4 +1,6 @@
1
1
  class IPOS < Oxidized::Model
2
+ using Refinements
3
+
2
4
  # Ericsson SSR (IPOS)
3
5
  # Redback SE (SEOS)
4
6
 
@@ -1,4 +1,6 @@
1
1
  class IronWare < Oxidized::Model
2
+ using Refinements
3
+
2
4
  prompt /^.*(telnet|ssh)@.+[>#]\s?$/i
3
5
  comment '! '
4
6
 
@@ -1,4 +1,6 @@
1
1
  class ISAM < Oxidized::Model
2
+ using Refinements
3
+
2
4
  # Alcatel ISAM 7302/7330 FTTN
3
5
 
4
6
  prompt /^([\w.:@-]+>#\s)$/
@@ -1,4 +1,6 @@
1
1
  class JunOS < Oxidized::Model
2
+ using Refinements
3
+
2
4
  comment '# '
3
5
 
4
6
  def telnet
@@ -1,4 +1,6 @@
1
1
  class LANCOM < Oxidized::Model
2
+ using Refinements
3
+
2
4
  # LANCOM Systems GmbH
3
5
  # tested on LANCOM 1781EF+ router using Lancom OS 10.32.0176RU9 / 21.04.2020
4
6
  comment '# '
@@ -1,4 +1,6 @@
1
1
  class LenovoNOS < Oxidized::Model
2
+ using Refinements
3
+
2
4
  prompt /^([\w.@()-]+[#>]\s?)$/
3
5
  comment '! '
4
6
 
@@ -1,4 +1,6 @@
1
1
  class LinksysSRW < Oxidized::Model
2
+ using Refinements
3
+
2
4
  comment '! '
3
5
 
4
6
  prompt /^([\r\w.@-]+[#>]\s?)$/
@@ -1,4 +1,6 @@
1
1
  class LinuxGeneric < Oxidized::Model
2
+ using Refinements
3
+
2
4
  prompt /^(\w.*|\W.*)(:|#) /
3
5
  comment '# '
4
6
 
@@ -1,4 +1,6 @@
1
1
  class MasterOS < Oxidized::Model
2
+ using Refinements
3
+
2
4
  # MRV MasterOS model #
3
5
 
4
6
  comment '!'
@@ -1,4 +1,6 @@
1
1
  class MLNXOS < Oxidized::Model
2
+ using Refinements
3
+
2
4
  prompt /([\w.@()-\[:\s\]]+[#>]\s)$/
3
5
  comment '## '
4
6
 
@@ -3,6 +3,8 @@ require_relative 'outputs'
3
3
 
4
4
  module Oxidized
5
5
  class Model
6
+ using Refinements
7
+
6
8
  include Oxidized::Config::Vars
7
9
 
8
10
  class << self
@@ -122,14 +124,14 @@ module Oxidized
122
124
 
123
125
  out = out.b unless Oxidized.config.input.utf8_encoded?
124
126
  self.class.cmds[:all].each do |all_block|
125
- out = instance_exec Oxidized::String.new(out), string, &all_block
127
+ out = instance_exec out, string, &all_block
126
128
  end
127
129
  if vars :remove_secret
128
130
  self.class.cmds[:secret].each do |all_block|
129
- out = instance_exec Oxidized::String.new(out), string, &all_block
131
+ out = instance_exec out, string, &all_block
130
132
  end
131
133
  end
132
- out = instance_exec Oxidized::String.new(out), &block if block
134
+ out = instance_exec out, &block if block
133
135
  process_cmd_output out, string
134
136
  end
135
137
 
@@ -214,8 +216,7 @@ module Oxidized
214
216
  private
215
217
 
216
218
  def process_cmd_output(output, name)
217
- output = Oxidized::String.new(output) if output.is_a?(::String)
218
- output = Oxidized::String.new('') unless output.instance_of?(Oxidized::String)
219
+ output = String.new('') unless output.instance_of?(String)
219
220
  output.set_cmd(name)
220
221
  output
221
222
  end
@@ -1,4 +1,6 @@
1
1
  class Mtrlrfs < Oxidized::Model
2
+ using Refinements
3
+
2
4
  # Motorola RFS/Extreme WM
3
5
 
4
6
  comment '# '
@@ -1,7 +1,9 @@
1
1
  class NDMS < Oxidized::Model
2
+ using Refinements
3
+
2
4
  # Pull config from Zyxel Keenetic devices from version NDMS >= 2.0
3
5
 
4
- comment '! '
6
+ comment '! '
5
7
 
6
8
  prompt /^([\w.@()-]+[#>]\s?)/m
7
9
 
@@ -1,4 +1,6 @@
1
1
  class NecIX < Oxidized::Model
2
+ using Refinements
3
+
2
4
  prompt /^(\([\w.-]*\)\s[#$]|^\S+[$#]\s?)$/
3
5
  comment '! '
4
6
  expect /^--More--$/ do |data, re|
@@ -1,4 +1,6 @@
1
1
  class Netgear < Oxidized::Model
2
+ using Refinements
3
+
2
4
  comment '!'
3
5
  prompt /^(\([\w\s\-.]+\)\s[#>])$/
4
6
 
@@ -1,4 +1,6 @@
1
1
  class Netonix < Oxidized::Model
2
+ using Refinements
3
+
2
4
  prompt /^[\w\s\(\).@_\/:-]+#/
3
5
 
4
6
  cmd :all do |cfg|
@@ -1,4 +1,6 @@
1
1
  class NetScaler < Oxidized::Model
2
+ using Refinements
3
+
2
4
  prompt /^([\w\.-]*>\s?)$/
3
5
  comment '# '
4
6
 
@@ -1,4 +1,6 @@
1
1
  class Nodegrid < Oxidized::Model
2
+ using Refinements
3
+
2
4
  # ZPE Nodegrid (Tested with Nodegrid Gate/Bold/NSR)
3
5
  # https://www.zpesystems.com/products/
4
6
 
@@ -1,4 +1,6 @@
1
1
  class NOS < Oxidized::Model
2
+ using Refinements
3
+
2
4
  # Brocade Network Operating System
3
5
 
4
6
  prompt /^(?:\e\[..h)?[\w.-]+# $/
@@ -1,5 +1,7 @@
1
1
  require 'net/http'
2
2
  class NSXConfig < Oxidized::Model
3
+ using Refinements
4
+
3
5
  cmd "/api/4.0/edges/" do |cfg|
4
6
  edges = JSON.parse(cfg.encode('UTF-8', { invalid: :replace, undef: :replace, replace: '?' }))["edgePage"]["data"]
5
7
  data = []
@@ -1,5 +1,7 @@
1
1
  require 'net/http'
2
2
  class NSXFirewall < Oxidized::Model
3
+ using Refinements
4
+
3
5
  cmd "/api/4.0/edges/" do |cfg|
4
6
  edges = JSON.parse(cfg.encode('UTF-8', { invalid: :replace, undef: :replace, replace: '?' }))["edgePage"]["data"]
5
7
  data = []
@@ -1,4 +1,6 @@
1
1
  class NXOS < Oxidized::Model
2
+ using Refinements
3
+
2
4
  prompt /^(\r?[\w.@_()-]+[#]\s?)$/
3
5
  comment '! '
4
6
 
@@ -1,4 +1,6 @@
1
1
  class OneOS < Oxidized::Model
2
+ using Refinements
3
+
2
4
  prompt /^([\w.@()-]+#\s?)$/
3
5
  comment '! '
4
6
 
@@ -1,4 +1,6 @@
1
1
  class Openbsd < Oxidized::Model
2
+ using Refinements
3
+
2
4
  # OpenBSD with custom promp, like user@hostname:~$
3
5
  # you can edit the one that your user uses, with root would be /root/.profile using the next PS1 def
4
6
  # export PS1="\033[32m\u@\h\033[00m:\033[36m\w\033[00m$ "
@@ -1,4 +1,6 @@
1
1
  class OpenGear < Oxidized::Model
2
+ using Refinements
3
+
2
4
  comment '# '
3
5
 
4
6
  prompt /^(\$\s)$/
@@ -1,4 +1,6 @@
1
1
  class OpenWrt < Oxidized::Model
2
+ using Refinements
3
+
2
4
  prompt /^[^#]+#/
3
5
  comment '#'
4
6
 
@@ -1,4 +1,6 @@
1
1
  class OpnSense < Oxidized::Model
2
+ using Refinements
3
+
2
4
  # minimum required permissions: "System: Shell account access"
3
5
  # must enable SSH and password-based SSH access
4
6
 
@@ -1,4 +1,6 @@
1
1
  class OS10 < Oxidized::Model
2
+ using Refinements
3
+
2
4
  # For switches running Dell EMC Networking OS10 #
3
5
  #
4
6
  # Tested with : Dell PowerSwitch S4148U-ON
@@ -1,5 +1,7 @@
1
1
  module Oxidized
2
2
  class Model
3
+ using Refinements
4
+
3
5
  class Outputs
4
6
  def to_cfg
5
7
  type_to_str(nil)
@@ -1,4 +1,6 @@
1
1
  class PanOS < Oxidized::Model
2
+ using Refinements
3
+
2
4
  # PaloAlto PAN-OS model #
3
5
 
4
6
  comment '! '
@@ -17,6 +17,8 @@ rescue LoadError
17
17
  end
18
18
 
19
19
  class PanOS_API < Oxidized::Model # rubocop:disable Naming/ClassAndModuleCamelCase
20
+ using Refinements
21
+
20
22
  # Callback function for getting the configuration file.
21
23
  cfg_cb = lambda do
22
24
  url_param = URI.encode_www_form(