junoser 0.4.7 → 0.5.1

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.
data/lib/junoser/ruler.rb CHANGED
@@ -138,7 +138,7 @@ module Junoser
138
138
  str.gsub!(/"snmp"(.*\s*.*)"snmptrap"/) { %["snmptrap"#{$1}"snmp"] }
139
139
  str.gsub!(/"ospf"(.*\s*.*)"ospf3"/) { %["ospf3"#{$1}"ospf"] }
140
140
  str.gsub! '"tls1" | "tls11" | "tls12"', '"tls11" | "tls12" | "tls1"'
141
- str.gsub!(/("group1" \| "group2" \| "group5") \| ([^)]+)/) { "#{$2} | #{$1}"}
141
+ str.gsub!(/("group1" \| "group2" \| "group5") \| ([^)]+)/) { "#{$2} | #{$1}" }
142
142
 
143
143
  %w[ccc ethernet-over-atm tcc vpls bridge].each do |encap|
144
144
  str.gsub!(/"ethernet"(.*)"ethernet-#{encap}"/) { %["ethernet-#{encap}"#{$1}"ethernet"] }
@@ -226,7 +226,7 @@ module Junoser
226
226
  str.gsub! '"system-name" arg', '"name" (quote | arg)'
227
227
 
228
228
  # Fix .xsd: argument of "system license keys key" can be quoted
229
- str.gsub!(/^(rule\(:license_object\) do.*?"key") arg/m) { "#{$1} (quote | arg)"}
229
+ str.gsub!(/^(rule\(:license_object\) do.*?"key") arg/m) { "#{$1} (quote | arg)" }
230
230
 
231
231
  # Fix .xsd: "prefix-limit teardown"
232
232
  str.gsub!(/^(\s*)"teardown" (\(.*?as\(:oneline\)\s*\)\s*\))/m) do
@@ -234,8 +234,22 @@ module Junoser
234
234
  end
235
235
 
236
236
  # Fix .xsd: faster interface speed support
237
- str.gsub! '"40g" | "oc3"', '"40g" | "100g" | "200g" | "400g" | "800g" | "oc3"'
238
- str.gsub! '"100G"', '"100G" | "200G" | "400G" | "800G"'
237
+ str.gsub! '"400g" | "oc', '"400g" | "800g" | "oc'
238
+ str.gsub! '"400G"', '"400G" | "800G"'
239
+
240
+ # Fix .xsd: "poe"
241
+ str.gsub!(/^(\s*"interface" \("all" \| "all-extended" \| arg\) \(\s*)c\(/) { "#{$1}sc(" }
242
+ str.gsub!(/^(\s*)\)(,\s*"fpc" enum\(\("all" \| "fpc-slot-number"\)\) \(\s*)c\((.*"lldp-priority"\s*\)\s*\))/m) do
243
+ "#{$1}).as(:oneline)#{$2}sc(#{$3}.as(:oneline)"
244
+ end
245
+
246
+ # Fix .xsd: support "set protocols iccp peer xxx liveness-detection single-hop"
247
+ str.gsub!(/(^rule\(:peer_group\) do.*?\n(\s*)"detection-time" \(\s*c\(\s*"threshold" arg\s*\)\s*\))/m) do
248
+ "#{$1},\n#{format('"single-hop"', $2)}"
249
+ end
250
+
251
+ # Fix .xsd: support "set interfaces xxx ether-options speed"
252
+ str.gsub! '"ethernet-1', '"1'
239
253
 
240
254
  str
241
255
  end
@@ -1,3 +1,3 @@
1
1
  module Junoser
2
- VERSION = "0.4.7"
2
+ VERSION = "0.5.1"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: junoser
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.7
4
+ version: 0.5.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Shintaro Kojima
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-09-19 00:00:00.000000000 Z
11
+ date: 2022-11-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: parslet
@@ -101,9 +101,11 @@ files:
101
101
  - bin/console
102
102
  - bin/setup
103
103
  - commitlint.config.js
104
+ - example/ex-18.1R3-S6.1.xsd
104
105
  - example/get-schema.xml
105
106
  - example/junos-18.1R3-S9.rb
106
107
  - example/mx-19.3R3-S1.3.rb
108
+ - example/mx-21.2R3-S2.9.rb
107
109
  - example/vmx-17.2R1.13.rb
108
110
  - example/vsrx-12.1.x47.rb
109
111
  - example/vsrx-18.3R1.9.rb