codegears 0.0.21.pre → 0.0.22.pre
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/cg/api.rb +3 -3
- data/lib/cg/version.rb +1 -1
- data/lib/generators/cg/install/install_generator.rb +3 -3
- metadata +1 -1
data/lib/cg/api.rb
CHANGED
@@ -7,18 +7,18 @@ module CG
|
|
7
7
|
PUSHER_URL = "#{ROOT_URL}:9292/stream"
|
8
8
|
|
9
9
|
def self.create_app_request(email)
|
10
|
-
self.post("#{ROOT_URL}/apps", :body => { :application => { :email => email } })
|
10
|
+
JSON.parse(self.post("#{ROOT_URL}/apps", :body => { :application => { :email => email } }).body)
|
11
11
|
end
|
12
12
|
|
13
13
|
def self.show_app_request(id, secret_id = nil, secret_token = nil)
|
14
|
-
self.get("#{ROOT_URL}/apps/#{id}?#{self.attach_auth(secret_id, secret_token)}")
|
14
|
+
JSON.parse(self.get("#{ROOT_URL}/apps/#{id}?#{self.attach_auth(secret_id, secret_token)}").body)
|
15
15
|
end
|
16
16
|
|
17
17
|
def self.push_message_request(channel, message)
|
18
18
|
message = { :channel => channel,
|
19
19
|
:message => message,
|
20
20
|
:ext => { :secret_id => CG::APP.secret_id, :secret_token => CG::APP.secret_token } }.to_json
|
21
|
-
Net::HTTP.post_form(URI.parse(PUSHER_URL), :message => message)
|
21
|
+
JSON.parse(Net::HTTP.post_form(URI.parse(PUSHER_URL), :message => message).body)
|
22
22
|
end
|
23
23
|
|
24
24
|
def self.attach_auth(secret_id, secret_token)
|
data/lib/cg/version.rb
CHANGED
@@ -21,9 +21,9 @@ module Cg
|
|
21
21
|
unless email.blank?
|
22
22
|
response = CG::API.create_app_request(email)
|
23
23
|
unless response["success"] == false
|
24
|
-
@id = response[
|
25
|
-
@secret_id = response[
|
26
|
-
@secret_token = response[
|
24
|
+
@id = response['id']
|
25
|
+
@secret_id = response['secret_id']
|
26
|
+
@secret_token = response['secret_token']
|
27
27
|
end
|
28
28
|
end
|
29
29
|
end
|