oxidized-web 0.15.1 → 0.17.0

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.

Potentially problematic release.


This version of oxidized-web might be problematic. Click here for more details.

Files changed (50) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +4 -0
  3. data/.rubocop.yml +22 -2
  4. data/CHANGELOG.md +30 -1
  5. data/README.md +13 -3
  6. data/Rakefile +9 -4
  7. data/docs/configuration.md +90 -0
  8. data/docs/development.md +42 -39
  9. data/lib/oxidized/web/public/scripts/oxidized.js +13 -13
  10. data/lib/oxidized/web/public/weblibs/bootstrap-icons.css +31 -3
  11. data/lib/oxidized/web/public/weblibs/bootstrap.bundle.js +20 -19
  12. data/lib/oxidized/web/public/weblibs/bootstrap.bundle.js.map +1 -1
  13. data/lib/oxidized/web/public/weblibs/bootstrap.css +110 -124
  14. data/lib/oxidized/web/public/weblibs/bootstrap.css.map +1 -1
  15. data/lib/oxidized/web/public/weblibs/bootstrap.js +20 -17
  16. data/lib/oxidized/web/public/weblibs/bootstrap.js.map +1 -1
  17. data/lib/oxidized/web/public/weblibs/buttons.bootstrap5.css +3 -3
  18. data/lib/oxidized/web/public/weblibs/buttons.colVis.js +14 -5
  19. data/lib/oxidized/web/public/weblibs/dataTables.bootstrap5.css +111 -17
  20. data/lib/oxidized/web/public/weblibs/dataTables.buttons.js +25 -7
  21. data/lib/oxidized/web/public/weblibs/dataTables.js +336 -106
  22. data/lib/oxidized/web/public/weblibs/dayjs-plugin-utc.min.js +1 -0
  23. data/lib/oxidized/web/public/weblibs/dayjs.min.js +1 -0
  24. data/lib/oxidized/web/public/weblibs/fonts/bootstrap-icons.woff +0 -0
  25. data/lib/oxidized/web/public/weblibs/fonts/bootstrap-icons.woff2 +0 -0
  26. data/lib/oxidized/web/version.rb +1 -1
  27. data/lib/oxidized/web/views/conf_search.haml +1 -1
  28. data/lib/oxidized/web/views/diffs.haml +6 -7
  29. data/lib/oxidized/web/views/head.haml +4 -0
  30. data/lib/oxidized/web/views/node.haml +3 -2
  31. data/lib/oxidized/web/views/nodes.haml +13 -5
  32. data/lib/oxidized/web/views/stats.haml +11 -3
  33. data/lib/oxidized/web/views/version.haml +1 -2
  34. data/lib/oxidized/web/views/versions.haml +11 -7
  35. data/lib/oxidized/web/webapp.rb +41 -29
  36. data/lib/oxidized/web.rb +72 -16
  37. data/oxidized-web.gemspec +22 -13
  38. data/package-lock.json +37 -25
  39. data/package.json +7 -5
  40. data/spec/spec_helper.rb +1 -0
  41. data/spec/web/node/show_spec.rb +100 -0
  42. data/spec/web/node/version_spec.rb +161 -0
  43. data/spec/{node_spec.rb → web/node_spec.rb} +1 -1
  44. data/spec/{nodes_spec.rb → web/nodes_spec.rb} +1 -1
  45. data/spec/{root_spec.rb → web/root_spec.rb} +1 -1
  46. data/spec/{webapp_spec.rb → web/webapp_spec.rb} +1 -1
  47. data/spec/web_spec.rb +98 -0
  48. metadata +69 -69
  49. data/.rubocop_todo.yml +0 -64
  50. data/spec/node_version_spec.rb +0 -102
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: oxidized-web
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.15.1
4
+ version: 0.17.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Saku Ytti
@@ -9,22 +9,28 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2025-02-20 00:00:00.000000000 Z
12
+ date: 2025-07-18 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: charlock_holmes
16
16
  requirement: !ruby/object:Gem::Requirement
17
17
  requirements:
18
- - - "~>"
18
+ - - ">="
19
19
  - !ruby/object:Gem::Version
20
20
  version: 0.7.5
21
+ - - "<"
22
+ - !ruby/object:Gem::Version
23
+ version: 0.8.0
21
24
  type: :runtime
22
25
  prerelease: false
23
26
  version_requirements: !ruby/object:Gem::Requirement
24
27
  requirements:
25
- - - "~>"
28
+ - - ">="
26
29
  - !ruby/object:Gem::Version
27
30
  version: 0.7.5
31
+ - - "<"
32
+ - !ruby/object:Gem::Version
33
+ version: 0.8.0
28
34
  - !ruby/object:Gem::Dependency
29
35
  name: emk-sinatra-url-for
30
36
  requirement: !ruby/object:Gem::Requirement
@@ -43,114 +49,118 @@ dependencies:
43
49
  name: haml
44
50
  requirement: !ruby/object:Gem::Requirement
45
51
  requirements:
46
- - - "~>"
52
+ - - ">="
53
+ - !ruby/object:Gem::Version
54
+ version: 6.0.0
55
+ - - "<"
47
56
  - !ruby/object:Gem::Version
48
- version: '6.0'
57
+ version: 6.4.0
49
58
  type: :runtime
50
59
  prerelease: false
51
60
  version_requirements: !ruby/object:Gem::Requirement
52
61
  requirements:
53
- - - "~>"
62
+ - - ">="
54
63
  - !ruby/object:Gem::Version
55
- version: '6.0'
64
+ version: 6.0.0
65
+ - - "<"
66
+ - !ruby/object:Gem::Version
67
+ version: 6.4.0
56
68
  - !ruby/object:Gem::Dependency
57
69
  name: htmlentities
58
70
  requirement: !ruby/object:Gem::Requirement
59
71
  requirements:
60
- - - "~>"
72
+ - - ">="
61
73
  - !ruby/object:Gem::Version
62
- version: '4.3'
74
+ version: 4.3.0
75
+ - - "<"
76
+ - !ruby/object:Gem::Version
77
+ version: 4.4.0
63
78
  type: :runtime
64
79
  prerelease: false
65
80
  version_requirements: !ruby/object:Gem::Requirement
66
81
  requirements:
67
- - - "~>"
82
+ - - ">="
83
+ - !ruby/object:Gem::Version
84
+ version: 4.3.0
85
+ - - "<"
68
86
  - !ruby/object:Gem::Version
69
- version: '4.3'
87
+ version: 4.4.0
70
88
  - !ruby/object:Gem::Dependency
71
89
  name: json
72
90
  requirement: !ruby/object:Gem::Requirement
73
91
  requirements:
74
- - - "~>"
75
- - !ruby/object:Gem::Version
76
- version: '2.3'
77
- type: :runtime
78
- prerelease: false
79
- version_requirements: !ruby/object:Gem::Requirement
80
- requirements:
81
- - - "~>"
92
+ - - ">="
82
93
  - !ruby/object:Gem::Version
83
- version: '2.3'
84
- - !ruby/object:Gem::Dependency
85
- name: ostruct
86
- requirement: !ruby/object:Gem::Requirement
87
- requirements:
88
- - - "~>"
94
+ version: 2.3.0
95
+ - - "<"
89
96
  - !ruby/object:Gem::Version
90
- version: '0.6'
97
+ version: 2.14.0
91
98
  type: :runtime
92
99
  prerelease: false
93
100
  version_requirements: !ruby/object:Gem::Requirement
94
101
  requirements:
95
- - - "~>"
102
+ - - ">="
96
103
  - !ruby/object:Gem::Version
97
- version: '0.6'
104
+ version: 2.3.0
105
+ - - "<"
106
+ - !ruby/object:Gem::Version
107
+ version: 2.14.0
98
108
  - !ruby/object:Gem::Dependency
99
109
  name: oxidized
100
110
  requirement: !ruby/object:Gem::Requirement
101
111
  requirements:
102
112
  - - "~>"
103
113
  - !ruby/object:Gem::Version
104
- version: '0.31'
114
+ version: 0.34.0
105
115
  type: :runtime
106
116
  prerelease: false
107
117
  version_requirements: !ruby/object:Gem::Requirement
108
118
  requirements:
109
119
  - - "~>"
110
120
  - !ruby/object:Gem::Version
111
- version: '0.31'
121
+ version: 0.34.0
112
122
  - !ruby/object:Gem::Dependency
113
123
  name: puma
114
124
  requirement: !ruby/object:Gem::Requirement
115
125
  requirements:
116
- - - ">="
126
+ - - "~>"
117
127
  - !ruby/object:Gem::Version
118
- version: 3.11.4
128
+ version: 6.6.0
119
129
  type: :runtime
120
130
  prerelease: false
121
131
  version_requirements: !ruby/object:Gem::Requirement
122
132
  requirements:
123
- - - ">="
133
+ - - "~>"
124
134
  - !ruby/object:Gem::Version
125
- version: 3.11.4
135
+ version: 6.6.0
126
136
  - !ruby/object:Gem::Dependency
127
137
  name: sinatra
128
138
  requirement: !ruby/object:Gem::Requirement
