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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 43a48c7ecaeca29d05133e2151b3cbf6238a0cee
4
- data.tar.gz: 812100e201949ef7f60fb825685a11b5f9b816ea
3
+ metadata.gz: 9eba32c059c7672fd0edb7343190046f3c645ffb
4
+ data.tar.gz: 9c31017bcda712aeff778bb626230c67806b9421
5
5
  SHA512:
6
- metadata.gz: 5970fb486fa6931f03fb967956153d65c70b2f3b96447fed07927c57592bfae1488ef49945f6dfe9ce22401f84d0b56364e5fce36f09f78fb5f20ec83d004e64
7
- data.tar.gz: 88a80728058f926ba4520c1f2542ba5ee5a5c19acc1f543513ff3d757d17f7c0982405c635430e98092acd8b9ff83d9fc3d6a4fe0466269293a3ad91ea6ee427
6
+ metadata.gz: 4003bdef0b3bf494fc9c2b24413094adb6127c12e53c4d4a719a8bb47b67371d58d5664c4cddf2cbb0301bd1810321e03cdd7c2879d8442ad4288cc2fb5c09dc
7
+ data.tar.gz: f0252476a94c8cf7647defe2601f5c87580ceac83dc24f3c25d0dda2bb56d9c76010ff7c11ef2df49d99de8c8f4c024bab805b3795901a32db8a2815dbc276f3
@@ -1,3 +1,8 @@
1
+ === 0.1.0 2015-10-20
2
+
3
+ * update for IRKit firmware v3.0.0 #7
4
+ * thank you for contributing @hanachin
5
+
1
6
  === 0.0.9 2015-01-03
2
7
 
3
8
  * Use open-uri for IRKit::App::Data #6
@@ -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
@@ -1,3 +1,3 @@
1
1
  module IRKit
2
- VERSION = "0.0.9"
2
+ VERSION = "0.1.0"
3
3
  end
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.9
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-01-03 00:00:00.000000000 Z
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.2.2
176
+ rubygems_version: 2.4.5
177
177
  signing_key:
178
178
  specification_version: 4
179
179
  summary: IRKit Client for Ruby