openbd_api 0.2.1 → 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e1d694f9156475e10de3f1e8bc5c6de13209df01
4
- data.tar.gz: 85f3c02b54160ab9d5862796698bda8ff0fa2001
3
+ metadata.gz: 94982978119bb00a0a943e74c0a97983483090a3
4
+ data.tar.gz: 98f9d13e78555c18b393681c18f0d7fbfa459df9
5
5
  SHA512:
6
- metadata.gz: aa9ed71d1f9c1cd7b1fdd9dd12a97fc8ff5daa3a39a5bc69674de120f3c60c69474e0e429116207067e5a52af0897d722bc90e917adbf46fb0129dbfa731b0be
7
- data.tar.gz: c6ceebca63179d204d5fcb706138fe496546cb9b04a7a99b22aebf9c740ed4d5a5bbf71c5edb4d1f0818ed41ce4b4b4f75869336dd888b2d390976dfde4377f2
6
+ metadata.gz: fad167a8635b44d3952ca9f012316fceb0f07101cbcfaa73c9dc2600a340250ec97c0284b67a46c785e0f2eb14fd2d82d1e6a243c54296ed8b38c672d84e043e
7
+ data.tar.gz: 02f591f4d6913bf40272eb196d82d3fd40d512812f0da55ab171dff16fc5fffe056a831f0e648e2f93c9b07e03a13fa909c2bfde7dd5ead9cef8f0a85daa960a
@@ -4,7 +4,21 @@ class OpenbdCLI
4
4
  end
5
5
 
6
6
  def call
7
- if params.empty?
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
+ if method_name.nil?
20
+ puts opts
21
+ elsif params.empty?
8
22
  puts OpenBD.send(method_name)
9
23
  else
10
24
  puts OpenBD.send(method_name, params)
@@ -1,3 +1,3 @@
1
1
  module Openbd
2
- VERSION = "0.2.1"
2
+ VERSION = "0.3.0"
3
3
  end
data/lib/openbd_api.rb CHANGED
@@ -1,3 +1,5 @@
1
+ require 'slop'
2
+
1
3
  require 'openbd/version'
2
4
  require 'openbd/client'
3
5
  require 'openbd/openbd_cli'
data/openbd_api.gemspec CHANGED
@@ -24,4 +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.add_development_dependency "slop", "~> 4.4"
27
28
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: openbd_api
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - nasum
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-02-07 00:00:00.000000000 Z
11
+ date: 2017-02-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -52,6 +52,20 @@ dependencies:
52
52
  - - "~>"
53
53
  - !ruby/object:Gem::Version
54
54
  version: '3.0'
55
+ - !ruby/object:Gem::Dependency
56
+ name: slop
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - "~>"
60
+ - !ruby/object:Gem::Version
61
+ version: '4.4'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - "~>"
67
+ - !ruby/object:Gem::Version
68
+ version: '4.4'
55
69
  description: This gem wraps openBD Web API.
56
70
  email:
57
71
  - tomato.wonder.life@gmail.com