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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a97d60581caae6c87621740e47c93b791692a84c7da7296bac8a31f4566083dd
4
- data.tar.gz: eae02f92ebb3ccfde10fea592c1bfe970a0614dbb0bb2517c9390b98240ba048
3
+ metadata.gz: 34f142eee2a8be5aae73687655f819eb5b54f77fc286bd7bf03fd60ccd598c0a
4
+ data.tar.gz: 9d145a34e867be9d70d64668eba6ee3823b6b9319e86ba1985cd829f5d007b8e
5
5
  SHA512:
6
- metadata.gz: 95d3d2a9b23f201df285861135a8c2a098131fed6378809161289c294c8ad037e126b4e4285be4008464b8e6fde705e8757b084509308f5e7c7e6f9e34b1b0e5
7
- data.tar.gz: 0c4bea23d78075ad139c8e17bc5baaae9f52306de8efd7c838391e917cab36c22ccbd65d6be14a11d5a8580f68f5ce267afc1fd8e6b6fc3d13165bc107d160c7
6
+ metadata.gz: 4409e4fbe16f39c07460807d7e36e6eb6f76e813a7f61703612bd9906902708464e78680e99984f8cdb0d88d932aa88316a5792c63d904cacf3c9862efadbda7
7
+ data.tar.gz: 43fea15f325e80d76ca632531fca42d0eb51ee37bf951f8394fb55100ace30347ed69b85cdcbdb7821860ac2ab4f2d69e19bb10925521d2c4758fe77a5d06814
data/config/flay.yml CHANGED
@@ -1,3 +1,3 @@
1
1
  ---
2
- threshold: 9
3
- total_score: 69
2
+ threshold: 13
3
+ total_score: 77
data/config/flog.yml CHANGED
@@ -1,2 +1,2 @@
1
1
  ---
2
- threshold: 11.6
2
+ threshold: 16.0
@@ -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(:map_array,
56
- t(:remove_key_prefix_inject, prefix, model))).call(hash)
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
@@ -3,6 +3,6 @@
3
3
  module LB
4
4
  class Persistence
5
5
  # Version
6
- VERSION = '0.0.9'
6
+ VERSION = '0.1.0'
7
7
  end
8
8
  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.9
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-09-05 00:00:00.000000000 Z
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: '0.52'
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: '0.52'
150
+ version: 0.52.1
151
151
  - !ruby/object:Gem::Dependency
152
152
  name: sqlite3
153
153
  requirement: !ruby/object:Gem::Requirement