lb-persistence 0.0.9 → 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/config/flay.yml +2 -2
- data/config/flog.yml +1 -1
- data/lb-persistence.gemspec +1 -1
- data/lib/lb/persistence/functions.rb +16 -2
- data/lib/lb/persistence/version.rb +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 34f142eee2a8be5aae73687655f819eb5b54f77fc286bd7bf03fd60ccd598c0a
|
4
|
+
data.tar.gz: 9d145a34e867be9d70d64668eba6ee3823b6b9319e86ba1985cd829f5d007b8e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4409e4fbe16f39c07460807d7e36e6eb6f76e813a7f61703612bd9906902708464e78680e99984f8cdb0d88d932aa88316a5792c63d904cacf3c9862efadbda7
|
7
|
+
data.tar.gz: 43fea15f325e80d76ca632531fca42d0eb51ee37bf951f8394fb55100ace30347ed69b85cdcbdb7821860ac2ab4f2d69e19bb10925521d2c4758fe77a5d06814
|
data/config/flay.yml
CHANGED
@@ -1,3 +1,3 @@
|
|
1
1
|
---
|
2
|
-
threshold:
|
3
|
-
total_score:
|
2
|
+
threshold: 13
|
3
|
+
total_score: 77
|
data/config/flog.yml
CHANGED
@@ -1,2 +1,2 @@
|
|
1
1
|
---
|
2
|
-
threshold:
|
2
|
+
threshold: 16.0
|
data/lb-persistence.gemspec
CHANGED
@@ -33,6 +33,6 @@ Gem::Specification.new do |gem|
|
|
33
33
|
gem.add_development_dependency 'guard-bundler', '~> 2.1'
|
34
34
|
gem.add_development_dependency 'guard-rspec', '~> 4.7', '>= 4.7.3'
|
35
35
|
gem.add_development_dependency 'guard-rubocop', '~> 1.3'
|
36
|
-
gem.add_development_dependency 'rubocop', '~> 0.52'
|
36
|
+
gem.add_development_dependency 'rubocop', '~> 0.52.1'
|
37
37
|
gem.add_development_dependency 'sqlite3', '~> 1.3'
|
38
38
|
end
|
@@ -52,8 +52,14 @@ module LB
|
|
52
52
|
|
53
53
|
def remove_key_prefix_inject_for(hash, key, prefix, model = nil)
|
54
54
|
t(:map_value, key,
|
55
|
-
t(:
|
56
|
-
|
55
|
+
t(:remove_key_prefix_inject_value, prefix, model)).call(hash)
|
56
|
+
end
|
57
|
+
|
58
|
+
def remove_key_prefix_inject_value(value, prefix, model = nil)
|
59
|
+
compose do |ops|
|
60
|
+
ops << t(:reject_array, t(:empty_hash?))
|
61
|
+
ops << t(:map_array, t(:remove_key_prefix_inject, prefix, model))
|
62
|
+
end.call(value)
|
57
63
|
end
|
58
64
|
|
59
65
|
def remove_key_prefix_inject(keys, prefix, model = nil)
|
@@ -81,6 +87,14 @@ module LB
|
|
81
87
|
t(:map_value, key,
|
82
88
|
t(:remove_key_prefix_inject, prefix, model)).call(hash)
|
83
89
|
end
|
90
|
+
|
91
|
+
def reject_array(array, fn)
|
92
|
+
Array(array).reject { |value| fn[value] }
|
93
|
+
end
|
94
|
+
|
95
|
+
def empty_hash?(hash)
|
96
|
+
hash.is_a?(Hash) && hash.values.all?(&:nil?)
|
97
|
+
end
|
84
98
|
end
|
85
99
|
end
|
86
100
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: lb-persistence
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0
|
4
|
+
version: 0.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Firas Zaidan
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-12-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: dry-struct
|
@@ -140,14 +140,14 @@ dependencies:
|
|
140
140
|
requirements:
|
141
141
|
- - "~>"
|
142
142
|
- !ruby/object:Gem::Version
|
143
|
-
version:
|
143
|
+
version: 0.52.1
|
144
144
|
type: :development
|
145
145
|
prerelease: false
|
146
146
|
version_requirements: !ruby/object:Gem::Requirement
|
147
147
|
requirements:
|
148
148
|
- - "~>"
|
149
149
|
- !ruby/object:Gem::Version
|
150
|
-
version:
|
150
|
+
version: 0.52.1
|
151
151
|
- !ruby/object:Gem::Dependency
|
152
152
|
name: sqlite3
|
153
153
|
requirement: !ruby/object:Gem::Requirement
|