dbalatero-evri_rpx 1.0.1 → 1.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/VERSION +1 -1
- data/evri_rpx.gemspec +6 -3
- data/lib/evri/rpx/session.rb +9 -9
- data/lib/evri_rpx.rb +1 -0
- data/spec/evri/rpx/session_spec.rb +10 -10
- metadata +2 -2
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.0.
|
1
|
+
1.0.2
|
data/evri_rpx.gemspec
CHANGED
@@ -1,12 +1,15 @@
|
|
1
|
+
# Generated by jeweler
|
2
|
+
# DO NOT EDIT THIS FILE
|
3
|
+
# Instead, edit Jeweler::Tasks in Rakefile, and run `rake gemspec`
|
1
4
|
# -*- encoding: utf-8 -*-
|
2
5
|
|
3
6
|
Gem::Specification.new do |s|
|
4
7
|
s.name = %q{evri_rpx}
|
5
|
-
s.version = "1.0.
|
8
|
+
s.version = "1.0.2"
|
6
9
|
|
7
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
8
11
|
s.authors = ["David Balatero"]
|
9
|
-
s.date = %q{2009-
|
12
|
+
s.date = %q{2009-08-31}
|
10
13
|
s.email = %q{dbalatero@evri.com}
|
11
14
|
s.extra_rdoc_files = [
|
12
15
|
"LICENSE",
|
@@ -57,7 +60,7 @@ Gem::Specification.new do |s|
|
|
57
60
|
s.homepage = %q{http://github.com/dbalatero/evri_rpx}
|
58
61
|
s.rdoc_options = ["--charset=UTF-8"]
|
59
62
|
s.require_paths = ["lib"]
|
60
|
-
s.rubygems_version = %q{1.3.
|
63
|
+
s.rubygems_version = %q{1.3.5}
|
61
64
|
s.summary = %q{An API wrapper for the RPXNow.com login service.}
|
62
65
|
s.test_files = [
|
63
66
|
"spec/evri/rpx/contact_list_spec.rb",
|
data/lib/evri/rpx/session.rb
CHANGED
@@ -45,7 +45,7 @@ module Evri
|
|
45
45
|
'token' => token }
|
46
46
|
params.merge!(options)
|
47
47
|
|
48
|
-
json = parse_response(
|
48
|
+
json = parse_response(post("/api/#{API_VERSION}/auth_info",
|
49
49
|
params))
|
50
50
|
User.new(json)
|
51
51
|
end
|
@@ -57,7 +57,7 @@ module Evri
|
|
57
57
|
# 'identifier2' => ['mapping3', 'mapping4'],
|
58
58
|
# ... }
|
59
59
|
def all_mappings
|
60
|
-
json = parse_response(
|
60
|
+
json = parse_response(post("/api/#{API_VERSION}/all_mappings",
|
61
61
|
:apiKey => @api_key))
|
62
62
|
json['mappings']
|
63
63
|
end
|
@@ -71,7 +71,7 @@ module Evri
|
|
71
71
|
# This feature is only available for RPX Pro customers.
|
72
72
|
def get_contacts(user_or_identifier)
|
73
73
|
identifier = identifier_param(user_or_identifier)
|
74
|
-
json = parse_response(
|
74
|
+
json = parse_response(post("/api/#{API_VERSION}/get_contacts",
|
75
75
|
:apiKey => @api_key,
|
76
76
|
:identifier => identifier))
|
77
77
|
ContactList.new(json)
|
@@ -90,7 +90,7 @@ module Evri
|
|
90
90
|
params['primaryKey'] = user_or_primary_key.respond_to?(:primary_key) ?
|
91
91
|
user_or_primary_key.primary_key : user_or_primary_key
|
92
92
|
|
93
|
-
json = parse_response(
|
93
|
+
json = parse_response(post("/api/#{API_VERSION}/mappings",
|
94
94
|
params))
|
95
95
|
Mappings.new(json)
|
96
96
|
end
|
@@ -107,7 +107,7 @@ module Evri
|
|
107
107
|
'overwrite' => true }
|
108
108
|
params.merge!(options)
|
109
109
|
params['identifier'] = identifier_param(user_or_identifier)
|
110
|
-
json = parse_response(
|
110
|
+
json = parse_response(post("/api/#{API_VERSION}/map",
|
111
111
|
params))
|
112
112
|
|
113
113
|
json['stat'] == 'ok'
|
@@ -125,7 +125,7 @@ module Evri
|
|
125
125
|
'status' => status_message }
|
126
126
|
params['identifier'] = identifier_param(user_or_identifier)
|
127
127
|
|
128
|
-
json = parse_response(
|
128
|
+
json = parse_response(post("/api/#{API_VERSION}/set_status",
|
129
129
|
params))
|
130
130
|
|
131
131
|
json['stat'] == 'ok'
|
@@ -139,7 +139,7 @@ module Evri
|
|
139
139
|
'primaryKey' => primary_key }
|
140
140
|
params['identifier'] = identifier_param(user_or_identifier)
|
141
141
|
|
142
|
-
json = parse_response(
|
142
|
+
json = parse_response(post("/api/#{API_VERSION}/unmap",
|
143
143
|
params))
|
144
144
|
|
145
145
|
json['stat'] == 'ok'
|
@@ -151,8 +151,8 @@ module Evri
|
|
151
151
|
user_or_identifier.identifier : user_or_identifier
|
152
152
|
end
|
153
153
|
|
154
|
-
def
|
155
|
-
request = Net::HTTP::
|
154
|
+
def post(resource, params)
|
155
|
+
request = Net::HTTP::Post.new(resource)
|
156
156
|
request.form_data = params
|
157
157
|
make_request(request)
|
158
158
|
end
|
data/lib/evri_rpx.rb
CHANGED
@@ -17,7 +17,7 @@ describe Evri::RPX::Session do
|
|
17
17
|
end
|
18
18
|
|
19
19
|
it "should raise an APICallError if RPX returns an error message" do
|
20
|
-
FakeWeb.register_uri(:
|
20
|
+
FakeWeb.register_uri(:post,
|
21
21
|
'https://rpxnow.com:443/api/v2/auth_info',
|
22
22
|
:body => fixture_path('session/normal_error.json'),
|
23
23
|
:status => ['400', 'Bad Request'])
|
@@ -27,7 +27,7 @@ describe Evri::RPX::Session do
|
|
27
27
|
end
|
28
28
|
|
29
29
|
it "should raise ServiceUnavailableError if the service is not available" do
|
30
|
-
FakeWeb.register_uri(:
|
30
|
+
FakeWeb.register_uri(:post,
|
31
31
|
'https://rpxnow.com:443/api/v2/auth_info',
|
32
32
|
:body => fixture_path('session/service_down_error.json'),
|
33
33
|
:status => ['404', 'Not Found'])
|
@@ -37,7 +37,7 @@ describe Evri::RPX::Session do
|
|
37
37
|
end
|
38
38
|
|
39
39
|
it "should return a User object for a mapping" do
|
40
|
-
FakeWeb.register_uri(:
|
40
|
+
FakeWeb.register_uri(:post,
|
41
41
|
'https://rpxnow.com:443/api/v2/auth_info',
|
42
42
|
:body => fixture_path('user/dbalatero_gmail.json'))
|
43
43
|
|
@@ -48,7 +48,7 @@ describe Evri::RPX::Session do
|
|
48
48
|
|
49
49
|
describe "all_mappings" do
|
50
50
|
it "should return a set of identifiers to mappings" do
|
51
|
-
FakeWeb.register_uri(:
|
51
|
+
FakeWeb.register_uri(:post,
|
52
52
|
'https://rpxnow.com:443/api/v2/all_mappings',
|
53
53
|
:body => fixture_path('session/all_mappings.json'))
|
54
54
|
result = @session.all_mappings
|
@@ -59,7 +59,7 @@ describe Evri::RPX::Session do
|
|
59
59
|
|
60
60
|
describe "get_contacts" do
|
61
61
|
before(:each) do
|
62
|
-
FakeWeb.register_uri(:
|
62
|
+
FakeWeb.register_uri(:post,
|
63
63
|
'https://rpxnow.com:443/api/v2/get_contacts',
|
64
64
|
:body => fixture_path('session/get_contacts.json'))
|
65
65
|
end
|
@@ -88,7 +88,7 @@ describe Evri::RPX::Session do
|
|
88
88
|
|
89
89
|
describe "map" do
|
90
90
|
before(:each) do
|
91
|
-
FakeWeb.register_uri(:
|
91
|
+
FakeWeb.register_uri(:post,
|
92
92
|
'https://rpxnow.com:443/api/v2/map',
|
93
93
|
:body => fixture_path('session/map.json'))
|
94
94
|
end
|
@@ -109,7 +109,7 @@ describe Evri::RPX::Session do
|
|
109
109
|
|
110
110
|
describe "mappings" do
|
111
111
|
it "should return a Mappings object" do
|
112
|
-
FakeWeb.register_uri(:
|
112
|
+
FakeWeb.register_uri(:post,
|
113
113
|
'https://rpxnow.com:443/api/v2/mappings',
|
114
114
|
:body => fixture_path('mappings/identifiers.json'))
|
115
115
|
|
@@ -119,7 +119,7 @@ describe Evri::RPX::Session do
|
|
119
119
|
end
|
120
120
|
|
121
121
|
it "should take a User object in" do
|
122
|
-
FakeWeb.register_uri(:
|
122
|
+
FakeWeb.register_uri(:post,
|
123
123
|
'https://rpxnow.com:443/api/v2/mappings',
|
124
124
|
:body => fixture_path('mappings/identifiers.json'))
|
125
125
|
user = mock('user')
|
@@ -133,7 +133,7 @@ describe Evri::RPX::Session do
|
|
133
133
|
|
134
134
|
describe "set_status" do
|
135
135
|
it "should call set_status, and return true" do
|
136
|
-
FakeWeb.register_uri(:
|
136
|
+
FakeWeb.register_uri(:post,
|
137
137
|
'https://rpxnow.com/api/v2/set_status',
|
138
138
|
:body => fixture_path('session/set_status.json'))
|
139
139
|
user = mock('user')
|
@@ -146,7 +146,7 @@ describe Evri::RPX::Session do
|
|
146
146
|
|
147
147
|
describe "unmap" do
|
148
148
|
before(:each) do
|
149
|
-
FakeWeb.register_uri(:
|
149
|
+
FakeWeb.register_uri(:post,
|
150
150
|
'https://rpxnow.com:443/api/v2/unmap',
|
151
151
|
:body => fixture_path('session/unmap.json'))
|
152
152
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dbalatero-evri_rpx
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- David Balatero
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2009-
|
12
|
+
date: 2009-08-31 00:00:00 -07:00
|
13
13
|
default_executable:
|
14
14
|
dependencies: []
|
15
15
|
|