rhoconnect-rb 0.2.2 → 0.2.3
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/lib/rhoconnect/endpoints.rb +2 -2
- data/lib/rhoconnect/version.rb +1 -1
- data/spec/endpoints_spec.rb +4 -4
- metadata +15 -13
data/lib/rhoconnect/endpoints.rb
CHANGED
@@ -6,8 +6,8 @@ module Rhoconnect
|
|
6
6
|
code, params = 200, parse_params(content_type, body)
|
7
7
|
if Rhoconnect.configuration.authenticate
|
8
8
|
code = 401 unless Rhoconnect.configuration.authenticate.call(params)
|
9
|
-
end
|
10
|
-
[code, {'Content-Type' => 'text/plain'}, [""]]
|
9
|
+
end
|
10
|
+
[code, {'Content-Type' => 'text/plain'}, [code == 200 ? params['login'] : ""]]
|
11
11
|
end
|
12
12
|
|
13
13
|
def self.query(content_type, body)
|
data/lib/rhoconnect/version.rb
CHANGED
data/spec/endpoints_spec.rb
CHANGED
@@ -47,7 +47,7 @@ describe Rhoconnect::EndpointHelpers do
|
|
47
47
|
it "should call configured authenticate block" do
|
48
48
|
setup_auth_test(true)
|
49
49
|
Rhoconnect::Authenticate.call(@env).should == [
|
50
|
-
200, {'Content-Type' => 'text/plain'}, [
|
50
|
+
200, {'Content-Type' => 'text/plain'}, [nil]
|
51
51
|
]
|
52
52
|
end
|
53
53
|
|
@@ -65,13 +65,13 @@ describe Rhoconnect::EndpointHelpers do
|
|
65
65
|
end
|
66
66
|
Rhoconnect.configuration.authenticate.should be_nil
|
67
67
|
Rhoconnect::Authenticate.call(@env).should == [
|
68
|
-
200, {'Content-Type' => 'text/plain'}, [
|
68
|
+
200, {'Content-Type' => 'text/plain'}, [nil]
|
69
69
|
]
|
70
70
|
end
|
71
71
|
|
72
72
|
it "should call authenticate block with empty params" do
|
73
73
|
Rhoconnect::EndpointHelpers.authenticate('text/plain', '').should == [
|
74
|
-
200, {"Content-Type"=>"text/plain"}, [
|
74
|
+
200, {"Content-Type"=>"text/plain"}, [nil]
|
75
75
|
]
|
76
76
|
end
|
77
77
|
end
|
@@ -218,7 +218,7 @@ describe Rhoconnect::EndpointHelpers do
|
|
218
218
|
app.should_receive(:content_type).with('text/plain')
|
219
219
|
app.call_helper(
|
220
220
|
:authenticate, 'application/json', @creds.to_json
|
221
|
-
).should ==
|
221
|
+
).should == nil
|
222
222
|
end
|
223
223
|
|
224
224
|
it "should call helper for query" do
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rhoconnect-rb
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 17
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 2
|
9
|
-
-
|
10
|
-
version: 0.2.
|
9
|
+
- 3
|
10
|
+
version: 0.2.3
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Rhomobile
|
@@ -15,11 +15,11 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2011-06-
|
18
|
+
date: 2011-06-29 00:00:00 -07:00
|
19
|
+
default_executable:
|
19
20
|
dependencies:
|
20
21
|
- !ruby/object:Gem::Dependency
|
21
|
-
|
22
|
-
requirement: &id001 !ruby/object:Gem::Requirement
|
22
|
+
version_requirements: &id001 !ruby/object:Gem::Requirement
|
23
23
|
none: false
|
24
24
|
requirements:
|
25
25
|
- - ~>
|
@@ -30,12 +30,12 @@ dependencies:
|
|
30
30
|
- 6
|
31
31
|
- 1
|
32
32
|
version: 1.6.1
|
33
|
-
|
34
|
-
name: rest-client
|
33
|
+
requirement: *id001
|
35
34
|
prerelease: false
|
36
|
-
|
35
|
+
name: rest-client
|
37
36
|
type: :runtime
|
38
|
-
|
37
|
+
- !ruby/object:Gem::Dependency
|
38
|
+
version_requirements: &id002 !ruby/object:Gem::Requirement
|
39
39
|
none: false
|
40
40
|
requirements:
|
41
41
|
- - ~>
|
@@ -46,9 +46,10 @@ dependencies:
|
|
46
46
|
- 4
|
47
47
|
- 6
|
48
48
|
version: 1.4.6
|
49
|
-
|
50
|
-
name: json
|
49
|
+
requirement: *id002
|
51
50
|
prerelease: false
|
51
|
+
name: json
|
52
|
+
type: :runtime
|
52
53
|
description: Rhoconnect rails plugin
|
53
54
|
email:
|
54
55
|
- support@rhomobile.com
|
@@ -78,6 +79,7 @@ files:
|
|
78
79
|
- spec/endpoints_spec.rb
|
79
80
|
- spec/resource_spec.rb
|
80
81
|
- spec/spec_helper.rb
|
82
|
+
has_rdoc: true
|
81
83
|
homepage: http://rhomobile.com
|
82
84
|
licenses: []
|
83
85
|
|
@@ -107,7 +109,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
107
109
|
requirements: []
|
108
110
|
|
109
111
|
rubyforge_project:
|
110
|
-
rubygems_version: 1.
|
112
|
+
rubygems_version: 1.5.3
|
111
113
|
signing_key:
|
112
114
|
specification_version: 3
|
113
115
|
summary: Rhoconnect rails plugin
|