junoser 0.5.6 → 0.6.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 4881a7d03899a61a155ba962e077a6ca784a6ca254ff526d58942e4d106156b8
4
- data.tar.gz: bbe11bdff5a203610c548add8633484c799053dd6195f8e247eade567bb2e8a1
3
+ metadata.gz: a73208784003b23a9dc996cf06ef4941a3da1ad35143848885c3e37a0e921e84
4
+ data.tar.gz: ae1ded9c7e208d3af98a96cf4c9fe5839b51d79447f1921fb36807f4202017ad
5
5
  SHA512:
6
- metadata.gz: 86cf2a739b40ce9254fd610b289af47734e21bd960b0687cc612c4765bd2e4e29241e39e6505a3902bd1c47cb5fea579ed047d9b3de850691407c644e8babdf3
7
- data.tar.gz: b850d666c030f79dcbd5c5b269b7a411ab214c607efb3600c6170f8b417772887d2a5b0767adbce90d3d09387a5e122af45818e5a717056346c1d095585e0389
6
+ metadata.gz: 8ac8d0ca12b3dada5bea555115c5ac172cc7dd3123c3fb5b85ab01e7f7e116daed5b2e9faebfc6237569719ad363c182522359a0cb1d1f1892f3bb85cfb5cc47
7
+ data.tar.gz: c37c95e729cdbf60a517845c0561c80b5bbb6e43f5b1dfd0c6ed8a8f49e431028c12ffb6dd0b081e8ce15ce829af599e246635a60df8d7f528d567835271e154
@@ -0,0 +1,6 @@
1
+ version: 2
2
+ updates:
3
+ - package-ecosystem: "github-actions"
4
+ directory: "/"
5
+ schedule:
6
+ interval: "weekly"
@@ -9,7 +9,7 @@ jobs:
9
9
  strategy:
10
10
  fail-fast: false
11
11
  matrix:
12
- ruby-version: ['3.2', '3.1', '3.0']
12
+ ruby-version: ['3.3', '3.2', '3.1']
13
13
  os: [ubuntu-latest]
14
14
  experimental: [false]
15
15
  include:
@@ -19,7 +19,7 @@ jobs:
19
19
 
20
20
  name: Test with ruby ${{ matrix.ruby-version }} on ${{ matrix.os }}
21
21
  steps:
22
- - uses: actions/checkout@v2
22
+ - uses: actions/checkout@v4
23
23
  - name: Set up Ruby
24
24
  uses: ruby/setup-ruby@v1
25
25
  with:
data/CHANGELOG.md CHANGED
@@ -1,3 +1,17 @@
1
+ ## [0.6.0] - 2024-09-15
2
+
3
+ ### Added
4
+
5
+ * Update vSRX syntax to 22.4R1.10
6
+ * "security"
7
+ * "chassis cluster"
8
+ * Newly supported syntax
9
+ * "interfaces xxx enable"
10
+ * "interfaces xxx unit xxx enable"
11
+ * Rake task
12
+ * `rule:tree` to show the dependency tree of rules
13
+
14
+
1
15
  ## [0.5.6] - 2024-05-01
2
16
 
3
17
  ### Fixed
data/Gemfile.lock CHANGED
@@ -1,19 +1,19 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- junoser (0.5.6)
4
+ junoser (0.6.0)
5
5
  parslet
6
6
 
7
7
  GEM
8
8
  remote: https://rubygems.org/
9
9
  specs:
10
- mini_portile2 (2.8.6)
11
- nokogiri (1.16.4)
10
+ mini_portile2 (2.8.7)
11
+ nokogiri (1.16.7)
12
12
  mini_portile2 (~> 2.8.2)
13
13
  racc (~> 1.4)
14
14
  parslet (2.0.0)
15
15
  power_assert (2.0.3)
16
- racc (1.7.3)
16
+ racc (1.8.1)
17
17
  rake (13.2.1)
18
18
  test-unit (3.6.2)
19
19
  power_assert
@@ -29,4 +29,4 @@ DEPENDENCIES
29
29
  test-unit
30
30
 
31
31
  BUNDLED WITH
32
- 2.4.1
32
+ 2.5.9
data/Rakefile CHANGED
@@ -20,7 +20,7 @@ def open_files(input, output, &block)
20
20
  end
21
21
 
22
22
  def move_wildcards(element)
23
- ['ipaddr', 'ipv6addr', 'ipprefix'].each do |pattern|
23
+ %w[ipaddr ipv6addr ipprefix].each do |pattern|
24
24
  element.xpath(%[.//xsd:element[@type="#{pattern}"]/xsd:annotation/xsd:appinfo/flag[text()="nokeyword"]/../../..]).each do |wildcard|
25
25
  parent = wildcard.parent
26
26
  removed = wildcard.remove
@@ -60,12 +60,24 @@ task 'find-srx-methods' do
60
60
  vmx = File.read('lib/junoser/parser.rb')
61
61
 
62
62
  vsrx.scan(/^ +([0-9a-z_]+) *$/).flatten.uniq.sort.each do |method|
63
- next if ['arg', 'end', 'ipaddr', 'time'].include?(method)
63
+ next if %w[arg end ipaddr time].include?(method)
64
64
 
65
65
  puts method unless vsrx =~ /rule\(:#{method}\)/m || vmx =~ /rule\(:#{method}\)/m
66
66
  end
67
67
  end
68
68
 
69
+ namespace :rule do
70
+ desc 'Show rule tree'
71
+ task :tree, [:path] do |_, args|
72
+ if args.path
73
+ raise "File not found: #{args.path}" unless File.exist?(args.path)
74
+ Junoser::RuleTree::Parser.new(File.read(args.path)).print
75
+ else
76
+ Junoser::RuleTree::Parser.new($stdin.read).print
77
+ end
78
+ end
79
+ end
80
+
69
81
  Rake::TestTask.new do |t|
70
82
  t.libs << 'test'
71
83
 
@@ -2,3 +2,4 @@ require 'underscorable'
2
2
  require 'junoser/xsd/parsable'
3
3
  require 'junoser/ruler'
4
4
  require 'junoser/js_ruler'
5
+ require 'junoser/rule_tree'
@@ -226,6 +226,11 @@ module Junoser
226
226
  "#{$1}\n arg.as(:arg) (\n#{$2}\n )\nend"
227
227
  end
228
228
 
229
+ # set interfaces xxx enable
230
+ str.gsub!(/^(rule\(:interfaces_type\) do\s*[^\n]*\s*c\()(\s*)/m) do
231
+ %[#{$1}#{$2}"enable",#{$2}]
232
+ end
233
+
229
234
  str
230
235
  end
231
236