network-utility 1.1.9 → 1.1.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 341dec76c30b31ba819091d82e5fc79eea006fce8056a959b8dcc8d12407e15b
4
- data.tar.gz: 5d3b994e09709bf56c642c301e789e247bde5c9dd45744906b08596733416cf4
3
+ metadata.gz: 286a94343803a75f258f09ae43d7da3058790b4a87e2df9821c10bc3306e2fcd
4
+ data.tar.gz: 2d057337574709a1a4527103a0fbfdd1aa848f820dfb5716817044aa02fc2682
5
5
  SHA512:
6
- metadata.gz: f00cad96f98bee723603769307e9532ca889e249cbb9c5d368e3a96d7c67fd5259a6be0162318b91cf4a2388cd958189c40c8897c5de49185b9382d99b37659a
7
- data.tar.gz: afadef289dc1ebc79ebda4b7914920fe52414625dddae4882bb0662f23967df70bd6f5b80525ce853c31669ac0d3bd1d7e43d6b904ab7e2bed8416d03fa58e14
6
+ metadata.gz: 9bb3de402d61d24a08a2ead66e45c6af1928fe9c55a31705a0bdf5a28c497ce84120abd901d83ced1efd6800e25cbeffa7dd4ae142fe22f914d78a3a8822f774
7
+ data.tar.gz: f95fba26d0b5790ecca3127f761763fb38a4558b9035965ca2c3d57a142be17217a58f1942c90c3d7910eaaa42eaeecdf21a63fcdb76644fd407af45c23fceb9
data/document/config.md CHANGED
@@ -1049,11 +1049,11 @@ module CR16010H_F
1049
1049
  module_function
1050
1050
 
1051
1051
  def 配置解析 braw,*guards
1052
- raw = braw
1052
+ raw = braw.gsub("\r","")
1053
1053
  begin
1054
1054
  raw.split("\n")
1055
1055
  rescue
1056
- raw = braw.force_encoding('GBK').encode('UTF-8')
1056
+ raw = braw.force_encoding('GBK').encode('UTF-8').gsub("\r","")
1057
1057
  end
1058
1058
  cfg = {}
1059
1059
  hostname = guards[0] || raw.split("\n").find{|line|line.include?("sysname ")}.to_s.split("sysname ")[1]
@@ -1086,11 +1086,11 @@ module CR16018_F
1086
1086
  module_function
1087
1087
 
1088
1088
  def 配置解析 braw,*guards
1089
- raw = braw
1089
+ raw = braw.gsub("\r","")
1090
1090
  begin
1091
1091
  raw.split("\n")
1092
1092
  rescue
1093
- raw = braw.force_encoding('GBK').encode('UTF-8')
1093
+ raw = braw.force_encoding('GBK').encode('UTF-8').gsub("\r","")
1094
1094
  end
1095
1095
  cfg = {}
1096
1096
  hostname = guards[0] || raw.split("\n").find{|line|line.include?("sysname ")}.to_s.split("sysname ")[1]
@@ -1123,11 +1123,11 @@ module CR19000_20
1123
1123
  module_function
1124
1124
 
1125
1125
  def 配置解析 braw,*guards
1126
- raw = braw
1126
+ raw = braw.gsub("\r","")
1127
1127
  begin
1128
1128
  raw.split("\n")
1129
1129
  rescue
1130
- raw = braw.force_encoding('GBK').encode('UTF-8')
1130
+ raw = braw.force_encoding('GBK').encode('UTF-8').gsub("\r","")
1131
1131
  end
1132
1132
  cfg = {}
1133
1133
  hostname = guards[0] || raw.split("\n").find{|line|line.include?("sysname ")}.to_s.split("sysname ")[1]
@@ -36,7 +36,7 @@ module CR16018_F
36
36
 
37
37
  def 特殊接口配置 接口集合
38
38
  接口集合.collect{|接口|
39
- 接口 if /Virtual|NULL|LoopBack|M\-GigabitEthernet/.match(接口.split("\n")[0])
39
+ 接口 if /Virtual|VE\-L2VPN|NULL|LoopBack|M\-GigabitEthernet/.match(接口.split("\n")[0])
40
40
  }.compact.sort_by{|接口|接口.split("\n")[0]}
41
41
  end
42
42
 
@@ -64,7 +64,7 @@ module CR16018_F
64
64
  # func: 根据一个端口的描述信息,给出其格式化的类型、连接符、端口编号
65
65
  def 端口识别 描述
66
66
  连接符 = ''
67
- type = /HundredGigE|GigabitEthernet|Ten\-GigabitEthernet|M\-GigabitEthernet|Bridge\-Aggregation|Route\-Aggregation|Virtual\-Template|NULL|LoopBack/.match(描述)
67
+ type = /HundredGigE|GigabitEthernet|Ten\-GigabitEthernet|M\-GigabitEthernet|Bridge\-Aggregation|Route\-Aggregation|Virtual\-Template|VE\-L2VPN|NULL|LoopBack/.match(描述)
68
68
  类型 = type ? type.to_s : '未知类型'
69
69
  port = /(\d+|\/|\.)*(\d+)/.match(描述.split(类型).join)
70
70
  端口 = port ? port.to_s : '未知端口'
@@ -68,7 +68,7 @@ module NE40E_X16
68
68
  # func: 根据一个端口的描述信息,给出其格式化的类型、连接符、端口编号
69
69
  def 端口识别 描述
70
70
  连接符 = ''
71
- type = /100GE|GE|GigabitEthernet|Global\-VE|Pos|Ethernet|Eth\-Trunk|Ip-Trunk|Tunnel|Vlanif|Virtual\-Template|NULL|LoopBack|Logic\-Channel|Aux/.match(描述)
71
+ type = /100GE|GE|GigabitEthernet|Global\-VE|Pos|Ethernet|Eth\-Trunk|Ip-Trunk|ServiceIf|Tunnel|Vlanif|Virtual\-Template|NULL|LoopBack|Logic\-Channel|Aux/.match(描述)
72
72
  类型 = type ? type.to_s : '未知类型'
73
73
  port = /(\d+|\/|\.)*(\d+)/.match(描述.split(类型).join)
74
74
  端口 = port ? port.to_s : '未知端口'
data/network.rb CHANGED
@@ -18,5 +18,5 @@
18
18
  ].each{|mod|require mod}
19
19
 
20
20
  module Network
21
- VERSION = '1.1.9'
21
+ VERSION = '1.1.11'
22
22
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: network-utility
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.9
4
+ version: 1.1.11
5
5
  platform: ruby
6
6
  authors:
7
7
  - Matt