cadun 0.6.0 → 0.6.1
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/cadun/gateway.rb +6 -6
- data/lib/cadun/version.rb +1 -1
- metadata +17 -17
data/lib/cadun/gateway.rb
CHANGED
@@ -3,14 +3,14 @@ module Cadun
|
|
3
3
|
attr_reader :opts
|
4
4
|
|
5
5
|
def self.provision(user_id, service_id)
|
6
|
-
request = Curl::Easy.
|
6
|
+
request = Curl::Easy.http_put("#{Config.restclient_url}/service/provisionamento", "{\"usuarioId\":\"#{user_id}\",\"servicoId\":\"#{service_id}\"}") do |curl|
|
7
7
|
curl.headers['Content-Type'] = 'application/json'
|
8
|
-
curl.http_put("{\"usuarioId\":\"#{user_id}\",\"servicoId\":\"#{service_id}\"}")
|
9
8
|
end
|
9
|
+
|
10
10
|
request.response_code == 200
|
11
11
|
end
|
12
12
|
|
13
|
-
def initialize(opts = {})
|
13
|
+
def initialize(opts = {})
|
14
14
|
@opts = opts
|
15
15
|
end
|
16
16
|
|
@@ -38,10 +38,10 @@ module Cadun
|
|
38
38
|
%w(glb_id ip service_id).each { |i| raise ArgumentError.new("#{i} is missing") unless opts[i.to_sym] }
|
39
39
|
authorization_data = { "glbId" => opts[:glb_id], "ip" => opts[:ip], "servicoID" => opts[:service_id] }.to_xml(:root => "usuarioAutorizado", :indent => 0)
|
40
40
|
|
41
|
-
request = Curl::Easy.
|
42
|
-
curl.headers['Content-Type'] = '
|
43
|
-
curl.http_put(authorization_data)
|
41
|
+
request = Curl::Easy.http_put("#{Config.auth_url}/ws/rest/autorizacao", authorization_data) do |curl|
|
42
|
+
curl.headers['Content-Type'] = 'text/xml'
|
44
43
|
end
|
44
|
+
|
45
45
|
request.body_str
|
46
46
|
end
|
47
47
|
end
|
data/lib/cadun/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cadun
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.6.
|
4
|
+
version: 0.6.1
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -15,7 +15,7 @@ date: 2011-09-05 00:00:00.000000000Z
|
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
17
17
|
name: i18n
|
18
|
-
requirement: &
|
18
|
+
requirement: &2161593740 !ruby/object:Gem::Requirement
|
19
19
|
none: false
|
20
20
|
requirements:
|
21
21
|
- - ! '>='
|
@@ -23,10 +23,10 @@ dependencies:
|
|
23
23
|
version: '0'
|
24
24
|
type: :runtime
|
25
25
|
prerelease: false
|
26
|
-
version_requirements: *
|
26
|
+
version_requirements: *2161593740
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: activesupport
|
29
|
-
requirement: &
|
29
|
+
requirement: &2161593240 !ruby/object:Gem::Requirement
|
30
30
|
none: false
|
31
31
|
requirements:
|
32
32
|
- - ! '>='
|
@@ -34,10 +34,10 @@ dependencies:
|
|
34
34
|
version: 3.0.0
|
35
35
|
type: :runtime
|
36
36
|
prerelease: false
|
37
|
-
version_requirements: *
|
37
|
+
version_requirements: *2161593240
|
38
38
|
- !ruby/object:Gem::Dependency
|
39
39
|
name: builder
|
40
|
-
requirement: &
|
40
|
+
requirement: &2161592740 !ruby/object:Gem::Requirement
|
41
41
|
none: false
|
42
42
|
requirements:
|
43
43
|
- - ! '>='
|
@@ -45,10 +45,10 @@ dependencies:
|
|
45
45
|
version: 2.1.2
|
46
46
|
type: :runtime
|
47
47
|
prerelease: false
|
48
|
-
version_requirements: *
|
48
|
+
version_requirements: *2161592740
|
49
49
|
- !ruby/object:Gem::Dependency
|
50
50
|
name: curb
|
51
|
-
requirement: &
|
51
|
+
requirement: &2161592360 !ruby/object:Gem::Requirement
|
52
52
|
none: false
|
53
53
|
requirements:
|
54
54
|
- - ! '>='
|
@@ -56,10 +56,10 @@ dependencies:
|
|
56
56
|
version: '0'
|
57
57
|
type: :runtime
|
58
58
|
prerelease: false
|
59
|
-
version_requirements: *
|
59
|
+
version_requirements: *2161592360
|
60
60
|
- !ruby/object:Gem::Dependency
|
61
61
|
name: rake
|
62
|
-
requirement: &
|
62
|
+
requirement: &2161591900 !ruby/object:Gem::Requirement
|
63
63
|
none: false
|
64
64
|
requirements:
|
65
65
|
- - ! '>='
|
@@ -67,10 +67,10 @@ dependencies:
|
|
67
67
|
version: '0'
|
68
68
|
type: :development
|
69
69
|
prerelease: false
|
70
|
-
version_requirements: *
|
70
|
+
version_requirements: *2161591900
|
71
71
|
- !ruby/object:Gem::Dependency
|
72
72
|
name: rspec
|
73
|
-
requirement: &
|
73
|
+
requirement: &2161611940 !ruby/object:Gem::Requirement
|
74
74
|
none: false
|
75
75
|
requirements:
|
76
76
|
- - ! '>='
|
@@ -78,10 +78,10 @@ dependencies:
|
|
78
78
|
version: '0'
|
79
79
|
type: :development
|
80
80
|
prerelease: false
|
81
|
-
version_requirements: *
|
81
|
+
version_requirements: *2161611940
|
82
82
|
- !ruby/object:Gem::Dependency
|
83
83
|
name: rr
|
84
|
-
requirement: &
|
84
|
+
requirement: &2161611520 !ruby/object:Gem::Requirement
|
85
85
|
none: false
|
86
86
|
requirements:
|
87
87
|
- - ! '>='
|
@@ -89,10 +89,10 @@ dependencies:
|
|
89
89
|
version: '0'
|
90
90
|
type: :development
|
91
91
|
prerelease: false
|
92
|
-
version_requirements: *
|
92
|
+
version_requirements: *2161611520
|
93
93
|
- !ruby/object:Gem::Dependency
|
94
94
|
name: webmock
|
95
|
-
requirement: &
|
95
|
+
requirement: &2161611100 !ruby/object:Gem::Requirement
|
96
96
|
none: false
|
97
97
|
requirements:
|
98
98
|
- - ! '>='
|
@@ -100,7 +100,7 @@ dependencies:
|
|
100
100
|
version: '0'
|
101
101
|
type: :development
|
102
102
|
prerelease: false
|
103
|
-
version_requirements: *
|
103
|
+
version_requirements: *2161611100
|
104
104
|
description: A wrapper for the Globo.com's authentication/authorization API
|
105
105
|
email:
|
106
106
|
- bruno@azisaka.com.br
|