junoser 0.7.0 → 0.7.1

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: d373ec94d7ebe3053b4f01d01d54beb15b49af4e2e8fbab4b29f9641632b5715
4
- data.tar.gz: 046c510a4c5072759810abd68c8df4ce25c7cab976806182cdf0020dbd5b3f6c
3
+ metadata.gz: bd8d0023004d5b1a354481038fd124a73b1aff42b66fd0582534dbed3587acfc
4
+ data.tar.gz: 26215df72ca310d36a6b57e5e288d145c5e575ced116633e023b0d895db4546f
5
5
  SHA512:
6
- metadata.gz: c8acdf3b078ddc961ba28f3be6f9c2b3870b2f3ee85a81b7bec28fee09a390709e0783e520c67ef3b30fe87b15a317d7dcb879bdadd3d3b3d3d101a3fdb05c32
7
- data.tar.gz: 9f4ff9fda7f65b1a318dcd43858874e7823e0008028071a0a2b20c951cdbdf04b6665e521044a572fd46f34626a345d543f2df9366524f55d07cf99dbfb55064
6
+ metadata.gz: 4fb26b5d915d873942e4ae4fcff612f70664ed933353287597c74da9ecf42f68f7e6f55ce8472e64a73ae2598a77937beacfb1fc9b417b9247e4dfcbcf76904f
7
+ data.tar.gz: 534d3484149a158d384e2beaabd6a12c33cd16ef993d2ddfb90e61410b76a6dd3ef214e7894c9a2b2541effbe69f7e271b4cc7208d9bb22470efc5e16a912c99
data/CHANGELOG.md CHANGED
@@ -1,3 +1,11 @@
1
+ ## [0.7.1] - 2025-02-03
2
+
3
+ ### Added
4
+
5
+ * Newly supported syntax for vSRX
6
+ * "system services web-management http"
7
+
8
+
1
9
  ## [0.7.0] - 2024-12-19
2
10
 
3
11
  ### Added
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- junoser (0.7.0)
4
+ junoser (0.7.1)
5
5
  parslet
6
6
 
7
7
  GEM
@@ -12,7 +12,7 @@ GEM
12
12
  mini_portile2 (~> 2.8.2)
13
13
  racc (~> 1.4)
14
14
  parslet (2.0.0)
15
- power_assert (2.0.4)
15
+ power_assert (2.0.5)
16
16
  racc (1.8.1)
17
17
  rake (13.2.1)
18
18
  test-unit (3.6.7)
@@ -29,4 +29,4 @@ DEPENDENCIES
29
29
  test-unit
30
30
 
31
31
  BUNDLED WITH
32
- 2.5.16
32
+ 2.6.2
data/LICENSE.txt CHANGED
@@ -1,6 +1,6 @@
1
1
  The MIT License (MIT)
2
2
 
3
- Copyright (c) 2015-2024 Shintaro Kojima
3
+ Copyright (c) 2015-2025 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
@@ -103,4 +103,4 @@ Or send a pull request to fix.
103
103
 
104
104
  ## Copyright and License
105
105
 
106
- Copyright (c) 2015-2024 Shintaro Kojima. Code released under the [MIT license](LICENSE.txt).
106
+ Copyright (c) 2015-2025 Shintaro Kojima. Code released under the [MIT license](LICENSE.txt).
@@ -29,17 +29,20 @@ module Junoser
29
29
  # set groups
30
30
  str.gsub! /"groups" \(.*\s*s\(\s*any\s*\)\s*\)/, <<-EOS.strip
31
31
  "groups" arg ( /* Configuration groups */
32
- "when" ( /* Specify additional conditions for groups */
33
- c(
34
- "chassis" arg /* Chassis id */,
35
- "member" arg /* Member of virtual chassis */,
36
- "model" arg /* Model name */,
37
- "node" arg /* Node of cluster */,
38
- "peers" arg /* Hosts on which this group should be effective */,
39
- "routing-engine" arg /* Routing Engine */,
40
- "time" ( /* Time at which group should be effective */
41
- "to" arg /* End time([yyyy-mm-dd.]hh:mm) */,
42
- arg
32
+ c(
33
+ this.configuration({ groups: false }),
34
+ "when" ( /* Specify additional conditions for groups */
35
+ c(
36
+ "chassis" arg /* Chassis id */,
37
+ "member" arg /* Member of virtual chassis */,
38
+ "model" arg /* Model name */,
39
+ "node" arg /* Node of cluster */,
40
+ "peers" arg /* Hosts on which this group should be effective */,
41
+ "routing-engine" arg /* Routing Engine */,
42
+ "time" ( /* Time at which group should be effective */
43
+ "to" arg /* End time([yyyy-mm-dd.]hh:mm) */,
44
+ arg
45
+ )
43
46
  )
44
47
  )
45
48
  )
@@ -91,8 +94,8 @@ module Junoser
91
94
  end
92
95
 
93
96
  def process_common_syntax(str)
94
- # rule(:foo) do -> foo(...args) {
95
- str.gsub!(/^rule\(:(\S+)\) do/) { "#$1(...args) { return_next_line" }
97
+ # rule(:foo) do -> foo(opts) {
98
+ str.gsub!(/^rule\(:(\S+)\) do/) { "#$1(opts) { return_next_line" }
96
99
  # end -> }
97
100
  str.gsub!(/^(\s*)end$/) { "#$1}" }
98
101
 
@@ -167,12 +170,12 @@ module Junoser
167
170
  end
168
171
 
169
172
  def process_structural_syntax(str)
170
- # "foo" ( /* doc */ -> "foo | doc": (...args) => {
173
+ # "foo" ( /* doc */ -> "foo | doc": (opts) => {
171
174
  str.gsub!(%r|^(\s*)"(\S+)" \( /\* (.*) \*/|) { "#$1\"#$2 | #$3\": {" }
172
- # "foo" ( -> "foo": (...args) => {
175
+ # "foo" ( -> "foo": (opts) => {
173
176
  str.gsub!(%r|^(\s*)"(\S+)" \($|) { "#$1\"#$2\": {" }
174
177
 
175
- # "foo" arg ( /* doc */ -> "foo | doc": (...args) => {
178
+ # "foo" arg ( /* doc */ -> "foo | doc": (opts) => {
176
179
  str.gsub!(%r|^(\s*)"(\S+)" arg \( /\* (.*) \*/|) { "#$1\"#$2 | #$3\": {" }
177
180
 
178
181
  str
@@ -286,6 +289,8 @@ module Junoser
286
289
 
287
290
  # "arg" -> "arg_1"
288
291
  lines.gsub('"arg":') { %["arg_#{sequence}":] }
292
+
293
+ conditional_groups(lines)
289
294
  end
290
295
 
291
296
  # } -> )
@@ -349,6 +354,17 @@ module Junoser
349
354
  lines
350
355
  end
351
356
 
357
+ def conditional_groups(lines)
358
+ # "null_13264": this.configuration(false),
359
+ # ->
360
+ # (opts === undefined || opts?.configuration !== false) && { "null_13264": this.configuration(false) },
361
+ #
362
+ # ref: process_lines()
363
+ lines.gsub(/("groups\(arg\) \| .*":) {/) {
364
+ "#{$1} opts?.groups !== false && {"
365
+ }
366
+ end
367
+
352
368
  def rule_header
353
369
  <<~EOS
354
370
  /* eslint-disable semi */
@@ -86863,6 +86863,14 @@ module Junoser
86863
86863
  httpd_traceoptions_type
86864
86864
  ),
86865
86865
  a(str("management-url"), arg),
86866
+ # Ported from vSRX 18.4R1.8
86867
+ b(str("http"),
86868
+ a(str("port"), arg),
86869
+ b(str("interface"),
86870
+ interface_name
86871
+ )
86872
+ ),
86873
+ # End of vSRX 18.4R1.8
86866
86874
  b(str("https"),
86867
86875
  c(
86868
86876
  a(str("port"), arg),
@@ -86876,6 +86884,16 @@ module Junoser
86876
86884
  )
86877
86885
  )
86878
86886
  ),
86887
+ # Ported from vSRX 18.4R1.8
86888
+ b(str("http"),
86889
+ c(
86890
+ a(str("port"), arg),
86891
+ b(str("interface"),
86892
+ interface_name
86893
+ )
86894
+ )
86895
+ ),
86896
+ # End of vSRX 18.4R1.8
86879
86897
  b(str("control"),
86880
86898
  c(
86881
86899
  a(str("max-threads"), arg)
@@ -1,3 +1,3 @@
1
1
  module Junoser
2
- VERSION = "0.7.0"
2
+ VERSION = "0.7.1"
3
3
  end
metadata CHANGED
@@ -1,14 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: junoser
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.0
4
+ version: 0.7.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Shintaro Kojima
8
- autorequire:
9
8
  bindir: exe
10
9
  cert_chain: []
11
- date: 2024-12-20 00:00:00.000000000 Z
10
+ date: 2025-02-02 00:00:00.000000000 Z
12
11
  dependencies:
13
12
  - !ruby/object:Gem::Dependency
14
13
  name: parslet
@@ -141,7 +140,6 @@ files:
141
140
  homepage: https://github.com/codeout/junoser
142
141
  licenses: []
143
142
  metadata: {}
144
- post_install_message:
145
143
  rdoc_options: []
146
144
  require_paths:
147
145
  - lib
@@ -156,8 +154,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
156
154
  - !ruby/object:Gem::Version
157
155
  version: '0'
158
156
  requirements: []
159
- rubygems_version: 3.5.16
160
- signing_key:
157
+ rubygems_version: 3.6.2
161
158
  specification_version: 4
162
159
  summary: PEG parser for JUNOS configuration.
163
160
  test_files: []