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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c560efe3fc3a956cf69a67b4a9c18e635148e4de
4
- data.tar.gz: daf31b6ace54f1f25a3a813976cae85c1b34526a
3
+ metadata.gz: ef1ff049152a681067bf9cd179da754105d8419c
4
+ data.tar.gz: 1e98dc4aa35031eefc0734252bc1e650c969073b
5
5
  SHA512:
6
- metadata.gz: 0db8243ab8d5176c0d50b48e0271b9cf66cebda01a1f12732f7e8ec33da3975be6d665bc61d88f20654a3b83a2e2652182e8dbb45109e27be30f93f522dbfbcc
7
- data.tar.gz: 0d8c324bd42763d58e492f1cb50d54c384667192e3bb05c59e626a759cded66cf04aa40c1f5ce615e8a45b90b9f23704e384d099bcc357183ebdeff3ab4ffb93
6
+ metadata.gz: 1b7486964a14891fcbede7250748ffd41e8b44c5f7446f4bac06260365d79b3b1b5801dc14d13706a2a61ed0cc42961ff181aff9063eadf449264cd465babbb6
7
+ data.tar.gz: dd2217537e68ae2ab93fd1985c3812edaba6c0a666af6b8202ba3a560a4ac89fa3b9a5f59841e92ecd95c3a9110502383309139bbcc001720a46529924a20230
@@ -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
- encoded_token = Base64.strict_encode64(":#{oauth_token}")
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)
@@ -9,8 +9,8 @@ module Heroics
9
9
  def initialize(schema)
10
10
  @schema = schema
11
11
  @resources = {}
12
- @schema['definitions'].each_key do |name|
13
- @resources[name] = ResourceSchema.new(@schema, name)
12
+ @schema['properties'].each do |key, value|
13
+ @resources[key] = ResourceSchema.new(@schema, key)
14
14
  end
15
15
  end
16
16
 
@@ -1,3 +1,3 @@
1
1
  module Heroics
2
- VERSION = '0.0.5'
2
+ VERSION = '0.0.6'
3
3
  end
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 OmM1NWVmMGQ4LTQwYjYtNDc1OS1iMWJmLTRhNmY5NDE5MGE2Ng==',
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 OmM1NWVmMGQ4LTQwYjYtNDc1OS1iMWJmLTRhNmY5NDE5MGE2Ng==',
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
@@ -172,5 +172,9 @@ SAMPLE_SCHEMA = {
172
172
  'title' => 'List'}
173
173
  ]
174
174
  },
175
- }
175
+ },
176
+ 'properties' => {
177
+ 'resource' => { '$ref' => '#/definitions/resource' },
178
+ 'another-resource' => { '$ref' => '#/definitions/another-resource' }
179
+ }
176
180
  }
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.5
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-03-18 00:00:00.000000000 Z
12
+ date: 2014-04-09 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler