kmdata 0.0.4 → 0.0.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/kmdata +22 -8
- data/lib/kmdata/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fe275b553265ef1de787fcd484aee7d9595915ae
|
4
|
+
data.tar.gz: 66a3fdbbeee1841293a47ee58e32200aeaef0682
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
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
|
-
|
15
|
-
end
|
29
|
+
end
|
data/lib/kmdata/version.rb
CHANGED