karotz 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- data/.document +2 -0
- data/.specfile +1 -0
- data/.travis.yml +13 -0
- data/Guardfile +5 -0
- data/README.rdoc +19 -0
- data/Rakefile +10 -0
- data/karotz.gemspec +6 -0
- data/lib/karotz/client.rb +30 -11
- data/lib/karotz/colors.rb +14 -0
- data/lib/karotz/configuration.rb +45 -0
- data/lib/karotz/version.rb +1 -1
- data/lib/karotz.rb +2 -4
- data/spec/cassettes/karotz/client_ears_should_look_sad.yml +18 -0
- data/spec/cassettes/karotz/client_ears_should_make_the_bull.yml +18 -0
- data/spec/cassettes/karotz/client_ears_should_reset_the_ears.yml +18 -0
- data/spec/cassettes/karotz/client_ears_should_wiggle_the_ears.yml +18 -0
- data/spec/cassettes/karotz/client_interactivemode_should_stop_the_mode.yml +18 -0
- data/spec/cassettes/karotz/client_led_should_fade.yml +18 -0
- data/spec/cassettes/karotz/client_led_should_light.yml +18 -0
- data/spec/cassettes/karotz/client_led_should_pulse.yml +18 -0
- data/spec/karotz_spec.rb +35 -22
- data/spec/spec_helper.rb +37 -1
- metadata +79 -13
- data/README +0 -3
data/.document
ADDED
data/.specfile
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
--color
|
data/.travis.yml
ADDED
data/Guardfile
ADDED
data/README.rdoc
ADDED
@@ -0,0 +1,19 @@
|
|
1
|
+
== Info
|
2
|
+
|
3
|
+
Status: http://stillmaintained.com/phoet/karotz.png
|
4
|
+
Build: http://travis-ci.org/phoet/karotz.png
|
5
|
+
|
6
|
+
This gem is still in early development.
|
7
|
+
|
8
|
+
== Docs
|
9
|
+
|
10
|
+
Right now, please have a look at the specs for usage examples.
|
11
|
+
|
12
|
+
Supported methods:
|
13
|
+
|
14
|
+
* ears
|
15
|
+
* led
|
16
|
+
|
17
|
+
== Todos
|
18
|
+
|
19
|
+
* add color mixing method for RGB usage
|
data/Rakefile
CHANGED
data/karotz.gemspec
CHANGED
@@ -17,10 +17,16 @@ Gem::Specification.new do |s|
|
|
17
17
|
s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
|
18
18
|
s.require_paths = ["lib"]
|
19
19
|
|
20
|
+
s.add_development_dependency "rake"
|
20
21
|
s.add_development_dependency "rspec"
|
21
22
|
s.add_development_dependency "pry"
|
23
|
+
s.add_development_dependency "guard-rspec"
|
24
|
+
s.add_development_dependency "webmock"
|
25
|
+
s.add_development_dependency "vcr"
|
22
26
|
|
23
27
|
s.add_runtime_dependency "httpclient"
|
24
28
|
s.add_runtime_dependency "httpi"
|
25
29
|
s.add_runtime_dependency "crack"
|
30
|
+
|
31
|
+
s.add_runtime_dependency('jruby-openssl') if RUBY_PLATFORM == 'java'
|
26
32
|
end
|
data/lib/karotz/client.rb
CHANGED
@@ -1,10 +1,12 @@
|
|
1
|
+
require 'uri'
|
1
2
|
require 'base64'
|
2
3
|
require 'httpi'
|
3
|
-
require 'uri'
|
4
4
|
require 'httpclient'
|
5
|
+
require 'crack'
|
5
6
|
|
6
7
|
module Karotz
|
7
8
|
class Client
|
9
|
+
|
8
10
|
API = "http://api.karotz.com/api/karotz/"
|
9
11
|
DIGEST = OpenSSL::Digest::Digest.new('sha1')
|
10
12
|
|
@@ -18,29 +20,46 @@ module Karotz
|
|
18
20
|
query = create_query(params)
|
19
21
|
hmac = OpenSSL::HMAC.digest(DIGEST, secret, query)
|
20
22
|
signed = Base64.encode64(hmac).strip
|
21
|
-
|
22
|
-
url
|
23
|
+
"#{API}start?#{query}&signature=#{URI.encode(signed)}"
|
23
24
|
end
|
24
25
|
|
25
26
|
def self.ears(interactive_id, params={:reset => true})
|
26
|
-
|
27
|
-
HTTPI.get "#{API}ears?#{create_query({ :interactiveid => interactive_id }.merge(params))}"
|
27
|
+
request :ears, interactive_id, params
|
28
28
|
end
|
29
29
|
|
30
|
+
#============LED================
|
30
31
|
|
31
|
-
def self.led(interactive_id, params={:action => :pulse, :color =>
|
32
|
-
|
33
|
-
|
32
|
+
def self.led(interactive_id, params={:action => :pulse, :color => Color::BLUE, :period => 3000, :pulse => 500})
|
33
|
+
request :led, interactive_id, params
|
34
|
+
end
|
35
|
+
|
36
|
+
def self.fade(interactive_id, params={:color => Color::BLUE, :period => 3000})
|
37
|
+
request :led, interactive_id, {:action => :fade}.merge(params)
|
34
38
|
end
|
35
|
-
|
39
|
+
|
40
|
+
def self.light(interactive_id, params={:color => Color::BLUE})
|
41
|
+
request :led, interactive_id, {:action => :light}.merge(params)
|
42
|
+
end
|
43
|
+
|
44
|
+
#============LIFE_CYCLE=========
|
45
|
+
|
36
46
|
def self.interactivemode(interactive_id, params={:action => :stop})
|
37
|
-
|
47
|
+
request :interactivemode, interactive_id, params
|
38
48
|
end
|
39
49
|
|
40
50
|
private()
|
41
51
|
|
52
|
+
def self.request(endpoint, interactive_id, params={})
|
53
|
+
raise "interactive_id is needed!" unless interactive_id
|
54
|
+
raise "endpoint is needed!" unless endpoint
|
55
|
+
url = "#{API}#{endpoint}?#{create_query({ :interactiveid => interactive_id }.merge(params))}"
|
56
|
+
response = HTTPI.get(url)
|
57
|
+
answer = Crack::XML.parse(response.body)
|
58
|
+
raise "bad response from server" unless answer["VoosMsg"]["response"]["code"] == "OK"
|
59
|
+
end
|
60
|
+
|
42
61
|
def self.create_query(params)
|
43
|
-
params.
|
62
|
+
params.map { |key, value| "#{key}=#{URI.encode(value.to_s)}" }.sort.join('&')
|
44
63
|
end
|
45
64
|
|
46
65
|
end
|
@@ -0,0 +1,45 @@
|
|
1
|
+
module Karotz
|
2
|
+
class Configuration
|
3
|
+
class << self
|
4
|
+
|
5
|
+
attr_accessor :install_id, :api_key, :secret
|
6
|
+
attr_accessor :logger
|
7
|
+
|
8
|
+
def configure(options={})
|
9
|
+
init_config
|
10
|
+
if block_given?
|
11
|
+
yield self
|
12
|
+
else
|
13
|
+
options.each do |key, value|
|
14
|
+
send(:"#{key}=", value)
|
15
|
+
end
|
16
|
+
end
|
17
|
+
self
|
18
|
+
end
|
19
|
+
|
20
|
+
def validate_credentials!
|
21
|
+
raise "you have to configure Karotz: 'configure :install_id => 'your-install-id', :api_key => 'your-api-key', :secret => 'your-secret'" if blank?(:api_key) || blank?(:secret) || blank?(:install_id)
|
22
|
+
end
|
23
|
+
|
24
|
+
def reset
|
25
|
+
init_config(true)
|
26
|
+
end
|
27
|
+
|
28
|
+
def blank?(key)
|
29
|
+
val = self.send :key
|
30
|
+
val.nil? || val.empty?
|
31
|
+
end
|
32
|
+
|
33
|
+
private()
|
34
|
+
|
35
|
+
def init_config(force=false)
|
36
|
+
return if @init && !force
|
37
|
+
@init = true
|
38
|
+
@secret = ''
|
39
|
+
@api_key = ''
|
40
|
+
@install_id = ''
|
41
|
+
@logger = Logger.new(STDERR)
|
42
|
+
end
|
43
|
+
end
|
44
|
+
end
|
45
|
+
end
|
data/lib/karotz/version.rb
CHANGED
data/lib/karotz.rb
CHANGED
@@ -0,0 +1,18 @@
|
|
1
|
+
---
|
2
|
+
- !ruby/struct:VCR::HTTPInteraction
|
3
|
+
request: !ruby/struct:VCR::Request
|
4
|
+
method: :get
|
5
|
+
uri: http://api.karotz.com:80/api/karotz/ears?interactiveid=25e76d1a-d60b-47c2-8832-95628f46ae1e&left=90&relative=false&right=90
|
6
|
+
body:
|
7
|
+
headers:
|
8
|
+
response: !ruby/struct:VCR::Response
|
9
|
+
status: !ruby/struct:VCR::ResponseStatus
|
10
|
+
code: 200
|
11
|
+
message: OK
|
12
|
+
headers:
|
13
|
+
content-length:
|
14
|
+
- '255'
|
15
|
+
connection:
|
16
|
+
- keep-alive
|
17
|
+
body: <VoosMsg><id>d1478c1c-c076-4716-b002-d5e9bc463cb1</id><correlationId>713104f0-5ce8-4478-b6df-2c127700833c</correlationId><interactiveId>25e76d1a-d60b-47c2-8832-95628f46ae1e</interactiveId><callback></callback><response><code>OK</code></response></VoosMsg>
|
18
|
+
http_version: '1.1'
|
@@ -0,0 +1,18 @@
|
|
1
|
+
---
|
2
|
+
- !ruby/struct:VCR::HTTPInteraction
|
3
|
+
request: !ruby/struct:VCR::Request
|
4
|
+
method: :get
|
5
|
+
uri: http://api.karotz.com:80/api/karotz/ears?interactiveid=25e76d1a-d60b-47c2-8832-95628f46ae1e&left=0&relative=false&right=0
|
6
|
+
body:
|
7
|
+
headers:
|
8
|
+
response: !ruby/struct:VCR::Response
|
9
|
+
status: !ruby/struct:VCR::ResponseStatus
|
10
|
+
code: 200
|
11
|
+
message: OK
|
12
|
+
headers:
|
13
|
+
content-length:
|
14
|
+
- '255'
|
15
|
+
connection:
|
16
|
+
- keep-alive
|
17
|
+
body: <VoosMsg><id>b5fcfc80-caeb-442c-88ee-8e914151d7db</id><correlationId>46b666fb-99e6-46f7-a64f-8edb14278708</correlationId><interactiveId>25e76d1a-d60b-47c2-8832-95628f46ae1e</interactiveId><callback></callback><response><code>OK</code></response></VoosMsg>
|
18
|
+
http_version: '1.1'
|
@@ -0,0 +1,18 @@
|
|
1
|
+
---
|
2
|
+
- !ruby/struct:VCR::HTTPInteraction
|
3
|
+
request: !ruby/struct:VCR::Request
|
4
|
+
method: :get
|
5
|
+
uri: http://api.karotz.com:80/api/karotz/ears?interactiveid=25e76d1a-d60b-47c2-8832-95628f46ae1e&reset=true
|
6
|
+
body:
|
7
|
+
headers:
|
8
|
+
response: !ruby/struct:VCR::Response
|
9
|
+
status: !ruby/struct:VCR::ResponseStatus
|
10
|
+
code: 200
|
11
|
+
message: OK
|
12
|
+
headers:
|
13
|
+
content-length:
|
14
|
+
- '255'
|
15
|
+
connection:
|
16
|
+
- keep-alive
|
17
|
+
body: <VoosMsg><id>b01b24eb-d868-4ab2-ba27-cd3cf71f1d9a</id><correlationId>8ebf64c2-ad5f-4373-99e7-bf64194c1178</correlationId><interactiveId>25e76d1a-d60b-47c2-8832-95628f46ae1e</interactiveId><callback></callback><response><code>OK</code></response></VoosMsg>
|
18
|
+
http_version: '1.1'
|
@@ -0,0 +1,18 @@
|
|
1
|
+
---
|
2
|
+
- !ruby/struct:VCR::HTTPInteraction
|
3
|
+
request: !ruby/struct:VCR::Request
|
4
|
+
method: :get
|
5
|
+
uri: http://api.karotz.com:80/api/karotz/ears?interactiveid=25e76d1a-d60b-47c2-8832-95628f46ae1e&reset=true
|
6
|
+
body:
|
7
|
+
headers:
|
8
|
+
response: !ruby/struct:VCR::Response
|
9
|
+
status: !ruby/struct:VCR::ResponseStatus
|
10
|
+
code: 200
|
11
|
+
message: OK
|
12
|
+
headers:
|
13
|
+
content-length:
|
14
|
+
- '255'
|
15
|
+
connection:
|
16
|
+
- keep-alive
|
17
|
+
body: <VoosMsg><id>52e32338-c923-48c5-8e44-caa976fdaf61</id><correlationId>bee9fd48-f156-46f7-b9b6-88cb8896770d</correlationId><interactiveId>25e76d1a-d60b-47c2-8832-95628f46ae1e</interactiveId><callback></callback><response><code>OK</code></response></VoosMsg>
|
18
|
+
http_version: '1.1'
|
@@ -0,0 +1,18 @@
|
|
1
|
+
---
|
2
|
+
- !ruby/struct:VCR::HTTPInteraction
|
3
|
+
request: !ruby/struct:VCR::Request
|
4
|
+
method: :get
|
5
|
+
uri: http://api.karotz.com:80/api/karotz/interactivemode?action=stop&interactiveid=25e76d1a-d60b-47c2-8832-95628f46ae1e
|
6
|
+
body:
|
7
|
+
headers:
|
8
|
+
response: !ruby/struct:VCR::Response
|
9
|
+
status: !ruby/struct:VCR::ResponseStatus
|
10
|
+
code: 200
|
11
|
+
message: OK
|
12
|
+
headers:
|
13
|
+
content-length:
|
14
|
+
- '255'
|
15
|
+
connection:
|
16
|
+
- keep-alive
|
17
|
+
body: <VoosMsg><id>bcfcf298-779d-4cad-aa5c-168b73747852</id><correlationId>8c07a721-0519-49c3-9f55-cdb21deae486</correlationId><interactiveId>25e76d1a-d60b-47c2-8832-95628f46ae1e</interactiveId><callback></callback><response><code>OK</code></response></VoosMsg>
|
18
|
+
http_version: '1.1'
|
@@ -0,0 +1,18 @@
|
|
1
|
+
---
|
2
|
+
- !ruby/struct:VCR::HTTPInteraction
|
3
|
+
request: !ruby/struct:VCR::Request
|
4
|
+
method: :get
|
5
|
+
uri: http://api.karotz.com:80/api/karotz/led?action=fade&color=77FF44&interactiveid=117c09d2-02b9-4b38-b64b-9b821ac7c91c&period=3000
|
6
|
+
body:
|
7
|
+
headers:
|
8
|
+
response: !ruby/struct:VCR::Response
|
9
|
+
status: !ruby/struct:VCR::ResponseStatus
|
10
|
+
code: 200
|
11
|
+
message: OK
|
12
|
+
headers:
|
13
|
+
content-length:
|
14
|
+
- '255'
|
15
|
+
connection:
|
16
|
+
- keep-alive
|
17
|
+
body: <VoosMsg><id>9cb2d118-f326-4894-a5e8-d2b84f55fa4f</id><correlationId>747d7bf4-66a4-4d1d-9daf-aa93a35c328c</correlationId><interactiveId>117c09d2-02b9-4b38-b64b-9b821ac7c91c</interactiveId><callback></callback><response><code>OK</code></response></VoosMsg>
|
18
|
+
http_version: '1.1'
|
@@ -0,0 +1,18 @@
|
|
1
|
+
---
|
2
|
+
- !ruby/struct:VCR::HTTPInteraction
|
3
|
+
request: !ruby/struct:VCR::Request
|
4
|
+
method: :get
|
5
|
+
uri: http://api.karotz.com:80/api/karotz/led?action=light&color=77FF44&interactiveid=117c09d2-02b9-4b38-b64b-9b821ac7c91c
|
6
|
+
body:
|
7
|
+
headers:
|
8
|
+
response: !ruby/struct:VCR::Response
|
9
|
+
status: !ruby/struct:VCR::ResponseStatus
|
10
|
+
code: 200
|
11
|
+
message: OK
|
12
|
+
headers:
|
13
|
+
content-length:
|
14
|
+
- '255'
|
15
|
+
connection:
|
16
|
+
- keep-alive
|
17
|
+
body: <VoosMsg><id>af7fde64-0603-4ef2-ae2e-b00e8d1632ca</id><correlationId>00af4913-7d7a-4d7e-b5f7-50d1b33cdfb3</correlationId><interactiveId>117c09d2-02b9-4b38-b64b-9b821ac7c91c</interactiveId><callback></callback><response><code>OK</code></response></VoosMsg>
|
18
|
+
http_version: '1.1'
|
@@ -0,0 +1,18 @@
|
|
1
|
+
---
|
2
|
+
- !ruby/struct:VCR::HTTPInteraction
|
3
|
+
request: !ruby/struct:VCR::Request
|
4
|
+
method: :get
|
5
|
+
uri: http://api.karotz.com:80/api/karotz/led?action=pulse&color=00FF00&interactiveid=25e76d1a-d60b-47c2-8832-95628f46ae1e&period=3000&pulse=500
|
6
|
+
body:
|
7
|
+
headers:
|
8
|
+
response: !ruby/struct:VCR::Response
|
9
|
+
status: !ruby/struct:VCR::ResponseStatus
|
10
|
+
code: 200
|
11
|
+
message: OK
|
12
|
+
headers:
|
13
|
+
content-length:
|
14
|
+
- '255'
|
15
|
+
connection:
|
16
|
+
- keep-alive
|
17
|
+
body: <VoosMsg><id>56e477b2-fc36-4210-a618-e4e3e21e78db</id><correlationId>f8315c4f-4943-4775-9af9-f2b123a5e858</correlationId><interactiveId>25e76d1a-d60b-47c2-8832-95628f46ae1e</interactiveId><callback></callback><response><code>OK</code></response></VoosMsg>
|
18
|
+
http_version: '1.1'
|
data/spec/karotz_spec.rb
CHANGED
@@ -1,36 +1,41 @@
|
|
1
1
|
require File.expand_path(File.dirname(__FILE__) + '/spec_helper')
|
2
2
|
|
3
3
|
module Karotz
|
4
|
-
describe
|
4
|
+
describe Configuration do
|
5
|
+
it "should be initialized with defaults" do
|
6
|
+
Configuration.install_id.should be_empty
|
7
|
+
Configuration.api_key.should be_empty
|
8
|
+
Configuration.secret.should be_empty
|
9
|
+
Configuration.logger.should_not be_nil
|
10
|
+
end
|
5
11
|
|
6
|
-
|
7
|
-
:
|
8
|
-
|
9
|
-
|
10
|
-
:yellow => 'FFFF00'
|
11
|
-
}
|
12
|
+
it "should configure with a hash" do
|
13
|
+
Configuration.configure :api_key => 'some-key'
|
14
|
+
Configuration.api_key.should eql('some-key')
|
15
|
+
end
|
12
16
|
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
# http://www.karotz.com/authentication/run/karotz/API_KEY
|
19
|
-
# cause login-process does throws 502 BAD_GATEWAY
|
20
|
-
@interactive_id = "4b434bfc-b4a0-4f69-9420-04f2b37a61ed"
|
17
|
+
it "should be initializable with a block" do
|
18
|
+
Configuration.configure do |conf|
|
19
|
+
conf.install_id = 'some-id'
|
20
|
+
end
|
21
|
+
Configuration.install_id.should eql('some-id')
|
21
22
|
end
|
23
|
+
end
|
22
24
|
|
25
|
+
describe Client do
|
23
26
|
it "should create a signed url" do
|
24
|
-
|
27
|
+
args = ['INSTALL_ID', 'API_KEY', 'SECRET', '7112317', '1324833464']
|
28
|
+
url = "http://api.karotz.com/api/karotz/start?apikey=API_KEY&installid=INSTALL_ID&once=7112317×tamp=1324833464&signature=Vb+yZK3eNlXGh+9DfnwIqQ+ZIAE="
|
29
|
+
Client.start_url(*args).should eql(url)
|
25
30
|
end
|
26
31
|
|
27
32
|
context "ears" do
|
28
33
|
|
29
|
-
it "should wiggle the ears" do
|
34
|
+
it "should wiggle the ears", :vcr => true do
|
30
35
|
Client.ears(@interactive_id)
|
31
36
|
end
|
32
37
|
|
33
|
-
it "should make the bull" do
|
38
|
+
it "should make the bull", :vcr => true do
|
34
39
|
params = {
|
35
40
|
:left => 0,
|
36
41
|
:right => 0,
|
@@ -39,7 +44,7 @@ module Karotz
|
|
39
44
|
Client.ears(@interactive_id, params)
|
40
45
|
end
|
41
46
|
|
42
|
-
it "should look sad" do
|
47
|
+
it "should look sad", :vcr => true do
|
43
48
|
params = {
|
44
49
|
:left => 90,
|
45
50
|
:right => 90,
|
@@ -48,7 +53,7 @@ module Karotz
|
|
48
53
|
Client.ears(@interactive_id, params)
|
49
54
|
end
|
50
55
|
|
51
|
-
it "should reset the ears" do
|
56
|
+
it "should reset the ears", :vcr => true do
|
52
57
|
params = {
|
53
58
|
:reset => true
|
54
59
|
}
|
@@ -57,13 +62,21 @@ module Karotz
|
|
57
62
|
end
|
58
63
|
|
59
64
|
context "led" do
|
60
|
-
it "should pulse" do
|
65
|
+
it "should pulse", :vcr => true do
|
61
66
|
Client.led(@interactive_id)
|
62
67
|
end
|
68
|
+
|
69
|
+
it "should fade", :vcr => true do
|
70
|
+
Client.fade(@interactive_id)
|
71
|
+
end
|
72
|
+
|
73
|
+
it "should light", :vcr => true do
|
74
|
+
Client.light(@interactive_id)
|
75
|
+
end
|
63
76
|
end
|
64
77
|
|
65
78
|
context "interactivemode" do
|
66
|
-
it "should stop the mode" do
|
79
|
+
it "should stop the mode", :vcr => true do
|
67
80
|
Client.interactivemode(@interactive_id)
|
68
81
|
end
|
69
82
|
end
|
data/spec/spec_helper.rb
CHANGED
@@ -2,5 +2,41 @@ $:.unshift File.join(File.dirname(__FILE__),'..','..','lib')
|
|
2
2
|
|
3
3
|
require "rspec"
|
4
4
|
require "pry"
|
5
|
+
require "vcr"
|
6
|
+
require "karotz"
|
5
7
|
|
6
|
-
|
8
|
+
VCR.config do |c|
|
9
|
+
c.cassette_library_dir = 'spec/cassettes'
|
10
|
+
c.stub_with :webmock
|
11
|
+
end
|
12
|
+
|
13
|
+
RSpec.configure do |config|
|
14
|
+
config.mock_with :rspec
|
15
|
+
|
16
|
+
config.treat_symbols_as_metadata_keys_with_true_values = true
|
17
|
+
config.around(:each, :vcr => true) do |example|
|
18
|
+
name = example.metadata[:full_description].downcase.gsub(/\W+/, "_").split("_", 2).join("/")
|
19
|
+
VCR.use_cassette(name, :record => :new_episodes, :match_requests_on => [:host, :path]) do
|
20
|
+
example.call
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
24
|
+
config.before :each do
|
25
|
+
HTTPI.log = false
|
26
|
+
|
27
|
+
@install_id = ENV['KAROTZ_INSTALL_ID']
|
28
|
+
@api_key = ENV['KAROTZ_API_KEY']
|
29
|
+
@secret = ENV['KAROTZ_SECRET']
|
30
|
+
# currently retrieved via
|
31
|
+
# http://www.karotz.com/authentication/run/karotz/API_KEY
|
32
|
+
# cause login-process does throws 502 BAD_GATEWAY
|
33
|
+
@interactive_id = "117c09d2-02b9-4b38-b64b-9b821ac7c91c"
|
34
|
+
|
35
|
+
Karotz::Configuration.reset
|
36
|
+
end
|
37
|
+
end
|
38
|
+
|
39
|
+
# setup for travis-ci
|
40
|
+
ENV['KAROTZ_INSTALL_ID'] ||= 'KAROTZ_INSTALL_ID'
|
41
|
+
ENV['KAROTZ_API_KEY'] ||= 'KAROTZ_API_KEY'
|
42
|
+
ENV['KAROTZ_SECRET'] ||= 'KAROTZ_SECRET'
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: karotz
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,11 +9,22 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2011-12-
|
12
|
+
date: 2011-12-26 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
15
|
+
name: rake
|
16
|
+
requirement: &2156300680 !ruby/object:Gem::Requirement
|
17
|
+
none: false
|
18
|
+
requirements:
|
19
|
+
- - ! '>='
|
20
|
+
- !ruby/object:Gem::Version
|
21
|
+
version: '0'
|
22
|
+
type: :development
|
23
|
+
prerelease: false
|
24
|
+
version_requirements: *2156300680
|
14
25
|
- !ruby/object:Gem::Dependency
|
15
26
|
name: rspec
|
16
|
-
requirement: &
|
27
|
+
requirement: &2156300260 !ruby/object:Gem::Requirement
|
17
28
|
none: false
|
18
29
|
requirements:
|
19
30
|
- - ! '>='
|
@@ -21,10 +32,43 @@ dependencies:
|
|
21
32
|
version: '0'
|
22
33
|
type: :development
|
23
34
|
prerelease: false
|
24
|
-
version_requirements: *
|
35
|
+
version_requirements: *2156300260
|
25
36
|
- !ruby/object:Gem::Dependency
|
26
37
|
name: pry
|
27
|
-
requirement: &
|
38
|
+
requirement: &2156299840 !ruby/object:Gem::Requirement
|
39
|
+
none: false
|
40
|
+
requirements:
|
41
|
+
- - ! '>='
|
42
|
+
- !ruby/object:Gem::Version
|
43
|
+
version: '0'
|
44
|
+
type: :development
|
45
|
+
prerelease: false
|
46
|
+
version_requirements: *2156299840
|
47
|
+
- !ruby/object:Gem::Dependency
|
48
|
+
name: guard-rspec
|
49
|
+
requirement: &2156299420 !ruby/object:Gem::Requirement
|
50
|
+
none: false
|
51
|
+
requirements:
|
52
|
+
- - ! '>='
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0'
|
55
|
+
type: :development
|
56
|
+
prerelease: false
|
57
|
+
version_requirements: *2156299420
|
58
|
+
- !ruby/object:Gem::Dependency
|
59
|
+
name: webmock
|
60
|
+
requirement: &2156299000 !ruby/object:Gem::Requirement
|
61
|
+
none: false
|
62
|
+
requirements:
|
63
|
+
- - ! '>='
|
64
|
+
- !ruby/object:Gem::Version
|
65
|
+
version: '0'
|
66
|
+
type: :development
|
67
|
+
prerelease: false
|
68
|
+
version_requirements: *2156299000
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: vcr
|
71
|
+
requirement: &2156298580 !ruby/object:Gem::Requirement
|
28
72
|
none: false
|
29
73
|
requirements:
|
30
74
|
- - ! '>='
|
@@ -32,10 +76,10 @@ dependencies:
|
|
32
76
|
version: '0'
|
33
77
|
type: :development
|
34
78
|
prerelease: false
|
35
|
-
version_requirements: *
|
79
|
+
version_requirements: *2156298580
|
36
80
|
- !ruby/object:Gem::Dependency
|
37
81
|
name: httpclient
|
38
|
-
requirement: &
|
82
|
+
requirement: &2156314540 !ruby/object:Gem::Requirement
|
39
83
|
none: false
|
40
84
|
requirements:
|
41
85
|
- - ! '>='
|
@@ -43,10 +87,10 @@ dependencies:
|
|
43
87
|
version: '0'
|
44
88
|
type: :runtime
|
45
89
|
prerelease: false
|
46
|
-
version_requirements: *
|
90
|
+
version_requirements: *2156314540
|
47
91
|
- !ruby/object:Gem::Dependency
|
48
92
|
name: httpi
|
49
|
-
requirement: &
|
93
|
+
requirement: &2156314120 !ruby/object:Gem::Requirement
|
50
94
|
none: false
|
51
95
|
requirements:
|
52
96
|
- - ! '>='
|
@@ -54,10 +98,10 @@ dependencies:
|
|
54
98
|
version: '0'
|
55
99
|
type: :runtime
|
56
100
|
prerelease: false
|
57
|
-
version_requirements: *
|
101
|
+
version_requirements: *2156314120
|
58
102
|
- !ruby/object:Gem::Dependency
|
59
103
|
name: crack
|
60
|
-
requirement: &
|
104
|
+
requirement: &2156313700 !ruby/object:Gem::Requirement
|
61
105
|
none: false
|
62
106
|
requirements:
|
63
107
|
- - ! '>='
|
@@ -65,7 +109,7 @@ dependencies:
|
|
65
109
|
version: '0'
|
66
110
|
type: :runtime
|
67
111
|
prerelease: false
|
68
|
-
version_requirements: *
|
112
|
+
version_requirements: *2156313700
|
69
113
|
description: ruby bindings for karotz rest api
|
70
114
|
email:
|
71
115
|
- phoetmail@googlemail.com
|
@@ -73,15 +117,29 @@ executables: []
|
|
73
117
|
extensions: []
|
74
118
|
extra_rdoc_files: []
|
75
119
|
files:
|
120
|
+
- .document
|
76
121
|
- .gitignore
|
77
122
|
- .rvmrc
|
123
|
+
- .specfile
|
124
|
+
- .travis.yml
|
78
125
|
- Gemfile
|
79
|
-
-
|
126
|
+
- Guardfile
|
127
|
+
- README.rdoc
|
80
128
|
- Rakefile
|
81
129
|
- karotz.gemspec
|
82
130
|
- lib/karotz.rb
|
83
131
|
- lib/karotz/client.rb
|
132
|
+
- lib/karotz/colors.rb
|
133
|
+
- lib/karotz/configuration.rb
|
84
134
|
- lib/karotz/version.rb
|
135
|
+
- spec/cassettes/karotz/client_ears_should_look_sad.yml
|
136
|
+
- spec/cassettes/karotz/client_ears_should_make_the_bull.yml
|
137
|
+
- spec/cassettes/karotz/client_ears_should_reset_the_ears.yml
|
138
|
+
- spec/cassettes/karotz/client_ears_should_wiggle_the_ears.yml
|
139
|
+
- spec/cassettes/karotz/client_interactivemode_should_stop_the_mode.yml
|
140
|
+
- spec/cassettes/karotz/client_led_should_fade.yml
|
141
|
+
- spec/cassettes/karotz/client_led_should_light.yml
|
142
|
+
- spec/cassettes/karotz/client_led_should_pulse.yml
|
85
143
|
- spec/karotz_spec.rb
|
86
144
|
- spec/spec_helper.rb
|
87
145
|
homepage: http://github.com/phoet/karotz
|
@@ -109,5 +167,13 @@ signing_key:
|
|
109
167
|
specification_version: 3
|
110
168
|
summary: ruby bindings for karotz rest api
|
111
169
|
test_files:
|
170
|
+
- spec/cassettes/karotz/client_ears_should_look_sad.yml
|
171
|
+
- spec/cassettes/karotz/client_ears_should_make_the_bull.yml
|
172
|
+
- spec/cassettes/karotz/client_ears_should_reset_the_ears.yml
|
173
|
+
- spec/cassettes/karotz/client_ears_should_wiggle_the_ears.yml
|
174
|
+
- spec/cassettes/karotz/client_interactivemode_should_stop_the_mode.yml
|
175
|
+
- spec/cassettes/karotz/client_led_should_fade.yml
|
176
|
+
- spec/cassettes/karotz/client_led_should_light.yml
|
177
|
+
- spec/cassettes/karotz/client_led_should_pulse.yml
|
112
178
|
- spec/karotz_spec.rb
|
113
179
|
- spec/spec_helper.rb
|
data/README
DELETED