aptible-resource 0.3.2 → 0.3.3

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: 4ebc980a43019d6617b3a8ad2bbc708e50312a3b
4
- data.tar.gz: 835815cf5b0dae9dc5ba9cecb2e9036458dbfdd4
3
+ metadata.gz: 82f938de116c53f45b2033e06ae7a293aca0c0f7
4
+ data.tar.gz: dc977779622c227070d3cd09f58c91d9883baa8f
5
5
  SHA512:
6
- metadata.gz: 6adfaf1bd9675d2905c4b5944470f4fe496582b6b1b5e3a3de33d3f5d72d498ea1883ead712930a52735ea3fa1aa46ea20c9272700bf418f1f96cd364cfcd8ea
7
- data.tar.gz: 52e13d6eeb6538dff24b3ee490b1308ed80951ec5d0059a1c4860e877ed50537b149d35dc37c6a1f4d08f76d2745907dff4c8c393ffeedaef69387dea8a82ec8
6
+ metadata.gz: 8d37e852b758d7e3300bca70bbc8c80338fdb0ef489199f3fb965ed4c8a5ec6b0a063f5091b349d556d9fdc2797e15529ada77caa121736c8874e58a3d91c73e
7
+ data.tar.gz: 7191b315d2d20abf449f3215e7b2907e77b0f67a2d65631b2c0cce686b5a2bebeb72a44ee1d4b91d0674137b04778d7da4d8d3d7146f54657b37ae1e0a31bc00
@@ -193,23 +193,23 @@ module Aptible
193
193
  }
194
194
  end
195
195
 
196
- # rubocop:disable MethodLength
197
196
  def initialize(options = {})
198
197
  if options.is_a?(Hash)
199
198
  self.token = options[:token]
200
-
201
- options[:root] ||= root_url
202
- options[:namespace] ||= namespace
203
- options[:headers] ||= {}
204
- options[:headers].merge!(
205
- 'Content-Type' => 'application/json',
206
- 'Authorization' => "Bearer #{bearer_token}"
207
- ) if options[:token]
199
+ populate_default_options!(options)
208
200
  end
209
201
 
210
202
  super(options)
211
203
  end
212
- # rubocop:enable MethodLength
204
+
205
+ def populate_default_options!(options)
206
+ options[:root] ||= root_url
207
+ options[:namespace] ||= namespace
208
+ options[:headers] ||= {}
209
+ options[:headers]['Content-Type'] = 'application/json'
210
+ return unless options[:token]
211
+ options[:headers]['Authorization'] = "Bearer #{bearer_token}"
212
+ end
213
213
 
214
214
  def adapter
215
215
  self.class.adapter
@@ -1,5 +1,5 @@
1
1
  module Aptible
2
2
  module Resource
3
- VERSION = '0.3.2'
3
+ VERSION = '0.3.3'
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: aptible-resource
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.2
4
+ version: 0.3.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Frank Macreery
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-02-17 00:00:00.000000000 Z
11
+ date: 2016-02-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: uri_template
@@ -210,7 +210,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
210
210
  version: '0'
211
211
  requirements: []
212
212
  rubyforge_project:
213
- rubygems_version: 2.4.5
213
+ rubygems_version: 2.2.2
214
214
  signing_key:
215
215
  specification_version: 4
216
216
  summary: Foundation classes for Aptible resource server gems