129
139
  requirements:
130
- - - ">="
140
+ - - "~>"
131
141
  - !ruby/object:Gem::Version
132
- version: 1.4.6
142
+ version: 4.1.1
133
143
  type: :runtime
134
144
  prerelease: false
135
145
  version_requirements: !ruby/object:Gem::Requirement
136
146
  requirements:
137
- - - ">="
147
+ - - "~>"
138
148
  - !ruby/object:Gem::Version
139
- version: 1.4.6
149
+ version: 4.1.1
140
150
  - !ruby/object:Gem::Dependency
141
151
  name: sinatra-contrib
142
152
  requirement: !ruby/object:Gem::Requirement
143
153
  requirements:
144
- - - ">="
154
+ - - "~>"
145
155
  - !ruby/object:Gem::Version
146
- version: 1.4.6
156
+ version: 4.1.1
147
157
  type: :runtime
148
158
  prerelease: false
149
159
  version_requirements: !ruby/object:Gem::Requirement
150
160
  requirements:
151
- - - ">="
161
+ - - "~>"
152
162
  - !ruby/object:Gem::Version
153
- version: 1.4.6
163
+ version: 4.1.1
154
164
  - !ruby/object:Gem::Dependency
155
165
  name: bundler
156
166
  requirement: !ruby/object:Gem::Requirement
@@ -241,42 +251,42 @@ dependencies:
241
251
  requirements:
242
252
  - - "~>"
243
253
  - !ruby/object:Gem::Version
244
- version: 1.72.1
254
+ version: 1.78.0
245
255
  type: :development
246
256
  prerelease: false
247
257
  version_requirements: !ruby/object:Gem::Requirement
248
258
  requirements:
249
259
  - - "~>"
250
260
  - !ruby/object:Gem::Version
251
- version: 1.72.1
261
+ version: 1.78.0
252
262
  - !ruby/object:Gem::Dependency
253
263
  name: rubocop-minitest
254
264
  requirement: !ruby/object:Gem::Requirement
255
265
  requirements:
256
266
  - - "~>"
257
267
  - !ruby/object:Gem::Version
258
- version: 0.37.1
268
+ version: 0.38.0
259
269
  type: :development
260
270
  prerelease: false
261
271
  version_requirements: !ruby/object:Gem::Requirement
262
272
  requirements:
263
273
  - - "~>"
264
274
  - !ruby/object:Gem::Version
265
- version: 0.37.1
275
+ version: 0.38.0
266
276
  - !ruby/object:Gem::Dependency
267
277
  name: rubocop-rails
268
278
  requirement: !ruby/object:Gem::Requirement
269
279
  requirements:
270
280
  - - "~>"
271
281
  - !ruby/object:Gem::Version
272
- version: 2.30.0
282
+ version: 2.32.0
273
283
  type: :development
274
284
  prerelease: false
275
285
  version_requirements: !ruby/object:Gem::Requirement
276
286
  requirements:
277
287
  - - "~>"
278
288
  - !ruby/object:Gem::Version
279
- version: 2.30.0
289
+ version: 2.32.0
280
290
  - !ruby/object:Gem::Dependency
281
291
  name: rubocop-rake
282
292
  requirement: !ruby/object:Gem::Requirement
@@ -305,20 +315,6 @@ dependencies:
305
315
  - - "~>"
306
316
  - !ruby/object:Gem::Version
307
317
  version: 0.22.0
308
- - !ruby/object:Gem::Dependency
309
- name: simplecov-cobertura
310
- requirement: !ruby/object:Gem::Requirement
311
- requirements:
312
- - - "~>"
313
- - !ruby/object:Gem::Version
314
- version: 2.1.0
315
- type: :development
316
- prerelease: false
317
- version_requirements: !ruby/object:Gem::Requirement
318
- requirements:
319
- - - "~>"
320
- - !ruby/object:Gem::Version
321
- version: 2.1.0
322
318
  - !ruby/object:Gem::Dependency
323
319
  name: simplecov-html
324
320
  requirement: !ruby/object:Gem::Requirement
@@ -349,12 +345,12 @@ files:
349
345
  - ".github/workflows/stale.yml"
350
346
  - ".gitignore"
351
347
  - ".rubocop.yml"
352
- - ".rubocop_todo.yml"
353
348
  - ".travis.yml"
354
349
  - CHANGELOG.md
355
350
  - Gemfile
356
351
  - README.md
357
352
  - Rakefile
353
+ - docs/configuration.md
358
354
  - docs/development.md
359
355
  - lib/oxidized/web.rb
360
356
  - lib/oxidized/web/public/css/oxidized.css
