shaf 1.2.0 → 1.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data.tar.gz.sig +0 -0
- data/lib/shaf/extensions/resource_uris.rb +2 -0
- data/lib/shaf/settings.rb +4 -0
- data/lib/shaf/utils.rb +29 -9
- data/lib/shaf/version.rb +1 -1
- data/templates/config.ru +1 -1
- data/templates/config/settings.yml +2 -2
- data/upgrades/1.2.1.tar.gz +0 -0
- metadata +3 -2
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b19e78676b4dc759b28198902633a7a66bde814d88b0ca7d442052fa62326ccd
|
4
|
+
data.tar.gz: 66c8a419a5590ad713f74a0d704439bf282cded99a5f5e0d30eabd26d8ab4d7d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 183f94b5e51e365d431033c6b2b4d55dfec717c1b3808a5957751667e11a92d1e97b29ebcd5184b8140c2202d71de006e1cb2108c1438e746a0893275527264a
|
7
|
+
data.tar.gz: e9c812b5db8032ee330faeaba47e8d535f87f5321506f1f4e2a393b79d8118cf5d832f3ac43d84c2244834b294a7f448c542c4df9ab125f2b43a5901a9ba7569
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data.tar.gz.sig
CHANGED
Binary file
|
data/lib/shaf/settings.rb
CHANGED
data/lib/shaf/utils.rb
CHANGED
@@ -56,15 +56,33 @@ module Shaf
|
|
56
56
|
end
|
57
57
|
|
58
58
|
def deep_symbolize_keys(value)
|
59
|
-
|
59
|
+
deep_transform_keys(value) { |key| key.to_sym }
|
60
|
+
end
|
61
|
+
|
62
|
+
def deep_transform_keys(hash, &block)
|
63
|
+
case hash
|
60
64
|
when Hash
|
61
|
-
|
62
|
-
|
65
|
+
hash.each_with_object({}) do |(k, v), h|
|
66
|
+
key = block.call(k)
|
67
|
+
h[key] = deep_transform_keys(v, &block)
|
63
68
|
end
|
64
69
|
when Array
|
65
|
-
|
70
|
+
hash.map { |v| deep_transform_keys(v, &block) }
|
66
71
|
else
|
67
|
-
|
72
|
+
hash
|
73
|
+
end
|
74
|
+
end
|
75
|
+
|
76
|
+
def deep_transform_values(hash, &block)
|
77
|
+
case hash
|
78
|
+
when Hash
|
79
|
+
hash.each_with_object({}) do |(k, v), h|
|
80
|
+
h[k] = deep_transform_values(v, &block)
|
81
|
+
end
|
82
|
+
when Array
|
83
|
+
hash.map { |v| deep_transform_values(v, &block) }
|
84
|
+
else
|
85
|
+
block.call(hash)
|
68
86
|
end
|
69
87
|
end
|
70
88
|
|
@@ -72,14 +90,16 @@ module Shaf
|
|
72
90
|
return {} unless File.exist? file
|
73
91
|
|
74
92
|
yaml = File.read(file)
|
75
|
-
|
93
|
+
load_args = [yaml, {aliases: true, symbolize_names: true}]
|
76
94
|
if RUBY_VERSION < '2.6.0'
|
77
|
-
|
78
|
-
|
79
|
-
YAML.safe_load(yaml, aliases: true, symbolize_names: true)
|
95
|
+
load_args.pop
|
96
|
+
load_args += [[], [], true]
|
80
97
|
end
|
98
|
+
YAML.safe_load(*load_args)
|
81
99
|
end
|
82
100
|
|
101
|
+
private
|
102
|
+
|
83
103
|
def erb(content, binding: nil)
|
84
104
|
bindings = binding ? [binding] : []
|
85
105
|
return ERB.new(content, 0, '%-<>').result(*bindings) if RUBY_VERSION < '2.6.0'
|
data/lib/shaf/version.rb
CHANGED
data/templates/config.ru
CHANGED
Binary file
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: shaf
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.2.
|
4
|
+
version: 1.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sammy Henningsson
|
@@ -30,7 +30,7 @@ cert_chain:
|
|
30
30
|
ZMhjYR7sRczGJx+GxGU2EaR0bjRsPVlC4ywtFxoOfRG3WaJcpWGEoAoMJX6Z0bRv
|
31
31
|
M40=
|
32
32
|
-----END CERTIFICATE-----
|
33
|
-
date: 2019-
|
33
|
+
date: 2019-10-04 00:00:00.000000000 Z
|
34
34
|
dependencies:
|
35
35
|
- !ruby/object:Gem::Dependency
|
36
36
|
name: minitest
|
@@ -276,6 +276,7 @@ files:
|
|
276
276
|
- upgrades/1.0.4.tar.gz
|
277
277
|
- upgrades/1.1.0.tar.gz
|
278
278
|
- upgrades/1.2.0.tar.gz
|
279
|
+
- upgrades/1.2.1.tar.gz
|
279
280
|
homepage:
|
280
281
|
licenses:
|
281
282
|
- MIT
|
metadata.gz.sig
CHANGED
Binary file
|