nested_lookup 0.1.0 → 0.2.1
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/.travis.yml +10 -3
- data/Gemfile +2 -0
- data/README.md +2 -2
- data/lib/nested_lookup.rb +5 -1
- data/lib/nested_lookup/version.rb +1 -1
- data/nested_lookup.gemspec +8 -8
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5c1d498fae745d1ac5d6ad5794725213234cb7fb
|
4
|
+
data.tar.gz: 2578cd450b8c083680f630b7274174598c4835da
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d3e0255f43b5b0dd4265df11d7a7e03d2a9d4a54ac03201f3e85d1b82528622ad27b0b515d80e6b7dac690370c8834672b5968fc9b78f385553e32767589d8bb
|
7
|
+
data.tar.gz: da20018e60c7024f77eac2696c95b86eb0dad2d2498aefe24b0db83f662e647f8fdd93789766514faae89fcc08fbd4a1bae52cd14d9c8d09faa01cd3252aec5e
|
data/.travis.yml
CHANGED
@@ -1,7 +1,14 @@
|
|
1
|
-
---
|
2
|
-
sudo: false
|
3
1
|
language: ruby
|
4
2
|
cache: bundler
|
5
3
|
rvm:
|
6
|
-
|
4
|
+
- 2.3.7
|
7
5
|
before_install: gem install bundler -v 1.16.6
|
6
|
+
deploy:
|
7
|
+
provider: rubygems
|
8
|
+
api_key:
|
9
|
+
secure: F/wADg5teclCHTkQHVL413+Ow3/XGkAgSMsWJOKKc+vJqdBTckz60U9ghUL36RF1XX7ZcZZ8biUb2hM1mGUPtG/C6uML2tWy2KBbHNf8yleGL9C68cWM+AicQ5yF3Ug8GRKd/XaM4uxh3gCv1QSqOez8beYVIjjw2U+otper/5hTYzgMoKYCSN9+z0bUhrEbEMull5WgG+RF+3ulHThW96fD3LhetnJOEewHhHbmr2fO4QUAF2trLxVKczYeAOf1KrEicbxgTM9CEIgYRyGSTAyfKAKB8fW87hcn2xxJi6OkZOVZSw1HPnhS9GtfMyGAC+wAEY540Q03NHutwvdARZoylbBKnuuGCrZUSv0215ueCrBSvdBR1vLXkiDXpi02LHYo7nrq6sy6e7WC9UDwGTMSDlZDJaSPiXqY7YIAzyapbaCU+FzUVSoN8ZI6cNZx0sKrR/h+sAZlfnVEPG7wkK+jaMh0Lo3JW3Yzn92vsFbq04sirZ82WrxNHaw9vHZd/jO0Xuj8hkF8tI0YDnlm8H41mbFlue2j7eaXFFkU3o6/P1YwdMqu7q/B+MAl41jfgRDsolv8XZ9jlt7QE1C3ESJxI/aJqyALfzTiNZHhHvKckUzHtTWGndeVkm0g1AWP+fbUw1qTjooWriYm7/L6uOBzqmVipzVnV1dDDEiXQGw=
|
10
|
+
gem: nested_lookup
|
11
|
+
|
12
|
+
env:
|
13
|
+
global:
|
14
|
+
- CODECOV_TOKEN="06bb0a76-aff9-4c3e-a31a-917d6c7057bf"
|
data/Gemfile
CHANGED
data/README.md
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
# NestedLookup
|
1
|
+
# NestedLookup [](https://travis-ci.com/rameshrvr/nested_lookup) [](https://codecov.io/gh/rameshrvr/nested_lookup?branch=master) [](https://badge.fury.io/rb/nested_lookup)
|
2
2
|
|
3
3
|
A small ruby library which enables key/value lookups on deeply nested documents (Arrays and Hashes)
|
4
4
|
|
@@ -7,7 +7,7 @@ Features: (document might be Array of Hashes/Hash or Arrays/nested Arrays/nested
|
|
7
7
|
2. fetching all keys from a nested document.
|
8
8
|
3. get the number of occurrences of a key/value from a nested document
|
9
9
|
|
10
|
-
Documents may be built out of
|
10
|
+
Documents may be built out of nested Hashes and/or Arrays.
|
11
11
|
|
12
12
|
## Installation
|
13
13
|
|
data/lib/nested_lookup.rb
CHANGED
@@ -154,7 +154,11 @@ module NestedLookup
|
|
154
154
|
recrusion(document: value)
|
155
155
|
elsif value.instance_of? Array
|
156
156
|
value.each do |element|
|
157
|
-
|
157
|
+
if element.eql? @keyword and @item.eql? 'value'
|
158
|
+
@result += 1
|
159
|
+
else
|
160
|
+
recrusion(document: element)
|
161
|
+
end
|
158
162
|
end
|
159
163
|
end
|
160
164
|
end
|
data/nested_lookup.gemspec
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
|
2
2
|
lib = File.expand_path("../lib", __FILE__)
|
3
3
|
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
-
require_relative
|
4
|
+
require_relative 'lib/nested_lookup/version'
|
5
5
|
|
6
6
|
Gem::Specification.new do |spec|
|
7
7
|
spec.name = "nested_lookup"
|
@@ -17,10 +17,10 @@ Gem::Specification.new do |spec|
|
|
17
17
|
# Prevent pushing this gem to RubyGems.org. To allow pushes either set the 'allowed_push_host'
|
18
18
|
# to allow pushing to a single host or delete this section to allow pushing to any host.
|
19
19
|
if spec.respond_to?(:metadata)
|
20
|
-
spec.metadata["allowed_push_host"] =
|
20
|
+
spec.metadata["allowed_push_host"] = 'https://rubygems.org'
|
21
21
|
|
22
22
|
spec.metadata["homepage_uri"] = spec.homepage
|
23
|
-
spec.metadata["source_code_uri"] =
|
23
|
+
spec.metadata["source_code_uri"] = 'https://github.com/rameshrvr/nested_lookup'
|
24
24
|
spec.metadata["changelog_uri"] = "TODO: Put your gem's CHANGELOG.md URL here."
|
25
25
|
else
|
26
26
|
raise "RubyGems 2.0 or newer is required to protect against " \
|
@@ -32,11 +32,11 @@ Gem::Specification.new do |spec|
|
|
32
32
|
spec.files = Dir.chdir(File.expand_path('..', __FILE__)) do
|
33
33
|
`git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
34
34
|
end
|
35
|
-
spec.bindir =
|
35
|
+
spec.bindir = 'exe'
|
36
36
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
37
|
-
spec.require_paths = [
|
37
|
+
spec.require_paths = ['lib']
|
38
38
|
|
39
|
-
spec.add_development_dependency
|
40
|
-
spec.add_development_dependency
|
41
|
-
spec.add_development_dependency
|
39
|
+
spec.add_development_dependency 'bundler', '~> 1.16'
|
40
|
+
spec.add_development_dependency 'rake', '~> 10.0'
|
41
|
+
spec.add_development_dependency 'rspec', '~> 3.0'
|
42
42
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: nested_lookup
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1
|
4
|
+
version: 0.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ramesh RV
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-11-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|