eshq 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,19 @@
1
+ The EventSource HQ Gem
2
+ ======================
3
+
4
+ Make sure you have an EventSource HQ account.
5
+
6
+ The eshq gem will use the following environment variables:
7
+
8
+ ESHQ_URL
9
+ ESHQ_KEY
10
+ ESHQ_SECRET
11
+
12
+ To create a new socket that the client-side javascript library can use
13
+ to connect with:
14
+
15
+ ESHQ.open(:channel => "your-channel")
16
+
17
+ To send a message to a channel:
18
+
19
+ ESHQ.send(:channel => "your-channel", :data => "raw message data")
@@ -15,7 +15,11 @@ module ESHQ
15
15
 
16
16
  def post(path, params)
17
17
  response = Net::HTTP.post_form(url_for(path), params.merge(credentials))
18
- JSON.parse(response.body)
18
+ if response.code == "200"
19
+ response.content_type == "application/json" ? JSON.parse(response.body) : true
20
+ else
21
+ raise "Error #{response.body}"
22
+ end
19
23
  end
20
24
 
21
25
  def credentials
@@ -1,3 +1,3 @@
1
1
  module ESHQ
2
- VERSION = "0.0.2"
2
+ VERSION = "0.0.3"
3
3
  end
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 0
8
- - 2
9
- version: 0.0.2
8
+ - 3
9
+ version: 0.0.3
10
10
  platform: ruby
11
11
  authors:
12
12
  - Mathias Biilmann Christensen
@@ -14,7 +14,7 @@ autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
16
 
17
- date: 2011-09-26 00:00:00 +02:00
17
+ date: 2011-09-27 00:00:00 +02:00
18
18
  default_executable:
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
@@ -68,6 +68,7 @@ extra_rdoc_files: []
68
68
  files:
69
69
  - .gitignore
70
70
  - Gemfile
71
+ - README.md
71
72
  - Rakefile
72
73
  - eshq.gemspec
73
74
  - lib/eshq.rb