openbd_api 0.3.0 → 0.3.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +4 -0
- data/lib/openbd/openbd_cli.rb +18 -15
- data/lib/openbd/version.rb +1 -1
- data/openbd_api.gemspec +1 -1
- 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: 794a3669557afc7722f548062aed207891cdcd18
|
4
|
+
data.tar.gz: fbb1982d42e395a34c21a0e30b4217aab249de45
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ba82e049e17188af953aa58ee457385712db7278075a486e3cd83843842fa6176a8ffaa9142d35c89da4d1b633695192c52bcdba8d9b0b98d231f82a190711f9
|
7
|
+
data.tar.gz: f44775ee26d6130c3cccb845fd0ad17c82874bda2fb95a6634a017fed26c2854c38f42df52e61b9627632c0bd0bbd4440084ba3fc159824d1369f3aeaf4aaf5a
|
data/README.md
CHANGED
@@ -56,6 +56,10 @@ $ openbd get 9784309226712
|
|
56
56
|
$ openbd bulk_get 9784309226712 9784309226729
|
57
57
|
$ openbd coverage
|
58
58
|
$ openbd schema
|
59
|
+
$ openbd --help
|
60
|
+
Usage: openbd <method> [arguments] [options]
|
61
|
+
-v, --version print the version
|
62
|
+
-h, --help print help
|
59
63
|
```
|
60
64
|
|
61
65
|
## Contributing
|
data/lib/openbd/openbd_cli.rb
CHANGED
@@ -1,27 +1,16 @@
|
|
1
1
|
class OpenbdCLI
|
2
2
|
def initialize(argv)
|
3
3
|
@argv = argv
|
4
|
+
parse_option
|
4
5
|
end
|
5
6
|
|
6
7
|
def call
|
7
|
-
opts = Slop.parse do |o|
|
8
|
-
o.banner = "Usage: openbd <method> [arguments] [options]"
|
9
|
-
o.on '-v', '--version', 'print the version' do
|
10
|
-
puts "openbd_api #{Openbd::VERSION}"
|
11
|
-
exit
|
12
|
-
end
|
13
|
-
o.on '-h', '--help', 'print help' do
|
14
|
-
puts o
|
15
|
-
exit
|
16
|
-
end
|
17
|
-
end
|
18
|
-
|
19
8
|
if method_name.nil?
|
20
|
-
puts opts
|
9
|
+
puts @opts
|
21
10
|
elsif params.empty?
|
22
|
-
puts OpenBD.send(method_name)
|
11
|
+
puts OpenBD.send(method_name).to_json
|
23
12
|
else
|
24
|
-
puts OpenBD.send(method_name, params)
|
13
|
+
puts OpenBD.send(method_name, params).to_json
|
25
14
|
end
|
26
15
|
end
|
27
16
|
|
@@ -34,4 +23,18 @@ class OpenbdCLI
|
|
34
23
|
def params
|
35
24
|
@argv[1..-1]
|
36
25
|
end
|
26
|
+
|
27
|
+
def parse_option
|
28
|
+
@opts = Slop.parse do |o|
|
29
|
+
o.banner = "Usage: openbd <method> [arguments] [options]"
|
30
|
+
o.on '-v', '--version', 'print the version' do
|
31
|
+
puts "openbd_api #{Openbd::VERSION}"
|
32
|
+
exit
|
33
|
+
end
|
34
|
+
o.on '-h', '--help', 'print help' do
|
35
|
+
puts o
|
36
|
+
exit
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
37
40
|
end
|
data/lib/openbd/version.rb
CHANGED
data/openbd_api.gemspec
CHANGED
@@ -24,5 +24,5 @@ Gem::Specification.new do |spec|
|
|
24
24
|
spec.add_development_dependency "bundler", "~> 1.14"
|
25
25
|
spec.add_development_dependency "rake", "~> 10.0"
|
26
26
|
spec.add_development_dependency "rspec", "~> 3.0"
|
27
|
-
spec.
|
27
|
+
spec.add_runtime_dependency "slop", "~> 4.4"
|
28
28
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: openbd_api
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- nasum
|
@@ -59,7 +59,7 @@ dependencies:
|
|
59
59
|
- - "~>"
|
60
60
|
- !ruby/object:Gem::Version
|
61
61
|
version: '4.4'
|
62
|
-
type: :
|
62
|
+
type: :runtime
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|