irkit 0.0.9 → 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/History.txt +5 -0
- data/lib/irkit/device.rb +9 -3
- data/lib/irkit/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9eba32c059c7672fd0edb7343190046f3c645ffb
|
4
|
+
data.tar.gz: 9c31017bcda712aeff778bb626230c67806b9421
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4003bdef0b3bf494fc9c2b24413094adb6127c12e53c4d4a719a8bb47b67371d58d5664c4cddf2cbb0301bd1810321e03cdd7c2879d8442ad4288cc2fb5c09dc
|
7
|
+
data.tar.gz: f0252476a94c8cf7647defe2601f5c87580ceac83dc24f3c25d0dda2bb56d9c76010ff7c11ef2df49d99de8c8f4c024bab805b3795901a32db8a2815dbc276f3
|
data/History.txt
CHANGED
data/lib/irkit/device.rb
CHANGED
@@ -16,7 +16,7 @@ module IRKit
|
|
16
16
|
end
|
17
17
|
|
18
18
|
def get_messages
|
19
|
-
res = HTTParty.get("#{url}/messages")
|
19
|
+
res = HTTParty.get("#{url}/messages", headers: headers)
|
20
20
|
case res.code
|
21
21
|
when 200
|
22
22
|
return nil if res.body.length < 1
|
@@ -28,13 +28,14 @@ module IRKit
|
|
28
28
|
|
29
29
|
def post_messages(data)
|
30
30
|
opts = {
|
31
|
-
:body => data.to_json
|
31
|
+
:body => data.to_json,
|
32
|
+
:headers => headers
|
32
33
|
}
|
33
34
|
HTTParty.post "#{url}/messages", opts
|
34
35
|
end
|
35
36
|
|
36
37
|
def get_token
|
37
|
-
res = HTTParty.post "#{url}/keys", {}
|
38
|
+
res = HTTParty.post "#{url}/keys", {headers: headers}
|
38
39
|
case res.code
|
39
40
|
when 200
|
40
41
|
return JSON.parse(res.body)["clienttoken"]
|
@@ -59,5 +60,10 @@ module IRKit
|
|
59
60
|
end
|
60
61
|
end
|
61
62
|
|
63
|
+
private
|
64
|
+
|
65
|
+
def headers
|
66
|
+
{"X-Requested-With" => "ruby-irkit"}
|
67
|
+
end
|
62
68
|
end
|
63
69
|
end
|
data/lib/irkit/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: irkit
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0
|
4
|
+
version: 0.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sho Hashimoto
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-10-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -173,7 +173,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
173
173
|
version: '0'
|
174
174
|
requirements: []
|
175
175
|
rubyforge_project:
|
176
|
-
rubygems_version: 2.
|
176
|
+
rubygems_version: 2.4.5
|
177
177
|
signing_key:
|
178
178
|
specification_version: 4
|
179
179
|
summary: IRKit Client for Ruby
|