@@ -376,6 +372,8 @@ files:
376
372
  - lib/oxidized/web/public/weblibs/dataTables.bootstrap5.js
377
373
  - lib/oxidized/web/public/weblibs/dataTables.buttons.js
378
374
  - lib/oxidized/web/public/weblibs/dataTables.js
375
+ - lib/oxidized/web/public/weblibs/dayjs-plugin-utc.min.js
376
+ - lib/oxidized/web/public/weblibs/dayjs.min.js
379
377
  - lib/oxidized/web/public/weblibs/fonts/bootstrap-icons.woff
380
378
  - lib/oxidized/web/public/weblibs/fonts/bootstrap-icons.woff2
381
379
  - lib/oxidized/web/public/weblibs/jquery.js
@@ -394,12 +392,14 @@ files:
394
392
  - oxidized-web.gemspec
395
393
  - package-lock.json
396
394
  - package.json
397
- - spec/node_spec.rb
398
- - spec/node_version_spec.rb
399
- - spec/nodes_spec.rb
400
- - spec/root_spec.rb
401
395
  - spec/spec_helper.rb
402
- - spec/webapp_spec.rb
396
+ - spec/web/node/show_spec.rb
397
+ - spec/web/node/version_spec.rb
398
+ - spec/web/node_spec.rb
399
+ - spec/web/nodes_spec.rb
400
+ - spec/web/root_spec.rb
401
+ - spec/web/webapp_spec.rb
402
+ - spec/web_spec.rb
403
403
  homepage: http://github.com/ytti/oxidized-web
404
404
  licenses:
405
405
  - Apache-2.0
data/.rubocop_todo.yml DELETED
@@ -1,64 +0,0 @@
1
- # This configuration was generated by
2
- # `rubocop --auto-gen-config`
3
- # on 2025-02-20 10:05:16 UTC using RuboCop version 1.72.2.
4
- # The point is for the user to remove these configuration records
5
- # one by one as the offenses are removed from the code base.
6
- # Note that changes in the inspected code, or installation of new
7
- # versions of RuboCop, may require this file to be generated again.
8
-
9
- # Offense count: 2
10
- # Configuration parameters: AllowedMethods, AllowedPatterns, CountRepeatedAttributes.
11
- Metrics/AbcSize:
12
- Max: 31
13
-
14
- # Offense count: 1
15
- # Configuration parameters: AllowedMethods, AllowedPatterns.
16
- Metrics/CyclomaticComplexity:
17
- Max: 9
18
-
19
- # Offense count: 5
20
- # Configuration parameters: CountComments, CountAsOne, AllowedMethods, AllowedPatterns.
21
- Metrics/MethodLength:
22
- Max: 28
23
-
24
- # Offense count: 1
25
- # Configuration parameters: AllowedMethods, AllowedPatterns.
26
- Metrics/PerceivedComplexity:
27
- Max: 11
28
-
29
- # Offense count: 1
30
- # Configuration parameters: Include.
31
- # Include: app/**/*.rb, config/**/*.rb, lib/**/*.rb
32
- Rails/Exit:
33
- Exclude:
34
- - 'lib/oxidized/web.rb'
35
-
36
- # Offense count: 7
37
- # This cop supports unsafe autocorrection (--autocorrect-all).
38
- # Configuration parameters: Include.
39
- # Include: **/Rakefile, **/*.rake
40
- Rails/RakeEnvironment:
41
- Exclude:
42
- - 'Rakefile'
43
-
44
- # Offense count: 1
45
- # This cop supports safe autocorrection (--autocorrect).
46
- Rake/Desc:
47
- Exclude:
48
- - 'Rakefile'
49
-
50
- # Offense count: 2
51
- Rake/DuplicateTask:
52
- Exclude:
53
- - 'Rakefile'
54
-
55
- # Offense count: 1
56
- Security/Eval:
57
- Exclude:
58
- - 'Rakefile'
59
-
60
- # Offense count: 1
61
- # This cop supports unsafe autocorrection (--autocorrect-all).
62
- Security/JSONLoad:
63
- Exclude:
64
- - 'lib/oxidized/web/webapp.rb'
@@ -1,102 +0,0 @@
1
- require_relative 'spec_helper'
2
-
3
- describe Oxidized::API::WebApp do
4
- include Rack::Test::Methods
5
-
6
- def app
7
- Oxidized::API::WebApp
8
- end
9
-
10
- before do
11
- @nodes = mock('Oxidized::Nodes')
12
- app.set(:nodes, @nodes)
13
- end
14
-
15
- describe '/node/version.?:format?' do
16
- it 'fetches all versions of a node without a group' do
17
- @nodes.expects(:version).with('sw5', nil).returns(
18
- [{ oid: "C006", date: "2025-02-05 19:49:00 +0100" },
19
- { oid: "C003", date: "2025-02-05 19:03:00 +0100" },
20
- { oid: "C001", date: "2025-02-05 19:01:00 +0100" }]
21
- )
22
-
23
- get '/node/version?node_full=sw5'
24
- _(last_response.ok?).must_equal true
25
- _(last_response.body.include?(
26
- "<tr>\n<td>3</td>\n<td>2025-02-05 19:49:00 +0100</td>\n"
27
- )).must_equal true
28
- end
29
-
30
- it 'fetches all versions of a node with a group' do
31
- @nodes.expects(:version).with('sw5', 'group1').returns(
32
- [{ oid: "C006", date: "2025-02-05 19:49:00 +0100" },
33
- { oid: "C003", date: "2025-02-05 19:03:00 +0100" },
34
- { oid: "C001", date: "2025-02-05 19:01:00 +0100" }]
35
- )
36
-
37
- get '/node/version?node_full=group1/sw5'
38
- _(last_response.ok?).must_equal true
39
- _(last_response.body.include?(
40
- "<tr>\n<td>3</td>\n<td>2025-02-05 19:49:00 +0100</td>\n"
41
- )).must_equal true
42
- end
43
-
44
- it 'fetches all versions of a node with a group with /' do
45
- @nodes.expects(:version).with('sw5', 'gr/oup1').returns(
46
- [{ oid: "C006", date: "2025-02-05 19:49:00 +0100" },
47
- { oid: "C003", date: "2025-02-05 19:03:00 +0100" },
48
- { oid: "C001", date: "2025-02-05 19:01:00 +0100" }]
49
- )
50
-
51
- get '/node/version?node_full=gr/oup1/sw5'
52
- _(last_response.ok?).must_equal true
53
- _(last_response.body.include?(
54
- "<tr>\n<td>3</td>\n<td>2025-02-05 19:49:00 +0100</td>\n"
55
- )).must_equal true
56
- end
57
- end
58
-
59
- describe '/node/version/view.?:format?' do
60
- it 'fetches a previous version from git' do
61
- @nodes.expects(:get_version).with('sw5', '', 'c8aa93cab5').returns('Old configuration of sw5')
62
-
63
- get '/node/version/view?node=sw5&group=&oid=c8aa93cab5&date=2024-06-07 08:27:37 +0200&num=2'
64
- _(last_response.ok?).must_equal true
65
- _(last_response.body.include?('Old configuration of sw5')).must_equal true
66
- end
67
-
68
- it 'does not display binary content' do
69
- @nodes.expects(:get_version).with('sw5', '', 'c8aa93cab5').returns("\xff\x42 binary content\x00")
70
-
71
- get '/node/version/view?node=sw5&group=&oid=c8aa93cab5&date=2024-06-07 08:27:37 +0200&num=2'
72
- _(last_response.ok?).must_equal true
73
- _(last_response.body.include?('cannot display')).must_equal true
74
- end
75
-
76
- it 'fetches a git-version when using a group containing /' do
77
- @nodes.expects(:get_version).with('sw5', 'my/group', 'c8aa93cab5').returns('Old configuration of sw5')
78
-
79
- get '/node/version/view?node=sw5&group=my/group&oid=c8aa93cab5&date=2024-06-07 08:27:37 +0200&num=2'
80
- _(last_response.ok?).must_equal true
81
- _(last_response.body.include?('Old configuration of sw5')).must_equal true
82
- end
83
-
84
- it 'does not encode html-chars in text-format' do
85
- configuration = "text &/<> \n ascii;"
86
- @nodes.expects(:get_version).with('sw5', '', 'c8aa93cab5').returns(configuration)
87
- get '/node/version/view?node=sw5&group=&oid=c8aa93cab5&date=2024-06-07 08:27:37 +0200&num=2&format=text'
88
-
89
- _(last_response.ok?).must_equal true
90
- _(last_response.body).must_equal configuration
91
- end
92
-
93
- it 'does not encode html-chars in json-format' do
94
- configuration = "text &/<> \n ascii;"
95
- @nodes.expects(:get_version).with('sw5', '', 'c8aa93cab5').returns(configuration)
96
- get '/node/version/view?node=sw5&group=&oid=c8aa93cab5&date=2024-06-07 08:27:37 +0200&num=2&format=json'
97
-
98
- _(last_response.ok?).must_equal true
99
- _(last_response.body).must_equal '["text &/<> \n"," ascii;"]'
100
- end
101
- end
102
- end