junoser 0.4.2 → 0.4.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/test-linux.yaml +30 -0
- data/.pre-commit-config.yaml +7 -0
- data/CHANGELOG.md +21 -0
- data/Gemfile.lock +9 -9
- data/LICENSE.txt +1 -1
- data/README.md +2 -2
- data/commitlint.config.js +5 -0
- data/lib/junoser/display/set.rb +4 -0
- data/lib/junoser/js_ruler.rb +2 -0
- data/lib/junoser/parser.rb +2 -2
- data/lib/junoser/ruler.rb +3 -0
- data/lib/junoser/version.rb +1 -1
- metadata +5 -3
- data/.travis.yml +0 -15
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 713f225a607c33ca8acdd832a0252b217da1c5cfc9d9d5075efee87cde04dff1
|
4
|
+
data.tar.gz: 98bc62a4a4c37c6f654412807f989d486beb4a813d65db661e94883b34294b76
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 18c5b6efde1452334353e90676e3375e730fecada9c2b09f173ea40e4f9a6dce54ffe6dc7adfdf65306673f56e86efd50cdbc91a9ed865ae2465f6caddfcdfbc
|
7
|
+
data.tar.gz: c5d9a62f138d08985959bc5dc48213b311a7ea814750e24e4048d4f0c272a6f16b3d60d33ccf06eed2ac72bfd26a0d24bbc19165aa668e8bc8ace2f1f6976049
|
@@ -0,0 +1,30 @@
|
|
1
|
+
name: Test on Ubuntu
|
2
|
+
|
3
|
+
on: [push, pull_request]
|
4
|
+
|
5
|
+
jobs:
|
6
|
+
test:
|
7
|
+
runs-on: ${{ matrix.os }}
|
8
|
+
continue-on-error: ${{ matrix.experimental }}
|
9
|
+
strategy:
|
10
|
+
fail-fast: false
|
11
|
+
matrix:
|
12
|
+
ruby-version: ['3.1', '3.0', '2.7']
|
13
|
+
os: [ubuntu-latest]
|
14
|
+
experimental: [false]
|
15
|
+
include:
|
16
|
+
- ruby-version: head
|
17
|
+
os: ubuntu-latest
|
18
|
+
experimental: true
|
19
|
+
|
20
|
+
name: Test with ruby ${{ matrix.ruby-version }} on ${{ matrix.os }}
|
21
|
+
steps:
|
22
|
+
- uses: actions/checkout@v2
|
23
|
+
- name: Set up Ruby
|
24
|
+
uses: ruby/setup-ruby@v1
|
25
|
+
with:
|
26
|
+
ruby-version: ${{ matrix.ruby-version }}
|
27
|
+
- name: Install dependencies
|
28
|
+
run: bundle install
|
29
|
+
- name: Run tests
|
30
|
+
run: bundle exec rake test
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,24 @@
|
|
1
|
+
## [0.4.5] - 2022-04-27
|
2
|
+
|
3
|
+
### Fixed
|
4
|
+
|
5
|
+
* Ignore "replace:" tag in structured form
|
6
|
+
|
7
|
+
|
8
|
+
## [0.4.4] - 2022-02-26
|
9
|
+
|
10
|
+
### Fixed
|
11
|
+
|
12
|
+
* "snmp name" instead of "snmp system-name"
|
13
|
+
|
14
|
+
|
15
|
+
## [0.4.3] - 2021-09-28
|
16
|
+
|
17
|
+
### Fixed
|
18
|
+
|
19
|
+
* A Nokogiri's [security vulnerability](https://github.com/advisories/GHSA-2rr5-8q37-2w7h)
|
20
|
+
|
21
|
+
|
1
22
|
## [0.4.2] - 2021-08-30
|
2
23
|
|
3
24
|
### Added
|
data/Gemfile.lock
CHANGED
@@ -1,21 +1,21 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
junoser (0.4.
|
4
|
+
junoser (0.4.5)
|
5
5
|
parslet
|
6
6
|
|
7
7
|
GEM
|
8
8
|
remote: https://rubygems.org/
|
9
9
|
specs:
|
10
|
-
mini_portile2 (2.
|
11
|
-
nokogiri (1.
|
12
|
-
mini_portile2 (~> 2.
|
10
|
+
mini_portile2 (2.8.0)
|
11
|
+
nokogiri (1.13.4)
|
12
|
+
mini_portile2 (~> 2.8.0)
|
13
13
|
racc (~> 1.4)
|
14
14
|
parslet (2.0.0)
|
15
|
-
power_assert (2.0.
|
16
|
-
racc (1.
|
17
|
-
rake (13.0.
|
18
|
-
test-unit (3.
|
15
|
+
power_assert (2.0.1)
|
16
|
+
racc (1.6.0)
|
17
|
+
rake (13.0.6)
|
18
|
+
test-unit (3.5.3)
|
19
19
|
power_assert
|
20
20
|
|
21
21
|
PLATFORMS
|
@@ -29,4 +29,4 @@ DEPENDENCIES
|
|
29
29
|
test-unit
|
30
30
|
|
31
31
|
BUNDLED WITH
|
32
|
-
2.2.
|
32
|
+
2.2.26
|
data/LICENSE.txt
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
The MIT License (MIT)
|
2
2
|
|
3
|
-
Copyright (c) 2015-
|
3
|
+
Copyright (c) 2015-2022 Shintaro Kojima
|
4
4
|
|
5
5
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
6
|
of this software and associated documentation files (the "Software"), to deal
|
data/README.md
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# Junoser
|
2
2
|
|
3
|
-
[![
|
3
|
+
[![Test on Ubuntu](https://github.com/codeout/junoser/actions/workflows/test-linux.yaml/badge.svg)](https://github.com/codeout/junoser/actions/workflows/test-linux.yaml)
|
4
4
|
[![Code Climate](https://codeclimate.com/github/codeout/junoser.png)](https://codeclimate.com/github/codeout/junoser)
|
5
5
|
[![Inline docs](http://inch-ci.org/github/codeout/junoser.svg)](http://inch-ci.org/github/codeout/junoser)
|
6
6
|
|
@@ -103,4 +103,4 @@ Or send a pull request to fix.
|
|
103
103
|
|
104
104
|
## Copyright and License
|
105
105
|
|
106
|
-
Copyright (c) 2015-
|
106
|
+
Copyright (c) 2015-2022 Shintaro Kojima. Code released under the [MIT license](LICENSE.txt).
|
data/lib/junoser/display/set.rb
CHANGED
@@ -59,12 +59,16 @@ module Junoser
|
|
59
59
|
current_statement = ''
|
60
60
|
|
61
61
|
current_stack.each do |stack|
|
62
|
+
stack.gsub! 'replace: ', ''
|
63
|
+
|
62
64
|
if stack.gsub!('inactive: ', '')
|
63
65
|
statements << "deactivate #{current_statement}#{stack}"
|
64
66
|
end
|
65
67
|
current_statement << "#{stack} "
|
66
68
|
end
|
67
69
|
|
70
|
+
str.gsub! 'replace: ', ''
|
71
|
+
|
68
72
|
if str.gsub!('inactive: ', '')
|
69
73
|
statements << "deactivate #{current_statement}#{str}"
|
70
74
|
end
|
data/lib/junoser/js_ruler.rb
CHANGED
@@ -168,6 +168,8 @@ module Junoser
|
|
168
168
|
str.gsub! 'policy | Define a policy context from this zone', 'from-zone | Define a policy context from this zone'
|
169
169
|
# "to-zone-name | Destination zone" -> "to-zone | Destination zone"
|
170
170
|
str.gsub! 'to-zone-name | Destination zone', 'to-zone | Destination zone'
|
171
|
+
# "system-name | System name override" -> "name | System name override"
|
172
|
+
str.gsub! 'system-name | System name override', 'name | System name override'
|
171
173
|
|
172
174
|
fix_route_filter(str)
|
173
175
|
|
data/lib/junoser/parser.rb
CHANGED
@@ -8746,7 +8746,7 @@ module Junoser
|
|
8746
8746
|
).as(:oneline),
|
8747
8747
|
b(str("snmp"),
|
8748
8748
|
c(
|
8749
|
-
a(str("
|
8749
|
+
a(str("name"), quote | arg),
|
8750
8750
|
a(str("description"), quote | arg),
|
8751
8751
|
a(str("location"), quote | arg),
|
8752
8752
|
a(str("contact"), quote | arg),
|
@@ -14289,7 +14289,7 @@ module Junoser
|
|
14289
14289
|
b(str("suppress-tlv-advertisement"),
|
14290
14290
|
(str("MANAGEMENT_ADDRESS") | str("SYSTEM_CAPABILITIES") | str("SYSTEM_DESCRIPTION") | str("SYSTEM_NAME") | str("PORT_DESCRIPTION") | str("PORT_ID") | str("CHASSIS_ID"))
|
14291
14291
|
),
|
14292
|
-
a(str("
|
14292
|
+
a(str("name"), quote | arg),
|
14293
14293
|
a(str("system-description"), arg),
|
14294
14294
|
a(str("chassis-id"), arg),
|
14295
14295
|
b(str("chassis-id-type"),
|
data/lib/junoser/ruler.rb
CHANGED
@@ -221,6 +221,9 @@ module Junoser
|
|
221
221
|
str.gsub!(/"(dest|src|static)-nat-rule-match"/) { '"match"' }
|
222
222
|
|
223
223
|
str
|
224
|
+
|
225
|
+
# Fix .xsd: "snmp system-name" should be "snmp name"
|
226
|
+
str.gsub! '"system-name" arg', '"name" (quote | arg)'
|
224
227
|
end
|
225
228
|
|
226
229
|
def format(str, offset = OFFSET)
|
data/lib/junoser/version.rb
CHANGED
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.
|
4
|
+
version: 0.4.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Shintaro Kojima
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2022-04-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: parslet
|
@@ -89,8 +89,9 @@ executables:
|
|
89
89
|
extensions: []
|
90
90
|
extra_rdoc_files: []
|
91
91
|
files:
|
92
|
+
- ".github/workflows/test-linux.yaml"
|
92
93
|
- ".gitignore"
|
93
|
-
- ".
|
94
|
+
- ".pre-commit-config.yaml"
|
94
95
|
- CHANGELOG.md
|
95
96
|
- Gemfile
|
96
97
|
- Gemfile.lock
|
@@ -99,6 +100,7 @@ files:
|
|
99
100
|
- Rakefile
|
100
101
|
- bin/console
|
101
102
|
- bin/setup
|
103
|
+
- commitlint.config.js
|
102
104
|
- example/get-schema.xml
|
103
105
|
- example/junos-18.1R3-S9.rb
|
104
106
|
- example/mx-19.3R3-S1.3.rb
|