intranet-core 2.4.4 → 2.5.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.
- checksums.yaml +4 -4
- data/lib/core_extensions.rb +0 -2
- data/lib/intranet/core/builder.rb +1 -1
- data/lib/intranet/core/haml_wrapper.rb +5 -2
- data/lib/intranet/core/version.rb +1 -1
- data/lib/intranet/resources/www/style.css +218 -186
- data/spec/core_extensions/tree_spec.rb +23 -22
- data/spec/intranet/core_spec.rb +1 -1
- data/spec/intranet/logger_spec.rb +2 -2
- data/spec/spec_helper.rb +6 -8
- metadata +10 -82
- data/lib/core_extensions/hash.rb +0 -15
- data/spec/core_extensions/hash_spec.rb +0 -22
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 52720bc4f42a0b189acf93bf2ac5662f39275134dc49bf28dffcbf1742973021
|
4
|
+
data.tar.gz: 5ba6ae21299d28aa4e084f1b0fc1722c5426c15920191b231db57a56a89f17c3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 896244e42cfeab47b4c1c75ff500c665434a8cfaa01b4a3fcc8f2d8d1e637f316045a23db09bf9feab62da1735cc22cfd73379a3afcef417acaaf3b9e451f56a
|
7
|
+
data.tar.gz: e85e189dbd1f2d31977fcabc51dd896ef39094645b46b2d66d3b8546aebb0cec756177b82f1cffa78cf27d37c247a495e8b7477d74b33cfae11631893a3a9495
|
data/lib/core_extensions.rb
CHANGED
@@ -1,11 +1,9 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require_relative 'core_extensions/hash'
|
4
3
|
require_relative 'core_extensions/string'
|
5
4
|
require_relative 'core_extensions/tree'
|
6
5
|
require_relative 'core_extensions/webrick/httpresponse'
|
7
6
|
|
8
|
-
Hash.include CoreExtensions::Hash
|
9
7
|
String.include CoreExtensions::String
|
10
8
|
WEBrick::HTTPResponse.include CoreExtensions::WEBrick::HTTPResponse
|
11
9
|
|
@@ -100,7 +100,7 @@ module Intranet
|
|
100
100
|
def get_responder(path)
|
101
101
|
parsed_path = []
|
102
102
|
current_treenode = @responders
|
103
|
-
unparsed_path = path[1
|
103
|
+
unparsed_path = path[1..].split('/').delete_if do |part|
|
104
104
|
if current_treenode.child_exists?(part)
|
105
105
|
current_treenode = current_treenode.child_node(part)
|
106
106
|
parsed_path << part
|
@@ -38,8 +38,11 @@ module Intranet
|
|
38
38
|
# @param content [Hash] The additional content required to generate the HTML/XML.
|
39
39
|
# @return [String] The HTML/XML content.
|
40
40
|
def to_markup(template, content = {})
|
41
|
-
|
42
|
-
Haml::
|
41
|
+
opts = { escape_html: false }
|
42
|
+
engine = Haml::Template.new(opts) do
|
43
|
+
File.read(find_template(template))
|
44
|
+
end
|
45
|
+
engine.render(self, content)
|
43
46
|
rescue Errno::ENOENT # template file does not exists
|
44
47
|
''
|
45
48
|
end
|
@@ -6,264 +6,300 @@
|
|
6
6
|
/***************************************** External Fonts *****************************************/
|
7
7
|
|
8
8
|
@font-face {
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
9
|
+
font-family: "Source Sans Pro";
|
10
|
+
font-style: normal;
|
11
|
+
font-weight: 300;
|
12
|
+
src: url("fonts/SourceSansPro.woff2") format("woff2");
|
13
|
+
unicode-range: U+0-FF, U+131, U+152-153, U+2C6, U+2DA, U+2DC, U+2000-206F, U+2074, U+20AC, U+2212, U+2215;
|
14
14
|
}
|
15
15
|
|
16
16
|
/***************************************** General design *****************************************/
|
17
17
|
|
18
18
|
body, html {
|
19
|
-
|
20
|
-
|
21
|
-
|
19
|
+
padding: 0px;
|
20
|
+
margin: 0px;
|
21
|
+
height: 100%;
|
22
22
|
}
|
23
23
|
body {
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
24
|
+
background: #f7f8fa;
|
25
|
+
font-family: "Source Sans Pro", Cantarell, sans-serif;
|
26
|
+
color: black;
|
27
|
+
font-size: 1.0rem;
|
28
|
+
-moz-text-size-adjust: none;
|
29
|
+
-webkit-text-size-adjust: none;
|
30
|
+
-ms-text-size-adjust: none;
|
31
|
+
font-size-adjust: none;
|
32
|
+
}
|
33
|
+
|
34
|
+
h1 {
|
35
|
+
font-size: 2.25em;
|
36
|
+
text-align: center;
|
37
|
+
margin: 1.5em 0px 2em; /* top sides bottom */
|
38
|
+
}
|
39
|
+
|
40
|
+
h2 {
|
41
|
+
font-size: 2em;
|
42
|
+
text-align: center;
|
43
|
+
margin: 1.5em 0px 2em; /* top sides bottom */
|
44
|
+
}
|
45
|
+
|
46
|
+
h3 {
|
47
|
+
font-size: 1.3em;
|
48
|
+
margin: 3em 0px 1em; /* top sides bottom */
|
49
|
+
}
|
50
|
+
|
51
|
+
h4 {
|
52
|
+
font-size: 1.1em;
|
53
|
+
margin: 1em 0px 1em;
|
54
|
+
}
|
55
|
+
|
56
|
+
blockquote {
|
57
|
+
border-left: 1px solid #d0d0d0;
|
58
|
+
padding-left: 1em;
|
59
|
+
margin: 2em 0px; /* top/bottom sides */
|
60
|
+
}
|
61
|
+
|
62
|
+
p {
|
63
|
+
text-align: justify;
|
64
|
+
}
|
65
|
+
p.right {
|
66
|
+
text-align: right;
|
67
|
+
}
|
68
|
+
|
69
|
+
hr {
|
70
|
+
height: 2px;
|
71
|
+
border: 0px;
|
72
|
+
background: #1e262b;
|
73
|
+
margin: 3em 0px /* top/bottom sides */
|
74
|
+
}
|
75
|
+
|
76
|
+
dt {
|
77
|
+
font-weight: bold;
|
78
|
+
}
|
79
|
+
dd {
|
80
|
+
margin: 0px 0px 1em 2em; /* top right bottom left */
|
81
|
+
}
|
82
|
+
dd:last-child {
|
83
|
+
margin-bottom: 0px;
|
32
84
|
}
|
33
85
|
|
34
86
|
a {
|
35
|
-
|
36
|
-
|
37
|
-
|
87
|
+
color: #6a81aa;
|
88
|
+
text-decoration: inherit;
|
89
|
+
cursor: pointer;
|
38
90
|
}
|
39
91
|
|
40
92
|
/******************************************* Navigation *******************************************/
|
41
93
|
|
42
94
|
body > header {
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
95
|
+
position: fixed;
|
96
|
+
top: 0px;
|
97
|
+
width: 100%;
|
98
|
+
margin: auto;
|
99
|
+
background-color: #1e262b;
|
100
|
+
color: white;
|
101
|
+
z-index: 10;
|
50
102
|
}
|
51
103
|
body > header h1 {
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
104
|
+
float: left;
|
105
|
+
font-weight: 500;
|
106
|
+
margin: 0px;
|
107
|
+
padding: 5px 20px 8px; /* top sides bottom */
|
108
|
+
}
|
109
|
+
body > header a {
|
110
|
+
color: inherit;
|
57
111
|
}
|
58
112
|
body > header nav {
|
59
|
-
|
60
|
-
|
113
|
+
float: right;
|
114
|
+
padding: 0px 20px;
|
61
115
|
}
|
62
116
|
body > header nav ul {
|
63
|
-
|
64
|
-
|
117
|
+
margin: 0px;
|
118
|
+
padding: 0px;
|
65
119
|
}
|
66
120
|
body > header nav > ul > li {
|
67
|
-
|
121
|
+
display: inline-block;
|
68
122
|
}
|
69
123
|
body > header nav > ul > li a {
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
124
|
+
display: block;
|
125
|
+
padding: 16px 20px;
|
126
|
+
margin: 0px;
|
127
|
+
font-size: 1.25em;
|
128
|
+
color: rgba(255, 255, 255, 0.7);
|
75
129
|
}
|
76
130
|
body > header nav > ul > li a:hover {
|
77
|
-
|
131
|
+
color: rgba(255, 255, 255, 1.0);
|
78
132
|
}
|
79
133
|
|
80
134
|
/* dropdown menus */
|
81
135
|
body > header nav > ul > li > ul {
|
82
|
-
|
83
|
-
|
84
|
-
|
136
|
+
display: none;
|
137
|
+
background-color: #1e262b;
|
138
|
+
position: absolute;
|
85
139
|
}
|
86
140
|
body > header nav > ul > li > ul > li {
|
87
|
-
|
141
|
+
display: block;
|
88
142
|
}
|
89
143
|
body > header nav > ul > li > ul > li a {
|
90
|
-
|
144
|
+
padding: 8px 20px;
|
91
145
|
}
|
92
146
|
body > header nav > ul > li:hover > ul, body > header nav > ul > li:active > ul {
|
93
|
-
|
147
|
+
display: block;
|
94
148
|
}
|
95
149
|
|
96
150
|
body > header a#openmenu, body > header a#closemenu {
|
97
|
-
|
151
|
+
display: none;
|
98
152
|
}
|
99
153
|
|
100
154
|
/* Mobile devices only */
|
101
155
|
@media only screen and (max-width: 600px), only screen and (max-device-width: 600px) {
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
padding: 10px 100px 10px 90px; /* top right bottom left */
|
152
|
-
}
|
156
|
+
body > header a#openmenu {
|
157
|
+
display: block;
|
158
|
+
position: absolute;
|
159
|
+
top: 12%;
|
160
|
+
left: 20px;
|
161
|
+
font-size: 2em;
|
162
|
+
font-weight: bold;
|
163
|
+
}
|
164
|
+
body > header nav a#closemenu {
|
165
|
+
display: block;
|
166
|
+
font-size: 2.5em;
|
167
|
+
font-weight: bold;
|
168
|
+
text-align: right;
|
169
|
+
margin-right: 0.5em;
|
170
|
+
}
|
171
|
+
body > header h1 {
|
172
|
+
float: none;
|
173
|
+
text-align: center;
|
174
|
+
}
|
175
|
+
body > header nav {
|
176
|
+
position: fixed;
|
177
|
+
top: 0;
|
178
|
+
left: 0;
|
179
|
+
height: 100%;
|
180
|
+
padding: 0;
|
181
|
+
z-index: 20;
|
182
|
+
background: inherit;
|
183
|
+
font-size: 1.25em;
|
184
|
+
overflow-y: scroll;
|
185
|
+
width: 0;
|
186
|
+
max-width: 100%;
|
187
|
+
}
|
188
|
+
body > header nav > ul {
|
189
|
+
height: auto;
|
190
|
+
}
|
191
|
+
body > header nav > ul > li {
|
192
|
+
display: block;
|
193
|
+
}
|
194
|
+
body > header nav > ul > li a {
|
195
|
+
padding: 10px 150px 10px 40px; /* top right bottom left */
|
196
|
+
}
|
197
|
+
body > header nav > ul > li > ul {
|
198
|
+
display: block;
|
199
|
+
position: static; /* reset absolute positionning */
|
200
|
+
}
|
201
|
+
body > header nav > ul > li > ul > li a {
|
202
|
+
margin: 0px;
|
203
|
+
padding: 10px 100px 10px 90px; /* top right bottom left */
|
204
|
+
}
|
153
205
|
}
|
154
206
|
|
155
207
|
/* breadcrumb navigation menu */
|
156
208
|
ul.breadcrumb {
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
209
|
+
list-style: none;
|
210
|
+
padding: 0px;
|
211
|
+
font-size: 0.9em;
|
212
|
+
margin-bottom: 1.5em;
|
161
213
|
}
|
162
214
|
ul.breadcrumb li {
|
163
|
-
|
215
|
+
display: inline;
|
164
216
|
}
|
165
217
|
ul.breadcrumb li+li:before {
|
166
|
-
|
167
|
-
|
168
|
-
}
|
169
|
-
main a {
|
170
|
-
color: #748ea3;
|
218
|
+
padding: 4px;
|
219
|
+
content: "/\00a0";
|
171
220
|
}
|
172
221
|
|
173
222
|
/* Mobile devices only */
|
174
223
|
@media only screen and (max-width: 600px), only screen and (max-device-width: 600px) {
|
175
|
-
|
176
|
-
|
177
|
-
|
224
|
+
ul.breadcrumb {
|
225
|
+
display: none;
|
226
|
+
}
|
178
227
|
}
|
179
228
|
|
180
229
|
/****************************************** Main content ******************************************/
|
181
230
|
|
182
231
|
body > main {
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
}
|
189
|
-
|
190
|
-
body > main hr {
|
191
|
-
height: 2px;
|
192
|
-
border: 0px;
|
193
|
-
background: #1e262b;
|
194
|
-
margin-top: 3em;
|
195
|
-
margin-bottom: 3em;
|
232
|
+
padding: 58px 0px; /* height of the navigation bar */
|
233
|
+
width: 85%;
|
234
|
+
max-width: 1366px;
|
235
|
+
margin: auto;
|
236
|
+
min-height: calc(100vh - 2*58px - 66px); /* 2*height of nav bar + height of footer */
|
196
237
|
}
|
197
238
|
|
198
239
|
/* Mobile devices only */
|
199
240
|
@media only screen and (max-width: 600px), only screen and (max-device-width: 600px) {
|
200
|
-
|
201
|
-
|
202
|
-
|
203
|
-
}
|
204
|
-
|
205
|
-
body > main section h2 {
|
206
|
-
font-size: 2em;
|
207
|
-
text-align: center;
|
208
|
-
margin: 50px 0px 2em; /* top sides bottom */
|
209
|
-
}
|
210
|
-
body > main article h2 {
|
211
|
-
margin-bottom: 40px;
|
212
|
-
}
|
213
|
-
body > main section h3 {
|
214
|
-
font-size: 1.17em;
|
215
|
-
margin: 3em 0px 1em; /* top sides bottom */
|
241
|
+
body > main section, body > main hr, body > footer p {
|
242
|
+
width: 100%;
|
243
|
+
margin: auto;
|
244
|
+
}
|
216
245
|
}
|
217
246
|
|
218
247
|
body > main div.loading {
|
219
|
-
|
220
|
-
|
221
|
-
|
222
|
-
|
223
|
-
|
224
|
-
|
225
|
-
|
248
|
+
width: 100px;
|
249
|
+
height: 100px;
|
250
|
+
margin: auto;
|
251
|
+
border: 16px solid #eaeaea;
|
252
|
+
border-radius: 50%;
|
253
|
+
border-top: 16px solid #a0c5e2;
|
254
|
+
animation: spin 2s linear infinite;
|
226
255
|
}
|
227
256
|
@keyframes spin { /* animation definition */
|
228
|
-
|
229
|
-
|
257
|
+
0% { transform: rotate(0deg); }
|
258
|
+
100% { transform: rotate(360deg); }
|
230
259
|
}
|
231
260
|
|
232
261
|
/********************************************* Footer *********************************************/
|
233
262
|
|
234
263
|
body > footer {
|
235
|
-
|
236
|
-
|
237
|
-
|
238
|
-
padding: 0px;
|
264
|
+
background: #1e262b;
|
265
|
+
color: white;
|
266
|
+
padding: 0px;
|
239
267
|
}
|
240
268
|
body > footer p {
|
241
|
-
|
242
|
-
|
243
|
-
|
269
|
+
text-align: center;
|
270
|
+
font-size: 0.9em;
|
271
|
+
padding: 15px 0px; /* top sides */
|
272
|
+
margin: 0px;
|
273
|
+
}
|
274
|
+
body > footer a {
|
275
|
+
color: inherit;
|
244
276
|
}
|
245
277
|
body > footer aside#modal { /* modal box container */
|
246
|
-
|
247
|
-
|
248
|
-
|
249
|
-
|
250
|
-
|
251
|
-
|
252
|
-
|
253
|
-
|
254
|
-
|
255
|
-
|
278
|
+
display: none;
|
279
|
+
position: fixed;
|
280
|
+
z-index: 1000;
|
281
|
+
left: 0;
|
282
|
+
top: 0;
|
283
|
+
width: 100%;
|
284
|
+
height: 100%;
|
285
|
+
overflow: auto;
|
286
|
+
color: black;
|
287
|
+
background-color: rgba(0, 0, 0, 0.8);
|
256
288
|
}
|
257
289
|
body > footer aside#modal #modal-content { /* modal box */
|
258
|
-
|
259
|
-
|
260
|
-
|
261
|
-
|
262
|
-
|
263
|
-
|
264
|
-
|
265
|
-
|
266
|
-
|
290
|
+
background-color: #f7f8fa;
|
291
|
+
margin: auto;
|
292
|
+
margin-top: 50vh;
|
293
|
+
transform: translateY(-50%);
|
294
|
+
padding: 20px 25px 40px; /* top sides bottom */
|
295
|
+
border: 1px solid #1e262b;
|
296
|
+
width: 25%;
|
297
|
+
max-width: 425px;
|
298
|
+
min-width: 375px;
|
299
|
+
}
|
300
|
+
body > footer aside#modal #modal-content h2 {
|
301
|
+
font-size: 1.6em;
|
302
|
+
margin: 1em 0px; /* top/bottom sides */
|
267
303
|
}
|
268
304
|
body > footer aside#modal #modal-content dl {
|
269
305
|
display: grid;
|
@@ -271,27 +307,23 @@ body > footer aside#modal #modal-content dl {
|
|
271
307
|
grid-gap: 5px 25px;
|
272
308
|
}
|
273
309
|
body > footer aside#modal #modal-content dl dt {
|
274
|
-
font-weight: bold;
|
275
310
|
text-align: right;
|
276
311
|
}
|
277
312
|
body > footer aside#modal #modal-content dl dd {
|
278
313
|
text-align: left;
|
279
|
-
margin
|
314
|
+
margin: 0;
|
280
315
|
}
|
281
316
|
|
282
317
|
|
283
318
|
/******************************************* Error pages ******************************************/
|
284
319
|
|
285
320
|
section#error h2 {
|
286
|
-
|
321
|
+
color: #ff3333;
|
287
322
|
}
|
288
323
|
section#error p {
|
289
|
-
|
324
|
+
text-align: center;
|
290
325
|
}
|
291
326
|
section#error p img {
|
292
|
-
|
293
|
-
|
294
|
-
}
|
295
|
-
section#error a {
|
296
|
-
color: #748ea3;
|
327
|
+
width: 25%;
|
328
|
+
margin-bottom: 3em;
|
297
329
|
}
|
@@ -171,7 +171,7 @@ RSpec.describe CoreExtensions::Tree do
|
|
171
171
|
end
|
172
172
|
|
173
173
|
describe '#to_s' do
|
174
|
-
context 'given a
|
174
|
+
context 'given a Tree' do
|
175
175
|
before do
|
176
176
|
@tree = described_class.new(0.0)
|
177
177
|
@tree.add_child_node('left', 1.0)
|
@@ -185,27 +185,28 @@ RSpec.describe CoreExtensions::Tree do
|
|
185
185
|
@tree.child_node('right').add_child_node('right', 3.3)
|
186
186
|
end
|
187
187
|
it 'should return an ASCII representation of the Tree' do
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
|
198
|
-
|
199
|
-
|
200
|
-
|
201
|
-
|
202
|
-
|
203
|
-
|
204
|
-
|
205
|
-
|
206
|
-
|
207
|
-
|
208
|
-
|
188
|
+
expected_string = <<~END_HEREDOC
|
189
|
+
VALUE: 0.0
|
190
|
+
* ID: 'left'
|
191
|
+
VALUE: 1.0
|
192
|
+
* ID: 'left'
|
193
|
+
VALUE: 1.1
|
194
|
+
* ID: 'right'
|
195
|
+
VALUE: 1.2
|
196
|
+
* ID: 'middle'
|
197
|
+
VALUE: 2.0
|
198
|
+
* ID: 'middle'
|
199
|
+
VALUE: 2.1
|
200
|
+
* ID: 'right'
|
201
|
+
VALUE: 3.0
|
202
|
+
* ID: 'left'
|
203
|
+
VALUE: 3.1
|
204
|
+
* ID: 'middle'
|
205
|
+
VALUE: 3.2
|
206
|
+
* ID: 'right'
|
207
|
+
VALUE: 3.3
|
208
|
+
END_HEREDOC
|
209
|
+
expect(@tree.to_s).to eql(expected_string)
|
209
210
|
end
|
210
211
|
end
|
211
212
|
end
|
data/spec/intranet/core_spec.rb
CHANGED
@@ -105,10 +105,10 @@ RSpec.describe Intranet::Logger do
|
|
105
105
|
time_of_test = Time.now
|
106
106
|
allow(Time).to receive(:now).and_return(time_of_test)
|
107
107
|
expect { @logger.log(tc[:level], 'TEST_MSG') }
|
108
|
-
.to output(/#{time_of_test.strftime(
|
108
|
+
.to output(/#{time_of_test.strftime('\\[%Y-%m-%d %H:%M:%S\\]')}/)
|
109
109
|
.to_stderr_from_any_process
|
110
110
|
expect { @logger.send(tc[:level_method], 'TEST_MSG') }
|
111
|
-
.to output(/#{time_of_test.strftime(
|
111
|
+
.to output(/#{time_of_test.strftime('\\[%Y-%m-%d %H:%M:%S\\]')}/)
|
112
112
|
.to_stderr_from_any_process
|
113
113
|
end
|
114
114
|
|
data/spec/spec_helper.rb
CHANGED
@@ -41,13 +41,11 @@ RSpec.configure do |config|
|
|
41
41
|
$LOAD_PATH << File.absolute_path(File.join('..', 'lib'), __dir__)
|
42
42
|
|
43
43
|
# Load and start SimpleCov to gather code coverage information
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
add_filter 'spec' # exclude 'spec' folder from coverage
|
51
|
-
end
|
44
|
+
require 'simplecov'
|
45
|
+
SimpleCov.start do
|
46
|
+
enable_coverage :branch # measure branches coverage
|
47
|
+
primary_coverage :branch
|
48
|
+
minimum_coverage line: 100, branch: 100 # minimal coverage rate to succeed
|
49
|
+
add_filter 'spec' # exclude 'spec' folder from coverage
|
52
50
|
end
|
53
51
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: intranet-core
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.5.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ebling Mis
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2023-12-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: haml
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '
|
19
|
+
version: '6.0'
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: '
|
26
|
+
version: '6.0'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: htmlentities
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -80,77 +80,7 @@ dependencies:
|
|
80
80
|
- - "~>"
|
81
81
|
- !ruby/object:Gem::Version
|
82
82
|
version: '1.0'
|
83
|
-
|
84
|
-
name: rake
|
85
|
-
requirement: !ruby/object:Gem::Requirement
|
86
|
-
requirements:
|
87
|
-
- - "~>"
|
88
|
-
- !ruby/object:Gem::Version
|
89
|
-
version: '13.0'
|
90
|
-
type: :development
|
91
|
-
prerelease: false
|
92
|
-
version_requirements: !ruby/object:Gem::Requirement
|
93
|
-
requirements:
|
94
|
-
- - "~>"
|
95
|
-
- !ruby/object:Gem::Version
|
96
|
-
version: '13.0'
|
97
|
-
- !ruby/object:Gem::Dependency
|
98
|
-
name: rspec
|
99
|
-
requirement: !ruby/object:Gem::Requirement
|
100
|
-
requirements:
|
101
|
-
- - "~>"
|
102
|
-
- !ruby/object:Gem::Version
|
103
|
-
version: '3.0'
|
104
|
-
type: :development
|
105
|
-
prerelease: false
|
106
|
-
version_requirements: !ruby/object:Gem::Requirement
|
107
|
-
requirements:
|
108
|
-
- - "~>"
|
109
|
-
- !ruby/object:Gem::Version
|
110
|
-
version: '3.0'
|
111
|
-
- !ruby/object:Gem::Dependency
|
112
|
-
name: rubocop
|
113
|
-
requirement: !ruby/object:Gem::Requirement
|
114
|
-
requirements:
|
115
|
-
- - "~>"
|
116
|
-
- !ruby/object:Gem::Version
|
117
|
-
version: '1.0'
|
118
|
-
type: :development
|
119
|
-
prerelease: false
|
120
|
-
version_requirements: !ruby/object:Gem::Requirement
|
121
|
-
requirements:
|
122
|
-
- - "~>"
|
123
|
-
- !ruby/object:Gem::Version
|
124
|
-
version: '1.0'
|
125
|
-
- !ruby/object:Gem::Dependency
|
126
|
-
name: simplecov
|
127
|
-
requirement: !ruby/object:Gem::Requirement
|
128
|
-
requirements:
|
129
|
-
- - "~>"
|
130
|
-
- !ruby/object:Gem::Version
|
131
|
-
version: '0.21'
|
132
|
-
type: :development
|
133
|
-
prerelease: false
|
134
|
-
version_requirements: !ruby/object:Gem::Requirement
|
135
|
-
requirements:
|
136
|
-
- - "~>"
|
137
|
-
- !ruby/object:Gem::Version
|
138
|
-
version: '0.21'
|
139
|
-
- !ruby/object:Gem::Dependency
|
140
|
-
name: yard
|
141
|
-
requirement: !ruby/object:Gem::Requirement
|
142
|
-
requirements:
|
143
|
-
- - "~>"
|
144
|
-
- !ruby/object:Gem::Version
|
145
|
-
version: '0.0'
|
146
|
-
type: :development
|
147
|
-
prerelease: false
|
148
|
-
version_requirements: !ruby/object:Gem::Requirement
|
149
|
-
requirements:
|
150
|
-
- - "~>"
|
151
|
-
- !ruby/object:Gem::Version
|
152
|
-
version: '0.0'
|
153
|
-
description:
|
83
|
+
description:
|
154
84
|
email: ebling.mis@protonmail.com
|
155
85
|
executables: []
|
156
86
|
extensions: []
|
@@ -158,7 +88,6 @@ extra_rdoc_files: []
|
|
158
88
|
files:
|
159
89
|
- README.md
|
160
90
|
- lib/core_extensions.rb
|
161
|
-
- lib/core_extensions/hash.rb
|
162
91
|
- lib/core_extensions/string.rb
|
163
92
|
- lib/core_extensions/tree.rb
|
164
93
|
- lib/core_extensions/webrick/httpresponse.rb
|
@@ -180,7 +109,6 @@ files:
|
|
180
109
|
- lib/intranet/resources/www/fonts/SourceSansPro.woff2
|
181
110
|
- lib/intranet/resources/www/nav.js
|
182
111
|
- lib/intranet/resources/www/style.css
|
183
|
-
- spec/core_extensions/hash_spec.rb
|
184
112
|
- spec/core_extensions/string_spec.rb
|
185
113
|
- spec/core_extensions/tree_spec.rb
|
186
114
|
- spec/core_extensions/webrick/httpresponse_spec.rb
|
@@ -196,7 +124,7 @@ licenses:
|
|
196
124
|
- MIT
|
197
125
|
metadata:
|
198
126
|
source_code_uri: https://bitbucket.org/ebling-mis/intranet-core
|
199
|
-
post_install_message:
|
127
|
+
post_install_message:
|
200
128
|
rdoc_options: []
|
201
129
|
require_paths:
|
202
130
|
- lib
|
@@ -204,15 +132,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
204
132
|
requirements:
|
205
133
|
- - "~>"
|
206
134
|
- !ruby/object:Gem::Version
|
207
|
-
version: '
|
135
|
+
version: '3.0'
|
208
136
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
209
137
|
requirements:
|
210
138
|
- - ">="
|
211
139
|
- !ruby/object:Gem::Version
|
212
140
|
version: '0'
|
213
141
|
requirements: []
|
214
|
-
rubygems_version: 3.
|
215
|
-
signing_key:
|
142
|
+
rubygems_version: 3.3.15
|
143
|
+
signing_key:
|
216
144
|
specification_version: 4
|
217
145
|
summary: Core component to build a custom intranet.
|
218
146
|
test_files: []
|
data/lib/core_extensions/hash.rb
DELETED
@@ -1,15 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module CoreExtensions
|
4
|
-
# Extension of Ruby's standard library +Hash+ class.
|
5
|
-
module Hash
|
6
|
-
# Returns a copy of a hash with +keys+ excluded. Original hash is not
|
7
|
-
# modified.
|
8
|
-
# @return [Hash]
|
9
|
-
def except(*keys)
|
10
|
-
h = dup
|
11
|
-
keys.each { |key| h.delete(key) }
|
12
|
-
h
|
13
|
-
end
|
14
|
-
end
|
15
|
-
end
|
@@ -1,22 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require 'core_extensions/hash'
|
4
|
-
|
5
|
-
RSpec.describe CoreExtensions::Hash do
|
6
|
-
before do
|
7
|
-
Hash.include described_class
|
8
|
-
end
|
9
|
-
|
10
|
-
describe '#except' do
|
11
|
-
it 'should return a copy of the original hash with the given keys removed' do
|
12
|
-
tested_hash = { a: true, b: false, c: nil }
|
13
|
-
expect(tested_hash.except(:c)).to eql({ a: true, b: false })
|
14
|
-
expect(tested_hash).to eql({ a: true, b: false, c: nil })
|
15
|
-
|
16
|
-
tested_hash = { a: 100, b: 200, c: 300 }
|
17
|
-
expect(tested_hash.except(:a)).to eql({ b: 200, c: 300 })
|
18
|
-
expect(tested_hash.except(:a, :c)).to eql({ b: 200 })
|
19
|
-
expect(tested_hash).to eql({ a: 100, b: 200, c: 300 })
|
20
|
-
end
|
21
|
-
end
|
22
|
-
end
|