vertebrae 0.5.1 → 0.6.0

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6b31eacf810e59f26505d1d99deca99bfaa8ae92f20f19e7983e2321b0320682
4
- data.tar.gz: 94cf05f3f8c1a4bb367184646e888b6311cd9af784f7fe1664e5f82a00420023
3
+ metadata.gz: 8a127ed3c3ce7a22967fa09eae2b4bc98cf639fb9693649b2c1663416b468618
4
+ data.tar.gz: 3f75cc3d7c14f548f32ab29b1ca5b6b6b46425ff5d4417496b22503d3e65e4a8
5
5
  SHA512:
6
- metadata.gz: 2f0bea7c3e4c7c3672a268e2ba5fbfa26894913cc59070fcbac196cdbb1832e29992c45c4475626118f4ddaa81829c64b479b4edf430245508890187a89648ab
7
- data.tar.gz: 7833302a0449e1decb8cfaac725c3d9c8f3501349865f9e8294608ebccb6cea2f79b0d1121feed07a0d27e7eb876e63444ece76c6fe78924475c0368a476c4ac
6
+ metadata.gz: a8499defca92293f4b1110dcc0422f0cb36a8e608bc5b2de86ec6c2a39c5dcb8f4f424717f93a97ce2c2afe4fcb4352800eddba995cfeaa97a11657aded50016
7
+ data.tar.gz: 5480943d624d3aa6a612398eecff6c8356659bde77b1e4fc88ab0c4b38159268f1a00536a7fa6a31affb700607366ac01333053525e1519ae6c1adb53903d362
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.5.1
1
+ 0.6.0
data/lib/configuration.rb CHANGED
@@ -15,7 +15,8 @@ module Vertebrae
15
15
  :connection_options,
16
16
  :content_type,
17
17
  :scheme,
18
- :port
18
+ :port,
19
+ :additional_headers
19
20
  ].freeze
20
21
 
21
22
  # The default HTTP scheme configuration
@@ -49,7 +50,7 @@ module Vertebrae
49
50
  DEFAULT_CONNECTION_OPTIONS = {}
50
51
 
51
52
  DEFAULT_CONTENT_TYPE = 'application/json'.freeze
52
-
53
+ DEFAULT_ADDITIONAL_HEADERS = {}.freeze
53
54
 
54
55
  VALID_OPTIONS_KEYS.each do | key |
55
56
  define_method("default_#{key}".intern) { default_options[key] }
@@ -95,7 +96,7 @@ module Vertebrae
95
96
  ACCEPT_CHARSET => "utf-8",
96
97
  USER_AGENT => user_agent,
97
98
  CONTENT_TYPE => content_type
98
- },
99
+ }.merge(additional_headers),
99
100
  :ssl => ssl,
100
101
  :url => endpoint
101
102
  }.merge(connection_options)
@@ -104,5 +104,23 @@ describe Vertebrae::Configuration do
104
104
  expect(opts[:timeout]).to eq 5
105
105
  end
106
106
  end
107
+
108
+ context 'with additional_headers' do
109
+ let(:additional_headers) { {'special-auth-token' => 'abcde12345'} }
110
+
111
+ subject { Vertebrae::Configuration.new(host: 'example.com', additional_headers: additional_headers) }
112
+
113
+ it 'should add the additional headers to the other headers' do
114
+ opts = subject.faraday_options
115
+ expect(opts.keys).to contain_exactly(:headers, :ssl, :url)
116
+ expect(opts[:headers]).to eq({'Accept' => 'application/json;q=0.1',
117
+ 'Accept-Charset' => 'utf-8',
118
+ 'User-Agent' => 'Vertebrae REST Gem',
119
+ 'Content-Type' => 'application/json',
120
+ 'special-auth-token' => 'abcde12345'})
121
+ expect(opts[:ssl]).to eq({})
122
+ expect(opts[:url]).to eq 'https://example.com/'
123
+ end
124
+ end
107
125
  end
108
126
  end
data/vertebrae.gemspec CHANGED
@@ -2,16 +2,16 @@
2
2
  # DO NOT EDIT THIS FILE DIRECTLY
3
3
  # Instead, edit Juwelier::Tasks in Rakefile, and run 'rake gemspec'
4
4
  # -*- encoding: utf-8 -*-
5
- # stub: vertebrae 0.5.1 ruby lib
5
+ # stub: vertebrae 0.6.0 ruby lib
6
6
 
7
7
  Gem::Specification.new do |s|
8
8
  s.name = "vertebrae".freeze
9
- s.version = "0.5.1"
9
+ s.version = "0.6.0"
10
10
 
11
11
  s.required_rubygems_version = Gem::Requirement.new(">= 0".freeze) if s.respond_to? :required_rubygems_version=
12
12
  s.require_paths = ["lib".freeze]
13
13
  s.authors = ["Nathan Woodhull".freeze]
14
- s.date = "2020-03-16"
14
+ s.date = "2020-04-27"
15
15
  s.description = "A set of low level infrastructure and reusable code for building API clients".freeze
16
16
  s.email = "nathan@controlshiftlabs.com".freeze
17
17
  s.extra_rdoc_files = [
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vertebrae
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.1
4
+ version: 0.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nathan Woodhull
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-03-16 00:00:00.000000000 Z
11
+ date: 2020-04-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport