richard-cli 1.1.0 → 1.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +13 -5
- data/bin/richard +4 -0
- data/lib/richard.rb +12 -0
- data/lib/richard/version.rb +1 -1
- data/richard-cli.gemspec +4 -4
- metadata +25 -25
checksums.yaml
CHANGED
@@ -1,7 +1,15 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
|
2
|
+
!binary "U0hBMQ==":
|
3
|
+
metadata.gz: !binary |-
|
4
|
+
NWM3ZDA1MGU0YWQzMjQyMGU4NzU0NmFlNGI0ZGVmMTM2NzZiYWMyZA==
|
5
|
+
data.tar.gz: !binary |-
|
6
|
+
MjdhNTkxOTE3MDVjODFjYjg4MGJiNWVmNzc1MDVmZTczOWQwMDViMw==
|
5
7
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
|
8
|
+
metadata.gz: !binary |-
|
9
|
+
ZjI2Zjg5MDJjNTQ1OThiYjMxMjBhM2Q0ZmVkNTk5NGQ5Y2JkZjllYmJjZDQw
|
10
|
+
NGI0OTBiNDA5MGViOTMzZmZiZDE5YTY4YmVmOGYxODU0MDFmNzgwNmI2OGVk
|
11
|
+
MTIxMzNmN2RlNThkYjI3MTY4NmNkMzAyNTNhNjNjNzBlYzZiNGI=
|
12
|
+
data.tar.gz: !binary |-
|
13
|
+
MWM0NjA1OWE3NjdiZjIwMWM4OTYwNzYwMmYzMDA0NTI2OTE2ZGFjYjQ4Yzc2
|
14
|
+
OTM5YTlkOTRmZTA5Y2VmYmYxMjhkOWZkNjdhNGUzMDg4MGQwYTY0YzQ0YTA4
|
15
|
+
OGNjMDk4MmJhZWRhMDZlYTZjZDQyMzQ5MTc4NmMxZDBmOTc1M2E=
|
data/bin/richard
CHANGED
@@ -13,6 +13,7 @@ Commands:
|
|
13
13
|
grab - Add yourself to the queue
|
14
14
|
release - Removes you from the queue
|
15
15
|
force_release - Force releases another user. The user_id must be provided.
|
16
|
+
is_it_my_turn - Returns 'Yes' or 'No'. It also returns status code 0 for 'Yes' and -1 for 'No'
|
16
17
|
EOS
|
17
18
|
end
|
18
19
|
|
@@ -39,6 +40,9 @@ when 'force_release'
|
|
39
40
|
print_usage
|
40
41
|
end
|
41
42
|
|
43
|
+
when 'is_it_my_turn'
|
44
|
+
server.is_it_my_turn
|
45
|
+
|
42
46
|
else
|
43
47
|
print_usage
|
44
48
|
end
|
data/lib/richard.rb
CHANGED
@@ -32,6 +32,18 @@ module Richard
|
|
32
32
|
print_result(RestClient.get(@base_url + "/?format=json&api_key=#{@api_key}"))
|
33
33
|
end
|
34
34
|
|
35
|
+
def is_it_my_turn
|
36
|
+
response = JSON.parse(RestClient.get(@base_url + "/queue/status?format=json&api_key=#{@api_key}"))
|
37
|
+
|
38
|
+
if response['content']['queue_transaction']['status'] == 'running'
|
39
|
+
puts 'yes'
|
40
|
+
exit 0
|
41
|
+
else
|
42
|
+
puts 'no'
|
43
|
+
exit -1
|
44
|
+
end
|
45
|
+
end
|
46
|
+
|
35
47
|
private
|
36
48
|
|
37
49
|
def send_command(url)
|
data/lib/richard/version.rb
CHANGED
data/richard-cli.gemspec
CHANGED
@@ -21,8 +21,8 @@ Gem::Specification.new do |spec|
|
|
21
21
|
spec.add_development_dependency "bundler", "~> 1.6"
|
22
22
|
spec.add_development_dependency "rake", "~> 10.0"
|
23
23
|
|
24
|
-
spec.add_dependency "json"
|
25
|
-
spec.add_dependency "rest-client"
|
26
|
-
spec.add_dependency "highline"
|
27
|
-
spec.add_dependency "terminal-table"
|
24
|
+
spec.add_dependency "json"
|
25
|
+
spec.add_dependency "rest-client"
|
26
|
+
spec.add_dependency "highline"
|
27
|
+
spec.add_dependency "terminal-table"
|
28
28
|
end
|
metadata
CHANGED
@@ -1,99 +1,99 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: richard-cli
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Adam Kerr
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-08-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- -
|
17
|
+
- - ~>
|
18
18
|
- !ruby/object:Gem::Version
|
19
19
|
version: '1.6'
|
20
20
|
type: :development
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- -
|
24
|
+
- - ~>
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '1.6'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: rake
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- -
|
31
|
+
- - ~>
|
32
32
|
- !ruby/object:Gem::Version
|
33
33
|
version: '10.0'
|
34
34
|
type: :development
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
|
-
- -
|
38
|
+
- - ~>
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '10.0'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: json
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
|
-
- -
|
45
|
+
- - ! '>='
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version: '
|
47
|
+
version: '0'
|
48
48
|
type: :runtime
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
|
-
- -
|
52
|
+
- - ! '>='
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version: '
|
54
|
+
version: '0'
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: rest-client
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
|
-
- -
|
59
|
+
- - ! '>='
|
60
60
|
- !ruby/object:Gem::Version
|
61
|
-
version: '
|
61
|
+
version: '0'
|
62
62
|
type: :runtime
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
|
-
- -
|
66
|
+
- - ! '>='
|
67
67
|
- !ruby/object:Gem::Version
|
68
|
-
version: '
|
68
|
+
version: '0'
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: highline
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
72
72
|
requirements:
|
73
|
-
- -
|
73
|
+
- - ! '>='
|
74
74
|
- !ruby/object:Gem::Version
|
75
|
-
version: '
|
75
|
+
version: '0'
|
76
76
|
type: :runtime
|
77
77
|
prerelease: false
|
78
78
|
version_requirements: !ruby/object:Gem::Requirement
|
79
79
|
requirements:
|
80
|
-
- -
|
80
|
+
- - ! '>='
|
81
81
|
- !ruby/object:Gem::Version
|
82
|
-
version: '
|
82
|
+
version: '0'
|
83
83
|
- !ruby/object:Gem::Dependency
|
84
84
|
name: terminal-table
|
85
85
|
requirement: !ruby/object:Gem::Requirement
|
86
86
|
requirements:
|
87
|
-
- -
|
87
|
+
- - ! '>='
|
88
88
|
- !ruby/object:Gem::Version
|
89
|
-
version: '
|
89
|
+
version: '0'
|
90
90
|
type: :runtime
|
91
91
|
prerelease: false
|
92
92
|
version_requirements: !ruby/object:Gem::Requirement
|
93
93
|
requirements:
|
94
|
-
- -
|
94
|
+
- - ! '>='
|
95
95
|
- !ruby/object:Gem::Version
|
96
|
-
version: '
|
96
|
+
version: '0'
|
97
97
|
description: ''
|
98
98
|
email:
|
99
99
|
- adamk@nulogy.com
|
@@ -102,7 +102,7 @@ executables:
|
|
102
102
|
extensions: []
|
103
103
|
extra_rdoc_files: []
|
104
104
|
files:
|
105
|
-
-
|
105
|
+
- .gitignore
|
106
106
|
- Gemfile
|
107
107
|
- LICENSE.txt
|
108
108
|
- README.md
|
@@ -125,12 +125,12 @@ require_paths:
|
|
125
125
|
- lib
|
126
126
|
required_ruby_version: !ruby/object:Gem::Requirement
|
127
127
|
requirements:
|
128
|
-
- -
|
128
|
+
- - ! '>='
|
129
129
|
- !ruby/object:Gem::Version
|
130
130
|
version: '0'
|
131
131
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
132
132
|
requirements:
|
133
|
-
- -
|
133
|
+
- - ! '>='
|
134
134
|
- !ruby/object:Gem::Version
|
135
135
|
version: '0'
|
136
136
|
requirements: []
|