kmdata 0.0.4 → 0.0.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/bin/kmdata +22 -8
  3. data/lib/kmdata/version.rb +1 -1
  4. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 55e10a655f1452b3e9c2ad2632aa1ac93e6eda1e
4
- data.tar.gz: ce654076ca18790927a9ca21babd6888d70cc057
3
+ metadata.gz: fe275b553265ef1de787fcd484aee7d9595915ae
4
+ data.tar.gz: 66a3fdbbeee1841293a47ee58e32200aeaef0682
5
5
  SHA512:
6
- metadata.gz: f5fac0f014f41fa56340f56ee7115d3f9465173a6b93a0a1255331ce7230d2b2f6ca9e04257b69aef73bec3f7b1468142558583eff37de83a0221325205d2243
7
- data.tar.gz: 936c53cdc5063a08ee1e590d4c32ecde778bab55a994378ea94dfc575a9fe802cab135c7fb58bcf2292c01adacbceb16da6c8c797d3c12fe1b451ccef9cc0825
6
+ metadata.gz: b014e840309c5190afd57db874c008b48fc7d7b24f07cfacee786c7fb0072e0beebfeaee2123c42cb723a9d64019f624167918d3069bbc0a3dd6ed93b0b32681
7
+ data.tar.gz: f8f0d1b45ad4024c7b5492ba41b0e244508ebddfcad4dcc1ad7bb83df359290003b026cd9af0301a9ed727d3e841e8df878cf7cbfd11c26dd3f00b101db2252c
data/bin/kmdata CHANGED
@@ -1,15 +1,29 @@
1
1
  #!/usr/bin/env ruby
2
2
 
3
3
  require 'kmdata'
4
+ require 'optparse'
4
5
  require 'pry'
5
- person = KMData.get("people", q: ARGV[0])
6
6
 
7
- if person.any?
8
- person.each do |p|
9
- puts "\n"
10
- p.to_h.each do |k, v|
11
- puts "#{k}: #{v}"
7
+ options = { model: 'people' }
8
+
9
+ OptionParser.new do |opts|
10
+ opts.banner = "Usage: kmdata [query] [options]"
11
+
12
+ opts.on("-m", "--model [MODEL]") do |m|
13
+ options[:model] = m
14
+ end
15
+ end.parse!
16
+
17
+ if ARGV[0]
18
+ results = KMData.get(options[:model], q: ARGV[0])
19
+
20
+ if results.any?
21
+ results.each do |object|
22
+ puts "\n"
23
+ object.to_h.each do |k, v|
24
+ puts "#{k}: #{v}"
25
+ end
12
26
  end
27
+ puts "\n"
13
28
  end
14
- puts "\n"
15
- end
29
+ end
@@ -1,3 +1,3 @@
1
1
  module KMData
2
- VERSION = "0.0.4"
2
+ VERSION = "0.0.5"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kmdata
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kyle Decot