zn 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +13 -0
- data/.rspec +2 -0
- data/.rubocop.yml +21 -0
- data/.ruby-version +1 -0
- data/.travis.yml +5 -0
- data/Gemfile +6 -0
- data/LICENSE.txt +21 -0
- data/README.md +39 -0
- data/Rakefile +8 -0
- data/bin/console +12 -0
- data/bin/setup +6 -0
- data/bin/style-check +5 -0
- data/bin/test +5 -0
- data/exe/zn +14 -0
- data/lib/zn.rb +7 -0
- data/lib/zn/associators/belongs_to.rb +22 -0
- data/lib/zn/associators/has_many.rb +23 -0
- data/lib/zn/cli.rb +82 -0
- data/lib/zn/dataset.rb +46 -0
- data/lib/zn/repos/json_repo.rb +54 -0
- data/lib/zn/search_assembler.rb +56 -0
- data/lib/zn/search_assembly.rb +47 -0
- data/lib/zn/version.rb +5 -0
- data/zn.gemspec +41 -0
- metadata +209 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 346238f45cbf0b747669a91e1f2f9f6976be1e71
|
4
|
+
data.tar.gz: f9545545d62a6a03d096a49bcdf2363f1f2d9d72
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 2f5309ccf119b54a98d134104565157fe103c33333c6193722f015eead15a422042cc7648bdd3f0fa6136cb7b45cc11b7f7a61ad6ed191f1a7480abbb5eebef1
|
7
|
+
data.tar.gz: 8dc69e5f0c5dd463220a90f9fb7d1a6bab86c138b296720c807d6a3e181ec0a161930914144631bf4d0e13ea13080d1b63344b9a25338f6c6adcd4ef54eefea5
|
data/.gitignore
ADDED
data/.rspec
ADDED
data/.rubocop.yml
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
require:
|
2
|
+
- rubocop-rspec
|
3
|
+
|
4
|
+
AllCops:
|
5
|
+
TargetRubyVersion: 2.4
|
6
|
+
|
7
|
+
Style/FileName:
|
8
|
+
Exclude:
|
9
|
+
- bin/*
|
10
|
+
|
11
|
+
Metrics/LineLength:
|
12
|
+
Max: 120
|
13
|
+
|
14
|
+
Metrics/ClassLength:
|
15
|
+
Max: 130
|
16
|
+
|
17
|
+
Bundler/OrderedGems:
|
18
|
+
Enabled: false
|
19
|
+
|
20
|
+
Layout/SpaceInsideHashLiteralBraces:
|
21
|
+
Enabled: false
|
data/.ruby-version
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
2.4
|
data/.travis.yml
ADDED
data/Gemfile
ADDED
data/LICENSE.txt
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Copyright (c) 2017 Latheesh Padukana
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in
|
13
|
+
all copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
21
|
+
THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,39 @@
|
|
1
|
+
# Zn
|
2
|
+
|
3
|
+
Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/zn`. To experiment with that code, run `bin/console` for an interactive prompt.
|
4
|
+
|
5
|
+
TODO: Delete this and the text above, and describe your gem
|
6
|
+
|
7
|
+
## Installation
|
8
|
+
|
9
|
+
Add this line to your application's Gemfile:
|
10
|
+
|
11
|
+
```ruby
|
12
|
+
gem 'zn'
|
13
|
+
```
|
14
|
+
|
15
|
+
And then execute:
|
16
|
+
|
17
|
+
$ bundle
|
18
|
+
|
19
|
+
Or install it yourself as:
|
20
|
+
|
21
|
+
$ gem install zn
|
22
|
+
|
23
|
+
## Usage
|
24
|
+
|
25
|
+
TODO: Write usage instructions here
|
26
|
+
|
27
|
+
## Development
|
28
|
+
|
29
|
+
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|
30
|
+
|
31
|
+
To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
|
32
|
+
|
33
|
+
## Contributing
|
34
|
+
|
35
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/lpadukana/zn.
|
36
|
+
|
37
|
+
## License
|
38
|
+
|
39
|
+
The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
|
data/Rakefile
ADDED
data/bin/console
ADDED
@@ -0,0 +1,12 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
# frozen_string_literal: true
|
4
|
+
|
5
|
+
require 'bundler/setup'
|
6
|
+
require 'zn'
|
7
|
+
|
8
|
+
# You can add fixtures and/or initialization code here to make experimenting
|
9
|
+
# with your gem easier. You can also use a different console, if you like.
|
10
|
+
|
11
|
+
require 'pry'
|
12
|
+
Pry.start
|
data/bin/setup
ADDED
data/bin/style-check
ADDED
data/bin/test
ADDED
data/exe/zn
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
# frozen_string_literal: true
|
4
|
+
|
5
|
+
exe_dir = File.expand_path(File.dirname(__FILE__))
|
6
|
+
lib_dir = File.expand_path(File.join(exe_dir, '../lib'))
|
7
|
+
$LOAD_PATH.unshift(lib_dir)
|
8
|
+
$LOAD_PATH.uniq!
|
9
|
+
|
10
|
+
Signal.trap('SIGPIPE', 'SYSTEM_DEFAULT')
|
11
|
+
|
12
|
+
require 'zn/cli'
|
13
|
+
|
14
|
+
Zn::Cli.run
|
data/lib/zn.rb
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Zn
|
4
|
+
module Associators
|
5
|
+
# BelongsTo associator helps define belongs_to relations between objects
|
6
|
+
class BelongsTo
|
7
|
+
attr_reader :datasets, :dataset_name, :foreign_key, :primary_key, :dataset, :repo
|
8
|
+
|
9
|
+
def initialize(datasets, params)
|
10
|
+
@datasets = datasets
|
11
|
+
@dataset_name = params.fetch('dataset')
|
12
|
+
@foreign_key = params.fetch('foreign_key')
|
13
|
+
@primary_key = params.fetch('primary_key')
|
14
|
+
end
|
15
|
+
|
16
|
+
def associate(object)
|
17
|
+
@dataset ||= datasets.fetch(dataset_name)
|
18
|
+
dataset.search(key: primary_key, value: object[foreign_key], exact: true).to_a.first
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
@@ -0,0 +1,23 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Zn
|
4
|
+
module Associators
|
5
|
+
# HasMany associator helps define has_many relations between objects
|
6
|
+
class HasMany
|
7
|
+
attr_reader :datasets, :dataset_name, :foreign_key, :primary_key, :dataset, :repo
|
8
|
+
|
9
|
+
def initialize(datasets, params)
|
10
|
+
@datasets = datasets
|
11
|
+
@dataset_name = params.fetch('dataset')
|
12
|
+
@foreign_key = params.fetch('foreign_key')
|
13
|
+
@primary_key = params.fetch('primary_key')
|
14
|
+
end
|
15
|
+
|
16
|
+
def associate(object)
|
17
|
+
@dataset ||= datasets.fetch(dataset_name)
|
18
|
+
|
19
|
+
dataset.search(key: foreign_key, value: object.fetch(primary_key), exact: true).to_a
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
data/lib/zn/cli.rb
ADDED
@@ -0,0 +1,82 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'clamp'
|
4
|
+
require 'json'
|
5
|
+
require 'zn/dataset'
|
6
|
+
require 'zn/search_assembly'
|
7
|
+
require 'zn/search_assembler'
|
8
|
+
require 'zn/repos/json_repo'
|
9
|
+
require 'zn/associators/has_many'
|
10
|
+
require 'zn/associators/belongs_to'
|
11
|
+
|
12
|
+
module Zn
|
13
|
+
# Cli composes a default search assembly and provides a CLI
|
14
|
+
class Cli < Clamp::Command
|
15
|
+
def search_assembly(config_file)
|
16
|
+
assembly = Zn::SearchAssembly.new
|
17
|
+
assembler = Zn::SearchAssembler.new(assembly)
|
18
|
+
assembler.register_repo_class(:json, Zn::Repos::JsonRepo)
|
19
|
+
assembler.register_associator_class(:has_many, Zn::Associators::HasMany)
|
20
|
+
assembler.register_associator_class(:belongs_to, Zn::Associators::BelongsTo)
|
21
|
+
assembler.assemble(config_file)
|
22
|
+
assembly
|
23
|
+
end
|
24
|
+
|
25
|
+
subcommand 'search', 'Search the text in values of the given key' do
|
26
|
+
option ['--exact', '-e'], :flag, 'Search for exact value'
|
27
|
+
option ['--dataset', '-d'], 'DATASET', 'Dataset to search', required: true
|
28
|
+
option ['--key', '-k'], 'KEY', 'Key to search under', required: true
|
29
|
+
option ['--value', '-v'], 'VALUE', 'Search value', required: true
|
30
|
+
option ['--config-file', '-c'], 'CONFIG_FILE', 'Config that defines datasets',
|
31
|
+
required: true, environment_variable: 'ZN_CONFIG_FILE'
|
32
|
+
|
33
|
+
def execute
|
34
|
+
search_assembly(config_file).search(dataset: dataset, key: key, value: value, exact: exact?) do |entity|
|
35
|
+
puts entity.to_json
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
39
|
+
|
40
|
+
subcommand 'associate', 'Find associated entities' do
|
41
|
+
option ['--dataset', '-d'], 'DATASET', 'Dataset to associate from', required: true
|
42
|
+
option ['--config-file', '-c'], 'CONFIG_FILE', 'Config that defines datasets',
|
43
|
+
required: true, environment_variable: 'ZN_CONFIG_FILE'
|
44
|
+
|
45
|
+
def execute
|
46
|
+
entities = STDIN.map do |line|
|
47
|
+
JSON.parse(line)
|
48
|
+
end
|
49
|
+
|
50
|
+
search_assembly(config_file).associate(entities, dataset: dataset) do |entity|
|
51
|
+
puts entity.to_json
|
52
|
+
end
|
53
|
+
end
|
54
|
+
end
|
55
|
+
|
56
|
+
subcommand 'list-keys', 'List keys in a dataset' do
|
57
|
+
option ['--dataset', '-d'], 'DATASET', 'Dataset to search', required: true
|
58
|
+
option ['--config-file', '-c'], 'CONFIG_FILE', 'Config that defines datasets',
|
59
|
+
required: true, environment_variable: 'ZN_CONFIG_FILE'
|
60
|
+
|
61
|
+
def execute
|
62
|
+
puts search_assembly(config_file).list_keys(dataset: dataset)
|
63
|
+
end
|
64
|
+
end
|
65
|
+
|
66
|
+
subcommand 'list-datasets', 'List known datasets' do
|
67
|
+
option ['--config-file', '-c'], 'CONFIG_FILE', 'Config that defines datasets', required: true
|
68
|
+
|
69
|
+
def execute
|
70
|
+
puts search_assembly(config_file).list_datasets
|
71
|
+
end
|
72
|
+
end
|
73
|
+
|
74
|
+
subcommand 'prettify-json', 'Pretty print JSON' do
|
75
|
+
def execute
|
76
|
+
STDIN.each do |line|
|
77
|
+
puts JSON.pretty_generate(JSON.parse(line))
|
78
|
+
end
|
79
|
+
end
|
80
|
+
end
|
81
|
+
end
|
82
|
+
end
|
data/lib/zn/dataset.rb
ADDED
@@ -0,0 +1,46 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'forwardable'
|
4
|
+
|
5
|
+
module Zn
|
6
|
+
# Holds repo, associators and performs aggregate operations
|
7
|
+
class Dataset
|
8
|
+
extend Forwardable
|
9
|
+
attr_reader :repo, :associators
|
10
|
+
|
11
|
+
def initialize(repo)
|
12
|
+
@repo = repo
|
13
|
+
@associators = {}
|
14
|
+
end
|
15
|
+
|
16
|
+
def add_associator(name, associator)
|
17
|
+
@associators[name] = associator
|
18
|
+
end
|
19
|
+
|
20
|
+
def keys
|
21
|
+
keys = Set.new
|
22
|
+
|
23
|
+
repo.all.each do |entity|
|
24
|
+
keys = keys.merge entity.keys
|
25
|
+
end
|
26
|
+
|
27
|
+
keys.to_a
|
28
|
+
end
|
29
|
+
|
30
|
+
def associations(entity)
|
31
|
+
associators.each_with_object({}) do |(name, associator), hash|
|
32
|
+
hash[name] = associator.associate(entity)
|
33
|
+
end
|
34
|
+
end
|
35
|
+
|
36
|
+
def associate(entities)
|
37
|
+
return enum_for(:associate, entities) unless block_given?
|
38
|
+
|
39
|
+
entities.each do |entity|
|
40
|
+
yield entity, associations(entity)
|
41
|
+
end
|
42
|
+
end
|
43
|
+
|
44
|
+
delegate search: :@repo
|
45
|
+
end
|
46
|
+
end
|
@@ -0,0 +1,54 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'multi_json'
|
4
|
+
require 'jq/extend'
|
5
|
+
|
6
|
+
module Zn
|
7
|
+
module Repos
|
8
|
+
# JsonRepo abstracts loading of external json data. For more demanding
|
9
|
+
# datasets, repos of other nature can be created later as needed. Examples
|
10
|
+
# of this include loading data asynchronously from json files, loading data
|
11
|
+
# from a database, elasticsearch, etc.
|
12
|
+
class JsonRepo
|
13
|
+
def initialize(params)
|
14
|
+
dir = params.fetch('dir', '.')
|
15
|
+
|
16
|
+
Dir.chdir(dir) do
|
17
|
+
@io = File.new(params.fetch('file'))
|
18
|
+
end
|
19
|
+
end
|
20
|
+
|
21
|
+
def all
|
22
|
+
@all ||= MultiJson.load(@io)
|
23
|
+
end
|
24
|
+
|
25
|
+
def search(params)
|
26
|
+
return enum_for(:search, params) unless block_given?
|
27
|
+
|
28
|
+
key = params.fetch(:key)
|
29
|
+
value = params.fetch(:value)
|
30
|
+
exact = params.fetch(:exact)
|
31
|
+
|
32
|
+
query = exact ? search_exact_query(key, value) : search_query(key, value)
|
33
|
+
|
34
|
+
all.jq(query).map do |result|
|
35
|
+
yield result
|
36
|
+
end
|
37
|
+
end
|
38
|
+
|
39
|
+
private
|
40
|
+
|
41
|
+
def search_query(key, sub_string)
|
42
|
+
if sub_string.to_s.empty?
|
43
|
+
".[] | select(.#{key}|tostring == \"\")"
|
44
|
+
else
|
45
|
+
".[] | select(.#{key}|tostring | contains(\"#{sub_string}\"))"
|
46
|
+
end
|
47
|
+
end
|
48
|
+
|
49
|
+
def search_exact_query(key, value)
|
50
|
+
".[] | select(.#{key}|tostring == \"#{value}\")"
|
51
|
+
end
|
52
|
+
end
|
53
|
+
end
|
54
|
+
end
|
@@ -0,0 +1,56 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'yaml'
|
4
|
+
|
5
|
+
module Zn
|
6
|
+
# Assembles search assembly from config and registered classes
|
7
|
+
class SearchAssembler
|
8
|
+
attr_reader :config_root, :assembly
|
9
|
+
|
10
|
+
def initialize(assembly)
|
11
|
+
@assembly = assembly
|
12
|
+
@repos = {}
|
13
|
+
@associators = {}
|
14
|
+
end
|
15
|
+
|
16
|
+
def register_repo_class(name, repo_class)
|
17
|
+
@repos[name] = repo_class
|
18
|
+
end
|
19
|
+
|
20
|
+
def assemble_repo(repo_params)
|
21
|
+
type = repo_params.fetch('type').to_sym
|
22
|
+
klass = @repos.fetch(type)
|
23
|
+
klass.new(repo_params.merge('dir' => @config_root))
|
24
|
+
end
|
25
|
+
|
26
|
+
def register_associator_class(name, associator_class)
|
27
|
+
@associators[name] = associator_class
|
28
|
+
end
|
29
|
+
|
30
|
+
def assemble_associator(association_params)
|
31
|
+
type = association_params.fetch('type').to_sym
|
32
|
+
klass = @associators.fetch(type)
|
33
|
+
klass.new(assembly.datasets, association_params)
|
34
|
+
end
|
35
|
+
|
36
|
+
def assemble_datasets(dataset_definitions)
|
37
|
+
dataset_definitions.each do |dataset_name, dataset_params|
|
38
|
+
repo = assemble_repo(dataset_params.fetch('repo'))
|
39
|
+
dataset = Dataset.new(repo)
|
40
|
+
|
41
|
+
dataset_params.fetch('associations').each do |associator_name, associator_params|
|
42
|
+
dataset.add_associator(associator_name, assemble_associator(associator_params))
|
43
|
+
end
|
44
|
+
|
45
|
+
@assembly.add_dataset(dataset_name, dataset)
|
46
|
+
end
|
47
|
+
end
|
48
|
+
|
49
|
+
def assemble(config_yml)
|
50
|
+
config = YAML.load_file(config_yml)
|
51
|
+
@config_root = File.dirname(config_yml)
|
52
|
+
dataset_definitions = config.fetch('datasets')
|
53
|
+
assemble_datasets(dataset_definitions)
|
54
|
+
end
|
55
|
+
end
|
56
|
+
end
|
@@ -0,0 +1,47 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Zn
|
4
|
+
# Provides a higher level API for search and relational logic
|
5
|
+
class SearchAssembly
|
6
|
+
attr_reader :datasets
|
7
|
+
|
8
|
+
def initialize
|
9
|
+
@datasets = {}
|
10
|
+
end
|
11
|
+
|
12
|
+
def add_dataset(name, dataset)
|
13
|
+
@datasets[name] = dataset
|
14
|
+
end
|
15
|
+
|
16
|
+
def dataset_names
|
17
|
+
datasets.keys
|
18
|
+
end
|
19
|
+
|
20
|
+
def dataset_keys(options)
|
21
|
+
dataset(options).keys
|
22
|
+
end
|
23
|
+
|
24
|
+
def associate(entities, options)
|
25
|
+
return enum_for(:associate, entities, options) unless block_given?
|
26
|
+
|
27
|
+
dataset(options).associate(entities) do |entity, associations|
|
28
|
+
yield entity.merge(associations)
|
29
|
+
end
|
30
|
+
end
|
31
|
+
|
32
|
+
def search(options)
|
33
|
+
return enum_for(:search, options) unless block_given?
|
34
|
+
|
35
|
+
dataset(options).search(options) do |result|
|
36
|
+
yield result
|
37
|
+
end
|
38
|
+
end
|
39
|
+
|
40
|
+
private
|
41
|
+
|
42
|
+
def dataset(options)
|
43
|
+
dataset_name = options.fetch(:dataset)
|
44
|
+
datasets.fetch(dataset_name)
|
45
|
+
end
|
46
|
+
end
|
47
|
+
end
|
data/lib/zn/version.rb
ADDED
data/zn.gemspec
ADDED
@@ -0,0 +1,41 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
lib = File.expand_path('../lib', __FILE__)
|
4
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
5
|
+
require 'zn/version'
|
6
|
+
|
7
|
+
Gem::Specification.new do |spec|
|
8
|
+
spec.name = 'zn'
|
9
|
+
spec.version = Zn::VERSION
|
10
|
+
spec.authors = ['Latheesh Padukana']
|
11
|
+
spec.email = ['latheeshp@gmail.com']
|
12
|
+
|
13
|
+
spec.summary = 'Search and relate JSON data sources'
|
14
|
+
spec.homepage = 'https://website.zn.todo'
|
15
|
+
spec.license = 'MIT'
|
16
|
+
|
17
|
+
# Prevent pushing this gem to RubyGems.org. To allow pushes either set the
|
18
|
+
# 'allowed_push_host' to allow pushing to a single host or delete this
|
19
|
+
# section to allow pushing to any host.
|
20
|
+
# spec.metadata['allowed_push_host'] = 'https://gemserver.zn.todo'
|
21
|
+
|
22
|
+
spec.files = `git ls-files -z`.split("\x0").reject do |f|
|
23
|
+
f.match(%r{^(test|spec|features)/})
|
24
|
+
end
|
25
|
+
|
26
|
+
spec.bindir = 'exe'
|
27
|
+
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
28
|
+
spec.require_paths = ['lib']
|
29
|
+
|
30
|
+
spec.add_dependency 'multi_json', '~> 1.12'
|
31
|
+
spec.add_dependency 'ruby-jq', '~> 0.1'
|
32
|
+
|
33
|
+
spec.add_development_dependency 'bundler', '~> 1.15'
|
34
|
+
spec.add_development_dependency 'rake', '~> 10.0'
|
35
|
+
spec.add_development_dependency 'rspec', '~> 3.0'
|
36
|
+
spec.add_development_dependency 'rubocop', '~> 0.49'
|
37
|
+
spec.add_development_dependency 'rubocop-rspec', '~> 1.15'
|
38
|
+
spec.add_development_dependency 'pry-byebug', '~> 3.4'
|
39
|
+
spec.add_development_dependency 'pry-stack_explorer', '~> 0.4.9'
|
40
|
+
spec.add_development_dependency 'pry-coolline', '~> 0.2'
|
41
|
+
end
|
metadata
ADDED
@@ -0,0 +1,209 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: zn
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Latheesh Padukana
|
8
|
+
autorequire:
|
9
|
+
bindir: exe
|
10
|
+
cert_chain: []
|
11
|
+
date: 2017-06-13 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: multi_json
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '1.12'
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '1.12'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: ruby-jq
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '0.1'
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '0.1'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: bundler
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - "~>"
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '1.15'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - "~>"
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '1.15'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: rake
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - "~>"
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '10.0'
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - "~>"
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '10.0'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: rspec
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - "~>"
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '3.0'
|
76
|
+
type: :development
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - "~>"
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '3.0'
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: rubocop
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - "~>"
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: '0.49'
|
90
|
+
type: :development
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - "~>"
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: '0.49'
|
97
|
+
- !ruby/object:Gem::Dependency
|
98
|
+
name: rubocop-rspec
|
99
|
+
requirement: !ruby/object:Gem::Requirement
|
100
|
+
requirements:
|
101
|
+
- - "~>"
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
version: '1.15'
|
104
|
+
type: :development
|
105
|
+
prerelease: false
|
106
|
+
version_requirements: !ruby/object:Gem::Requirement
|
107
|
+
requirements:
|
108
|
+
- - "~>"
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: '1.15'
|
111
|
+
- !ruby/object:Gem::Dependency
|
112
|
+
name: pry-byebug
|
113
|
+
requirement: !ruby/object:Gem::Requirement
|
114
|
+
requirements:
|
115
|
+
- - "~>"
|
116
|
+
- !ruby/object:Gem::Version
|
117
|
+
version: '3.4'
|
118
|
+
type: :development
|
119
|
+
prerelease: false
|
120
|
+
version_requirements: !ruby/object:Gem::Requirement
|
121
|
+
requirements:
|
122
|
+
- - "~>"
|
123
|
+
- !ruby/object:Gem::Version
|
124
|
+
version: '3.4'
|
125
|
+
- !ruby/object:Gem::Dependency
|
126
|
+
name: pry-stack_explorer
|
127
|
+
requirement: !ruby/object:Gem::Requirement
|
128
|
+
requirements:
|
129
|
+
- - "~>"
|
130
|
+
- !ruby/object:Gem::Version
|
131
|
+
version: 0.4.9
|
132
|
+
type: :development
|
133
|
+
prerelease: false
|
134
|
+
version_requirements: !ruby/object:Gem::Requirement
|
135
|
+
requirements:
|
136
|
+
- - "~>"
|
137
|
+
- !ruby/object:Gem::Version
|
138
|
+
version: 0.4.9
|
139
|
+
- !ruby/object:Gem::Dependency
|
140
|
+
name: pry-coolline
|
141
|
+
requirement: !ruby/object:Gem::Requirement
|
142
|
+
requirements:
|
143
|
+
- - "~>"
|
144
|
+
- !ruby/object:Gem::Version
|
145
|
+
version: '0.2'
|
146
|
+
type: :development
|
147
|
+
prerelease: false
|
148
|
+
version_requirements: !ruby/object:Gem::Requirement
|
149
|
+
requirements:
|
150
|
+
- - "~>"
|
151
|
+
- !ruby/object:Gem::Version
|
152
|
+
version: '0.2'
|
153
|
+
description:
|
154
|
+
email:
|
155
|
+
- latheeshp@gmail.com
|
156
|
+
executables:
|
157
|
+
- zn
|
158
|
+
extensions: []
|
159
|
+
extra_rdoc_files: []
|
160
|
+
files:
|
161
|
+
- ".gitignore"
|
162
|
+
- ".rspec"
|
163
|
+
- ".rubocop.yml"
|
164
|
+
- ".ruby-version"
|
165
|
+
- ".travis.yml"
|
166
|
+
- Gemfile
|
167
|
+
- LICENSE.txt
|
168
|
+
- README.md
|
169
|
+
- Rakefile
|
170
|
+
- bin/console
|
171
|
+
- bin/setup
|
172
|
+
- bin/style-check
|
173
|
+
- bin/test
|
174
|
+
- exe/zn
|
175
|
+
- lib/zn.rb
|
176
|
+
- lib/zn/associators/belongs_to.rb
|
177
|
+
- lib/zn/associators/has_many.rb
|
178
|
+
- lib/zn/cli.rb
|
179
|
+
- lib/zn/dataset.rb
|
180
|
+
- lib/zn/repos/json_repo.rb
|
181
|
+
- lib/zn/search_assembler.rb
|
182
|
+
- lib/zn/search_assembly.rb
|
183
|
+
- lib/zn/version.rb
|
184
|
+
- zn.gemspec
|
185
|
+
homepage: https://website.zn.todo
|
186
|
+
licenses:
|
187
|
+
- MIT
|
188
|
+
metadata: {}
|
189
|
+
post_install_message:
|
190
|
+
rdoc_options: []
|
191
|
+
require_paths:
|
192
|
+
- lib
|
193
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
194
|
+
requirements:
|
195
|
+
- - ">="
|
196
|
+
- !ruby/object:Gem::Version
|
197
|
+
version: '0'
|
198
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
199
|
+
requirements:
|
200
|
+
- - ">="
|
201
|
+
- !ruby/object:Gem::Version
|
202
|
+
version: '0'
|
203
|
+
requirements: []
|
204
|
+
rubyforge_project:
|
205
|
+
rubygems_version: 2.6.11
|
206
|
+
signing_key:
|
207
|
+
specification_version: 4
|
208
|
+
summary: Search and relate JSON data sources
|
209
|
+
test_files: []
|