heroics 0.0.5 → 0.0.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/heroics/client.rb +1 -2
- data/lib/heroics/schema.rb +2 -2
- data/lib/heroics/version.rb +1 -1
- data/test/client_test.rb +2 -2
- data/test/helper.rb +5 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ef1ff049152a681067bf9cd179da754105d8419c
|
4
|
+
data.tar.gz: 1e98dc4aa35031eefc0734252bc1e650c969073b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1b7486964a14891fcbede7250748ffd41e8b44c5f7446f4bac06260365d79b3b1b5801dc14d13706a2a61ed0cc42961ff181aff9063eadf449264cd465babbb6
|
7
|
+
data.tar.gz: dd2217537e68ae2ab93fd1985c3812edaba6c0a666af6b8202ba3a560a4ac89fa3b9a5f59841e92ecd95c3a9110502383309139bbcc001720a46529924a20230
|
data/lib/heroics/client.rb
CHANGED
@@ -70,8 +70,7 @@ module Heroics
|
|
70
70
|
# is no caching.
|
71
71
|
# @return [Client] A client with resources and links from the JSON schema.
|
72
72
|
def self.oauth_client_from_schema(oauth_token, schema, url, options={})
|
73
|
-
|
74
|
-
authorization = "Bearer #{encoded_token}"
|
73
|
+
authorization = "Bearer #{oauth_token}"
|
75
74
|
# Don't mutate user-supplied data.
|
76
75
|
options = Marshal.load(Marshal.dump(options))
|
77
76
|
if !options.has_key?(:default_headers)
|
data/lib/heroics/schema.rb
CHANGED
@@ -9,8 +9,8 @@ module Heroics
|
|
9
9
|
def initialize(schema)
|
10
10
|
@schema = schema
|
11
11
|
@resources = {}
|
12
|
-
@schema['
|
13
|
-
@resources[
|
12
|
+
@schema['properties'].each do |key, value|
|
13
|
+
@resources[key] = ResourceSchema.new(@schema, key)
|
14
14
|
end
|
15
15
|
end
|
16
16
|
|
data/lib/heroics/version.rb
CHANGED
data/test/client_test.rb
CHANGED
@@ -147,7 +147,7 @@ class OAuthClientFromSchemaTest < MiniTest::Unit::TestCase
|
|
147
147
|
body = {'Hello' => 'World!'}
|
148
148
|
Excon.stub(method: :get) do |request|
|
149
149
|
assert_equal(
|
150
|
-
'Bearer
|
150
|
+
'Bearer c55ef0d8-40b6-4759-b1bf-4a6f94190a66',
|
151
151
|
request[:headers]['Authorization'])
|
152
152
|
Excon.stubs.pop
|
153
153
|
{status: 200, headers: {'Content-Type' => 'application/json'},
|
@@ -169,7 +169,7 @@ class OAuthClientFromSchemaTest < MiniTest::Unit::TestCase
|
|
169
169
|
assert_equal('application/vnd.heroku+json; version=3',
|
170
170
|
request[:headers]['Accept'])
|
171
171
|
assert_equal(
|
172
|
-
'Bearer
|
172
|
+
'Bearer c55ef0d8-40b6-4759-b1bf-4a6f94190a66',
|
173
173
|
request[:headers]['Authorization'])
|
174
174
|
Excon.stubs.pop
|
175
175
|
{status: 200, headers: {'Content-Type' => 'application/json'},
|
data/test/helper.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: heroics
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- geemus
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2014-
|
12
|
+
date: 2014-04-09 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: bundler
|