umbrellio-utils 0.2.0 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +0 -2
- data/Gemfile.lock +130 -0
- data/lib/umbrellio_utils/formatting.rb +29 -0
- data/lib/umbrellio_utils/version.rb +1 -1
- data/umbrellio_utils.gemspec +3 -1
- metadata +22 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7ad8f07af559cdaaabcb97428722b18a80109a4719922f2e32a3f1ab32b40dba
|
4
|
+
data.tar.gz: 47d944ce423bd48a3e1fb8e56601a97e184830fdd696f2322acc97e4e75058d1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 01fb5c648f8789a1feb93cf6aa8f1664798eb416f0a9d37048f90da4dd6d0ce402b9ce87436ff9dee75617ba372ee0b9c1a11db082c8a8763cc4cf0f3d988789
|
7
|
+
data.tar.gz: 5cb141aa1495ba285ffe2afaf0fed3acfb256f520b98ce555e6c882e9ff9ac584e7bfb284b949dd31462b141a13d63c9ee48248a5d7a24c2285ad9b260946792
|
data/.gitignore
CHANGED
data/Gemfile.lock
ADDED
@@ -0,0 +1,130 @@
|
|
1
|
+
PATH
|
2
|
+
remote: .
|
3
|
+
specs:
|
4
|
+
umbrellio-utils (0.3.0)
|
5
|
+
memery (~> 1)
|
6
|
+
|
7
|
+
GEM
|
8
|
+
remote: https://rubygems.org/
|
9
|
+
specs:
|
10
|
+
activesupport (6.1.3.1)
|
11
|
+
concurrent-ruby (~> 1.0, >= 1.0.2)
|
12
|
+
i18n (>= 1.6, < 2)
|
13
|
+
minitest (>= 5.1)
|
14
|
+
tzinfo (~> 2.0)
|
15
|
+
zeitwerk (~> 2.3)
|
16
|
+
ast (2.4.2)
|
17
|
+
bundler-audit (0.8.0)
|
18
|
+
bundler (>= 1.2.0, < 3)
|
19
|
+
thor (~> 1.0)
|
20
|
+
ci-helper (0.4.2)
|
21
|
+
colorize (~> 0.8)
|
22
|
+
dry-inflector (~> 0.2)
|
23
|
+
umbrellio-sequel-plugins (~> 0.4)
|
24
|
+
coderay (1.1.3)
|
25
|
+
colorize (0.8.1)
|
26
|
+
concurrent-ruby (1.1.8)
|
27
|
+
diff-lcs (1.4.4)
|
28
|
+
docile (1.3.5)
|
29
|
+
dry-inflector (0.2.0)
|
30
|
+
i18n (1.8.10)
|
31
|
+
concurrent-ruby (~> 1.0)
|
32
|
+
memery (1.4.0)
|
33
|
+
ruby2_keywords (~> 0.0.2)
|
34
|
+
method_source (1.0.0)
|
35
|
+
minitest (5.14.4)
|
36
|
+
parallel (1.20.1)
|
37
|
+
parser (3.0.1.0)
|
38
|
+
ast (~> 2.4.1)
|
39
|
+
pry (0.14.0)
|
40
|
+
coderay (~> 1.1)
|
41
|
+
method_source (~> 1.0)
|
42
|
+
rack (2.2.3)
|
43
|
+
rainbow (3.0.0)
|
44
|
+
rake (13.0.3)
|
45
|
+
regexp_parser (2.1.1)
|
46
|
+
rexml (3.2.5)
|
47
|
+
rspec (3.10.0)
|
48
|
+
rspec-core (~> 3.10.0)
|
49
|
+
rspec-expectations (~> 3.10.0)
|
50
|
+
rspec-mocks (~> 3.10.0)
|
51
|
+
rspec-core (3.10.1)
|
52
|
+
rspec-support (~> 3.10.0)
|
53
|
+
rspec-expectations (3.10.1)
|
54
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
55
|
+
rspec-support (~> 3.10.0)
|
56
|
+
rspec-mocks (3.10.2)
|
57
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
58
|
+
rspec-support (~> 3.10.0)
|
59
|
+
rspec-support (3.10.2)
|
60
|
+
rubocop (1.11.0)
|
61
|
+
parallel (~> 1.10)
|
62
|
+
parser (>= 3.0.0.0)
|
63
|
+
rainbow (>= 2.2.2, < 4.0)
|
64
|
+
regexp_parser (>= 1.8, < 3.0)
|
65
|
+
rexml
|
66
|
+
rubocop-ast (>= 1.2.0, < 2.0)
|
67
|
+
ruby-progressbar (~> 1.7)
|
68
|
+
unicode-display_width (>= 1.4.0, < 3.0)
|
69
|
+
rubocop-ast (1.4.1)
|
70
|
+
parser (>= 2.7.1.5)
|
71
|
+
rubocop-config-umbrellio (1.11.0.40)
|
72
|
+
rubocop (= 1.11.0)
|
73
|
+
rubocop-performance (= 1.10.0)
|
74
|
+
rubocop-rails (= 2.9.1)
|
75
|
+
rubocop-rake (= 0.5.1)
|
76
|
+
rubocop-rspec (= 2.2.0)
|
77
|
+
rubocop-sequel (= 0.2.0)
|
78
|
+
rubocop-performance (1.10.0)
|
79
|
+
rubocop (>= 0.90.0, < 2.0)
|
80
|
+
rubocop-ast (>= 0.4.0)
|
81
|
+
rubocop-rails (2.9.1)
|
82
|
+
activesupport (>= 4.2.0)
|
83
|
+
rack (>= 1.1)
|
84
|
+
rubocop (>= 0.90.0, < 2.0)
|
85
|
+
rubocop-rake (0.5.1)
|
86
|
+
rubocop
|
87
|
+
rubocop-rspec (2.2.0)
|
88
|
+
rubocop (~> 1.0)
|
89
|
+
rubocop-ast (>= 1.1.0)
|
90
|
+
rubocop-sequel (0.2.0)
|
91
|
+
rubocop (~> 1.0)
|
92
|
+
ruby-progressbar (1.11.0)
|
93
|
+
ruby2_keywords (0.0.4)
|
94
|
+
sequel (5.43.0)
|
95
|
+
simplecov (0.21.2)
|
96
|
+
docile (~> 1.1)
|
97
|
+
simplecov-html (~> 0.11)
|
98
|
+
simplecov_json_formatter (~> 0.1)
|
99
|
+
simplecov-html (0.12.3)
|
100
|
+
simplecov-lcov (0.8.0)
|
101
|
+
simplecov_json_formatter (0.1.2)
|
102
|
+
symbiont-ruby (0.6.0)
|
103
|
+
thor (1.1.0)
|
104
|
+
tzinfo (2.0.4)
|
105
|
+
concurrent-ruby (~> 1.0)
|
106
|
+
umbrellio-sequel-plugins (0.4.0.164)
|
107
|
+
sequel
|
108
|
+
symbiont-ruby (>= 0.6)
|
109
|
+
unicode-display_width (2.0.0)
|
110
|
+
yard (0.9.26)
|
111
|
+
zeitwerk (2.4.2)
|
112
|
+
|
113
|
+
PLATFORMS
|
114
|
+
x86_64-linux
|
115
|
+
|
116
|
+
DEPENDENCIES
|
117
|
+
bundler
|
118
|
+
bundler-audit
|
119
|
+
ci-helper
|
120
|
+
pry
|
121
|
+
rake
|
122
|
+
rspec
|
123
|
+
rubocop-config-umbrellio
|
124
|
+
simplecov
|
125
|
+
simplecov-lcov
|
126
|
+
umbrellio-utils!
|
127
|
+
yard
|
128
|
+
|
129
|
+
BUNDLED WITH
|
130
|
+
2.2.15
|
@@ -61,6 +61,16 @@ module UmbrellioUtils
|
|
61
61
|
format("%<part>02d", part: part)
|
62
62
|
end
|
63
63
|
|
64
|
+
#
|
65
|
+
# Expands a hash whose keys contain the path.
|
66
|
+
#
|
67
|
+
# @param [Hash] hash hash, which you want to expand
|
68
|
+
# @param [String] delemiter, separator, which is used in the value of the keys
|
69
|
+
# @param [Proc, Lambda, Symbol] key_converter, converter for key's value.
|
70
|
+
# Defaults to :to_sym
|
71
|
+
#
|
72
|
+
# @return [Hash] expanded hash
|
73
|
+
#
|
64
74
|
def expand_hash(hash, delemiter: ".", key_converter: :to_sym)
|
65
75
|
hash.each_with_object(Misc.build_infinite_hash) do |entry, memo|
|
66
76
|
path, value = entry
|
@@ -74,5 +84,24 @@ module UmbrellioUtils
|
|
74
84
|
end
|
75
85
|
end
|
76
86
|
end
|
87
|
+
|
88
|
+
#
|
89
|
+
# Expands a nested hash whose keys contain the path.
|
90
|
+
#
|
91
|
+
# @param [Hash] hash, hash, which you want to expand
|
92
|
+
# @param [Hash] **expand_hash_options options, that the
|
93
|
+
# {#expand_hash} method accepts
|
94
|
+
#
|
95
|
+
# @return [Hash] expanded hash
|
96
|
+
#
|
97
|
+
def deeply_expand_hash(hash, **expand_hash_options)
|
98
|
+
transformed_hash = hash.transform_values do |value|
|
99
|
+
next deeply_expand_hash(value, **expand_hash_options) if value.is_a?(Hash)
|
100
|
+
|
101
|
+
value
|
102
|
+
end
|
103
|
+
|
104
|
+
expand_hash(transformed_hash, **expand_hash_options)
|
105
|
+
end
|
77
106
|
end
|
78
107
|
end
|
data/umbrellio_utils.gemspec
CHANGED
@@ -16,6 +16,7 @@ Gem::Specification.new do |spec|
|
|
16
16
|
|
17
17
|
spec.metadata["homepage_uri"] = spec.homepage
|
18
18
|
spec.metadata["source_code_uri"] = "https://github.com/umbrellio/utils"
|
19
|
+
spec.metadata["documentation_uri"] = "https://rubydoc.info/gems/umbrellio-utils"
|
19
20
|
|
20
21
|
# Specify which files should be added to the gem when it is released.
|
21
22
|
# The `git ls-files -z` loads the files in the RubyGem that have been added into git.
|
@@ -26,7 +27,7 @@ Gem::Specification.new do |spec|
|
|
26
27
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
27
28
|
spec.require_paths = ["lib"]
|
28
29
|
|
29
|
-
spec.add_dependency "memery"
|
30
|
+
spec.add_dependency "memery", "~> 1"
|
30
31
|
|
31
32
|
spec.add_development_dependency "bundler"
|
32
33
|
spec.add_development_dependency "bundler-audit"
|
@@ -37,4 +38,5 @@ Gem::Specification.new do |spec|
|
|
37
38
|
spec.add_development_dependency "rubocop-config-umbrellio"
|
38
39
|
spec.add_development_dependency "simplecov"
|
39
40
|
spec.add_development_dependency "simplecov-lcov"
|
41
|
+
spec.add_development_dependency "yard"
|
40
42
|
end
|
metadata
CHANGED
@@ -1,29 +1,29 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: umbrellio-utils
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- JustAnotherDude
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-04-
|
11
|
+
date: 2021-04-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: memery
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- - "
|
17
|
+
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '
|
19
|
+
version: '1'
|
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: '1'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: bundler
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -150,6 +150,20 @@ dependencies:
|
|
150
150
|
- - ">="
|
151
151
|
- !ruby/object:Gem::Version
|
152
152
|
version: '0'
|
153
|
+
- !ruby/object:Gem::Dependency
|
154
|
+
name: yard
|
155
|
+
requirement: !ruby/object:Gem::Requirement
|
156
|
+
requirements:
|
157
|
+
- - ">="
|
158
|
+
- !ruby/object:Gem::Version
|
159
|
+
version: '0'
|
160
|
+
type: :development
|
161
|
+
prerelease: false
|
162
|
+
version_requirements: !ruby/object:Gem::Requirement
|
163
|
+
requirements:
|
164
|
+
- - ">="
|
165
|
+
- !ruby/object:Gem::Version
|
166
|
+
version: '0'
|
153
167
|
description: UmbrellioUtils is collection of utility classes and helpers
|
154
168
|
email:
|
155
169
|
- VanyaZ158@gmail.com
|
@@ -163,6 +177,7 @@ files:
|
|
163
177
|
- ".rspec"
|
164
178
|
- ".rubocop.yml"
|
165
179
|
- Gemfile
|
180
|
+
- Gemfile.lock
|
166
181
|
- LICENSE.txt
|
167
182
|
- README.md
|
168
183
|
- Rakefile
|
@@ -193,6 +208,7 @@ licenses:
|
|
193
208
|
metadata:
|
194
209
|
homepage_uri: https://github.com/umbrellio/utils
|
195
210
|
source_code_uri: https://github.com/umbrellio/utils
|
211
|
+
documentation_uri: https://rubydoc.info/gems/umbrellio-utils
|
196
212
|
post_install_message:
|
197
213
|
rdoc_options: []
|
198
214
|
require_paths:
|