vertebrae 0.8.0 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/ci.yml +4 -4
- data/Gemfile +3 -4
- data/Rakefile +1 -0
- data/VERSION +1 -0
- data/lib/{vertebrae/connection.rb → connection.rb} +8 -7
- data/lib/{vertebrae/response → response}/raise_error.rb +4 -2
- data/lib/vertebrae.rb +11 -11
- data/spec/api_spec.rb +32 -0
- data/spec/configuration_spec.rb +128 -0
- data/spec/dummy/client.rb +7 -0
- data/spec/dummy/dummy.rb +8 -0
- data/spec/logger_spec.rb +20 -0
- data/spec/request_spec.rb +89 -0
- data/spec/spec_helper.rb +33 -0
- data/vertebrae.gemspec +47 -31
- metadata +38 -32
- data/.gitignore +0 -26
- data/lib/vertebrae/version.rb +0 -5
- /data/lib/{vertebrae/api.rb → api.rb} +0 -0
- /data/lib/{vertebrae/authorization.rb → authorization.rb} +0 -0
- /data/lib/{vertebrae/base.rb → base.rb} +0 -0
- /data/lib/{vertebrae/configuration.rb → configuration.rb} +0 -0
- /data/lib/{vertebrae/constants.rb → constants.rb} +0 -0
- /data/lib/{vertebrae/model.rb → model.rb} +0 -0
- /data/lib/{vertebrae/railties.rb → railties.rb} +0 -0
- /data/lib/{vertebrae/request.rb → request.rb} +0 -0
- /data/lib/{vertebrae/response_error.rb → response_error.rb} +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 62eabfcd0080454194f02c772758fcac1dee7998c264813b715f729c01f6deec
|
4
|
+
data.tar.gz: 563e98c3ad61dc9040cc26134d795eb884d535197963d736f7a76e121f66d29f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 703b18a9b5ffa5b538a43ef6c68caa99d22c34411a75fca19bce78e020183811d3e9f4bb5b1708d365928f8b7fec8402325affea87491807b955ab5f38572355
|
7
|
+
data.tar.gz: 59266d8c1051b15946274669008e702eafb08896a089a3f08eb6498d35b65d6a5ace24c3a72177d499a91a5fcac3be727b4a7a75d446020913537b2663eea7e4
|
data/.github/workflows/ci.yml
CHANGED
@@ -6,9 +6,9 @@ jobs:
|
|
6
6
|
runs-on: ubuntu-latest
|
7
7
|
steps:
|
8
8
|
- uses: actions/checkout@v2
|
9
|
-
- uses: ruby/setup-ruby@
|
9
|
+
- uses: ruby/setup-ruby@477b21f02be01bcb8030d50f37cfec92bfa615b6
|
10
10
|
with:
|
11
|
-
ruby-version:
|
11
|
+
ruby-version: 2.7
|
12
12
|
bundler-cache: true
|
13
13
|
- run: bundle install
|
14
14
|
- run: bundle exec rspec
|
@@ -16,9 +16,9 @@ jobs:
|
|
16
16
|
runs-on: ubuntu-latest
|
17
17
|
steps:
|
18
18
|
- uses: actions/checkout@v2
|
19
|
-
- uses: ruby/setup-ruby@
|
19
|
+
- uses: ruby/setup-ruby@477b21f02be01bcb8030d50f37cfec92bfa615b6
|
20
20
|
with:
|
21
|
-
ruby-version:
|
21
|
+
ruby-version: 2.7
|
22
22
|
bundler-cache: true
|
23
23
|
- run: bundle install
|
24
24
|
- run: bundle exec rubocop
|
data/Gemfile
CHANGED
@@ -1,15 +1,14 @@
|
|
1
1
|
source "http://rubygems.org"
|
2
2
|
|
3
3
|
gem 'activesupport', '>= 5.1.4'
|
4
|
-
gem 'faraday', '
|
5
|
-
gem '
|
6
|
-
gem '
|
4
|
+
gem 'faraday', '> 2.0'
|
5
|
+
gem 'faraday-mashify'
|
6
|
+
gem 'faraday-multipart'
|
7
7
|
|
8
8
|
# Add dependencies to develop your gem here.
|
9
9
|
# Include everything needed to run rake, tests, features, etc.
|
10
10
|
group :development do
|
11
11
|
gem "rspec"
|
12
|
-
gem "rake"
|
13
12
|
gem "bundler"
|
14
13
|
gem "webmock"
|
15
14
|
gem "rspec-its"
|
data/Rakefile
CHANGED
data/VERSION
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
1.0
|
@@ -1,9 +1,10 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
require 'faraday'
|
4
|
-
require '
|
5
|
-
require '
|
6
|
-
require '
|
4
|
+
require 'faraday/multipart'
|
5
|
+
require 'faraday/mashify'
|
6
|
+
require 'response/raise_error'
|
7
|
+
require 'authorization'
|
7
8
|
|
8
9
|
module Vertebrae
|
9
10
|
class Connection
|
@@ -37,17 +38,17 @@ module Vertebrae
|
|
37
38
|
#
|
38
39
|
def default_middleware
|
39
40
|
Proc.new do |builder|
|
40
|
-
builder.use Faraday::
|
41
|
+
builder.use Faraday::Multipart::Middleware
|
41
42
|
builder.use Faraday::Request::UrlEncoded
|
42
43
|
if configuration.authenticated?
|
43
|
-
builder.use Faraday::Request::
|
44
|
+
builder.use Faraday::Request::Authorization, :basic, configuration.username, configuration.password
|
44
45
|
end
|
45
46
|
|
46
47
|
builder.use Faraday::Response::Logger if ENV['DEBUG']
|
47
48
|
|
48
49
|
unless options[:raw]
|
49
|
-
builder.use
|
50
|
-
builder.use
|
50
|
+
builder.use Faraday::Mashify::Middleware
|
51
|
+
builder.use Faraday::Response::Json
|
51
52
|
end
|
52
53
|
builder.use Vertebrae::Response::RaiseError
|
53
54
|
builder.adapter configuration.adapter
|
@@ -1,8 +1,10 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
+
require 'faraday/response'
|
4
|
+
|
3
5
|
module Vertebrae
|
4
6
|
module Response
|
5
|
-
class RaiseError < Faraday::
|
7
|
+
class RaiseError < Faraday::Middleware
|
6
8
|
|
7
9
|
def on_complete(response)
|
8
10
|
status_code = response[:status].to_i
|
@@ -12,4 +14,4 @@ module Vertebrae
|
|
12
14
|
end
|
13
15
|
end
|
14
16
|
end # Response::RaiseError
|
15
|
-
end
|
17
|
+
end
|
data/lib/vertebrae.rb
CHANGED
@@ -2,18 +2,18 @@
|
|
2
2
|
|
3
3
|
require 'active_support/all'
|
4
4
|
|
5
|
-
require '
|
6
|
-
require '
|
7
|
-
require '
|
8
|
-
require '
|
9
|
-
require '
|
10
|
-
require '
|
11
|
-
require '
|
12
|
-
require '
|
13
|
-
require '
|
14
|
-
require '
|
5
|
+
require 'constants'
|
6
|
+
require 'authorization'
|
7
|
+
require 'configuration'
|
8
|
+
require 'connection'
|
9
|
+
require 'request'
|
10
|
+
require 'response_error'
|
11
|
+
require 'api'
|
12
|
+
require 'base'
|
13
|
+
require 'model'
|
14
|
+
require 'version'
|
15
15
|
|
16
|
-
require '
|
16
|
+
require 'railties' if defined? Rails
|
17
17
|
|
18
18
|
module Vertebrae
|
19
19
|
|
data/spec/api_spec.rb
ADDED
@@ -0,0 +1,32 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'spec_helper'
|
4
|
+
|
5
|
+
describe Vertebrae::API do
|
6
|
+
subject { described_class.new(options) }
|
7
|
+
|
8
|
+
it { expect(described_class.included_modules).to include Vertebrae::Request }
|
9
|
+
|
10
|
+
describe 'initialize' do
|
11
|
+
before(:each) do
|
12
|
+
allow_any_instance_of(Vertebrae::API).to receive(:default_options).and_return({content_type: 'foo'})
|
13
|
+
end
|
14
|
+
|
15
|
+
context 'with an empty hash' do
|
16
|
+
let(:options) { {} }
|
17
|
+
specify { expect(subject.connection.options).to eq({content_type: 'foo'}) }
|
18
|
+
end
|
19
|
+
|
20
|
+
context 'with a default content-type' do
|
21
|
+
let(:options) { {content_type: 'text/csv'} }
|
22
|
+
specify { expect(subject.connection.options).to eq({content_type: 'text/csv'}) }
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
26
|
+
describe 'dummy' do
|
27
|
+
describe 'should delegate to the client class' do
|
28
|
+
specify { expect(Dummy.new).to respond_to(:api) }
|
29
|
+
specify { expect(Dummy).to respond_to(:api) }
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
@@ -0,0 +1,128 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'spec_helper'
|
4
|
+
|
5
|
+
describe Vertebrae::Configuration do
|
6
|
+
|
7
|
+
subject { Vertebrae::Configuration.new({}) }
|
8
|
+
|
9
|
+
{:scheme => described_class::DEFAULT_SCHEME,
|
10
|
+
:ssl => described_class::DEFAULT_SSL,
|
11
|
+
:user_agent => described_class::DEFAULT_USER_AGENT,
|
12
|
+
:username => described_class::DEFAULT_USERNAME,
|
13
|
+
:password => described_class::DEFAULT_PASSWORD }.each do | key, value |
|
14
|
+
its(key) { should == value }
|
15
|
+
its("default_#{key}") { should == value }
|
16
|
+
end
|
17
|
+
|
18
|
+
its(:connection_options) { should be_a Hash }
|
19
|
+
its(:connection_options) { should be_empty }
|
20
|
+
|
21
|
+
describe "override" do
|
22
|
+
subject{ Vertebrae::Configuration.new({username: 'foo', password: 'bar', scheme: 'http'}) }
|
23
|
+
|
24
|
+
its(:default_scheme) { should == described_class::DEFAULT_SCHEME }
|
25
|
+
its(:default_username) { should == described_class::DEFAULT_USERNAME }
|
26
|
+
its(:default_password) { should == described_class::DEFAULT_PASSWORD }
|
27
|
+
|
28
|
+
its(:scheme) { should == 'http'}
|
29
|
+
its(:username) { should == 'foo'}
|
30
|
+
its(:password) { should == 'bar'}
|
31
|
+
end
|
32
|
+
|
33
|
+
describe "setter" do
|
34
|
+
before(:each) do
|
35
|
+
subject.username = 'foo'
|
36
|
+
end
|
37
|
+
its(:username) { should == 'foo'}
|
38
|
+
its(:default_username) { should == described_class::DEFAULT_USERNAME }
|
39
|
+
end
|
40
|
+
|
41
|
+
describe 'endpoint' do
|
42
|
+
context 'with no port specification' do
|
43
|
+
subject { Vertebrae::Configuration.new({host: 'test.com', prefix: ''}) }
|
44
|
+
|
45
|
+
specify { expect(subject.host).to eq('test.com') }
|
46
|
+
specify { expect(subject.endpoint).to eq('https://test.com')}
|
47
|
+
end
|
48
|
+
|
49
|
+
context 'with port specification' do
|
50
|
+
subject { Vertebrae::Configuration.new({host: 'test.com', prefix: '', port: 8080}) }
|
51
|
+
|
52
|
+
specify { expect(subject.port).to eq(8080) }
|
53
|
+
specify { expect(subject.endpoint).to eq('https://test.com:8080')}
|
54
|
+
|
55
|
+
context 'with prefix' do
|
56
|
+
subject { Vertebrae::Configuration.new({host: 'test.com', prefix: '/api/v1', port: 8080}) }
|
57
|
+
|
58
|
+
specify { expect(subject.prefix).to eq('/api/v1') }
|
59
|
+
specify { expect(subject.endpoint).to eq('https://test.com:8080/api/v1')}
|
60
|
+
end
|
61
|
+
end
|
62
|
+
end
|
63
|
+
|
64
|
+
describe 'adapter' do
|
65
|
+
it 'should default to :net_http' do
|
66
|
+
expect(subject.adapter).to eq(:net_http)
|
67
|
+
end
|
68
|
+
end
|
69
|
+
|
70
|
+
describe 'adapter=' do
|
71
|
+
it 'should allow setting and retrieval' do
|
72
|
+
subject.adapter = :foo
|
73
|
+
expect(subject.adapter).to eq(:foo)
|
74
|
+
end
|
75
|
+
end
|
76
|
+
|
77
|
+
describe '#faraday_options' do
|
78
|
+
subject { Vertebrae::Configuration.new(host: 'example.com') }
|
79
|
+
|
80
|
+
it 'should include headers, ssl, and url settings by default' do
|
81
|
+
opts = subject.faraday_options
|
82
|
+
expect(opts.keys).to contain_exactly(:headers, :ssl, :url)
|
83
|
+
expect(opts[:headers]).to eq({'Accept' => 'application/json;q=0.1',
|
84
|
+
'Accept-Charset' => 'utf-8',
|
85
|
+
'User-Agent' => 'Vertebrae REST Gem',
|
86
|
+
'Content-Type' => 'application/json'})
|
87
|
+
expect(opts[:ssl]).to eq({})
|
88
|
+
expect(opts[:url]).to eq 'https://example.com/'
|
89
|
+
end
|
90
|
+
|
91
|
+
context 'with connection_options' do
|
92
|
+
let(:connection_options) { {ssl: {verify: false},
|
93
|
+
timeout: 5} }
|
94
|
+
|
95
|
+
subject { Vertebrae::Configuration.new(host: 'example.com', connection_options: connection_options) }
|
96
|
+
|
97
|
+
it 'should override and extend the default options' do
|
98
|
+
opts = subject.faraday_options
|
99
|
+
expect(opts.keys).to contain_exactly(:headers, :ssl, :timeout, :url)
|
100
|
+
expect(opts[:headers]).to eq({'Accept' => 'application/json;q=0.1',
|
101
|
+
'Accept-Charset' => 'utf-8',
|
102
|
+
'User-Agent' => 'Vertebrae REST Gem',
|
103
|
+
'Content-Type' => 'application/json'})
|
104
|
+
expect(opts[:ssl]).to eq({verify: false})
|
105
|
+
expect(opts[:url]).to eq 'https://example.com/'
|
106
|
+
expect(opts[:timeout]).to eq 5
|
107
|
+
end
|
108
|
+
end
|
109
|
+
|
110
|
+
context 'with additional_headers' do
|
111
|
+
let(:additional_headers) { {'special-auth-token' => 'abcde12345'} }
|
112
|
+
|
113
|
+
subject { Vertebrae::Configuration.new(host: 'example.com', additional_headers: additional_headers) }
|
114
|
+
|
115
|
+
it 'should add the additional headers to the other headers' do
|
116
|
+
opts = subject.faraday_options
|
117
|
+
expect(opts.keys).to contain_exactly(:headers, :ssl, :url)
|
118
|
+
expect(opts[:headers]).to eq({'Accept' => 'application/json;q=0.1',
|
119
|
+
'Accept-Charset' => 'utf-8',
|
120
|
+
'User-Agent' => 'Vertebrae REST Gem',
|
121
|
+
'Content-Type' => 'application/json',
|
122
|
+
'special-auth-token' => 'abcde12345'})
|
123
|
+
expect(opts[:ssl]).to eq({})
|
124
|
+
expect(opts[:url]).to eq 'https://example.com/'
|
125
|
+
end
|
126
|
+
end
|
127
|
+
end
|
128
|
+
end
|
data/spec/dummy/dummy.rb
ADDED
data/spec/logger_spec.rb
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'spec_helper'
|
4
|
+
|
5
|
+
describe 'logging' do
|
6
|
+
it "should have a logger" do
|
7
|
+
expect(Dummy).to respond_to(:logger)
|
8
|
+
end
|
9
|
+
|
10
|
+
it "should be able to log debug methods" do
|
11
|
+
expect(Dummy.logger).to respond_to(:debug)
|
12
|
+
end
|
13
|
+
|
14
|
+
it "should be settable" do
|
15
|
+
expect(Dummy).to respond_to(:logger=)
|
16
|
+
log = double
|
17
|
+
Dummy.logger = log
|
18
|
+
expect(Dummy.logger).to eq(log)
|
19
|
+
end
|
20
|
+
end
|
@@ -0,0 +1,89 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'spec_helper'
|
4
|
+
|
5
|
+
describe Vertebrae::Request do
|
6
|
+
let(:vb) { Vertebrae::API.new }
|
7
|
+
let(:path) { 'actionkit.api/rest/v1/action' }
|
8
|
+
let(:params) { {} }
|
9
|
+
let(:options) { {} }
|
10
|
+
|
11
|
+
it "knows how to make get request" do
|
12
|
+
expect(vb).to receive(:request).with(:get, path, params, options)
|
13
|
+
vb.get_request path, params, options
|
14
|
+
end
|
15
|
+
|
16
|
+
it "knows how to make patch request" do
|
17
|
+
expect(vb).to receive(:request).with(:patch, path, params, options)
|
18
|
+
vb.patch_request path, params, options
|
19
|
+
end
|
20
|
+
|
21
|
+
it "knows how to make post request" do
|
22
|
+
expect(vb).to receive(:request).with(:post, path, params, options)
|
23
|
+
vb.post_request path, params, options
|
24
|
+
end
|
25
|
+
|
26
|
+
it "knows how to make put request" do
|
27
|
+
expect(vb).to receive(:request).with(:put, path, params, options)
|
28
|
+
vb.put_request path, params, options
|
29
|
+
end
|
30
|
+
|
31
|
+
it "knows how to make delete request" do
|
32
|
+
vb.should_receive(:request).with(:delete, path, params, options)
|
33
|
+
vb.delete_request path, params, options
|
34
|
+
end
|
35
|
+
|
36
|
+
describe 'it should result in an appropriately configured connection object when it comes time to run transactions' do
|
37
|
+
before(:each) do
|
38
|
+
logger = double
|
39
|
+
logger.stub(:debug).and_return(true)
|
40
|
+
allow(Vertebrae::Base).to receive(:logger).and_return(logger)
|
41
|
+
allow_any_instance_of(Vertebrae::API).to receive(:default_options).and_return({host: 'test.com'})
|
42
|
+
end
|
43
|
+
|
44
|
+
context 'with an empty hash' do
|
45
|
+
let(:options) { {} }
|
46
|
+
it 'should make the request to the default host' do
|
47
|
+
stub_request(:get, 'https://test.com/path')
|
48
|
+
vb.request(:get, '/path', {}, options)
|
49
|
+
end
|
50
|
+
end
|
51
|
+
|
52
|
+
context 'with a different host' do
|
53
|
+
let(:options) { {host: 'test2.com'} }
|
54
|
+
it 'should make the request to the default host' do
|
55
|
+
stub_request(:get, 'https://test2.com/path')
|
56
|
+
vb.request(:get, '/path', {}, options)
|
57
|
+
end
|
58
|
+
end
|
59
|
+
|
60
|
+
context 'with host specified at client initiation time' do
|
61
|
+
let(:options) { {} }
|
62
|
+
|
63
|
+
let(:vb) { Vertebrae::API.new host: 'test3.com' }
|
64
|
+
|
65
|
+
it 'should make the request to the default host' do
|
66
|
+
stub_request(:get, 'https://test3.com/path')
|
67
|
+
vb.request(:get, '/path', {}, options)
|
68
|
+
end
|
69
|
+
|
70
|
+
context 'with a different host' do
|
71
|
+
let(:options) { {host: 'test2.com'} }
|
72
|
+
it 'should make the request to the default host' do
|
73
|
+
stub_request(:get, 'https://test2.com/path')
|
74
|
+
vb.request(:get, '/path', {}, options)
|
75
|
+
end
|
76
|
+
end
|
77
|
+
end
|
78
|
+
|
79
|
+
context 'with basic auth' do
|
80
|
+
let(:options) { {} }
|
81
|
+
let(:vb) { Vertebrae::API.new username: 'user', password: 'pass' }
|
82
|
+
|
83
|
+
it 'should make requests with basic auth' do
|
84
|
+
stub_request(:get, 'https://test3.com/path').with(basic_auth: %w[user pass])
|
85
|
+
vb.request(:get, '/path', {}, {host: 'test3.com'})
|
86
|
+
end
|
87
|
+
end
|
88
|
+
end
|
89
|
+
end
|
data/spec/spec_helper.rb
ADDED
@@ -0,0 +1,33 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
|
4
|
+
$LOAD_PATH.unshift(File.dirname(__FILE__))
|
5
|
+
require 'rspec'
|
6
|
+
require 'vertebrae'
|
7
|
+
require 'dummy/dummy'
|
8
|
+
require 'dummy/client'
|
9
|
+
require 'webmock/rspec'
|
10
|
+
|
11
|
+
require 'rspec/its'
|
12
|
+
|
13
|
+
# Requires supporting files with custom matchers and macros, etc,
|
14
|
+
# in ./support/ and its subdirectories.
|
15
|
+
Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].sort.each {|f| require f}
|
16
|
+
|
17
|
+
RSpec.configure do |config|
|
18
|
+
config.mock_with :rspec do |mocks|
|
19
|
+
mocks.syntax = [:should, :expect]
|
20
|
+
end
|
21
|
+
|
22
|
+
config.expect_with :rspec do |c|
|
23
|
+
c.syntax = [:should, :expect]
|
24
|
+
end
|
25
|
+
end
|
26
|
+
|
27
|
+
|
28
|
+
def reset_authentication_for(object)
|
29
|
+
%w[username password].each do |item|
|
30
|
+
Vertebrae::Base.send("#{item}=", nil)
|
31
|
+
object.send("#{item}=", nil)
|
32
|
+
end
|
33
|
+
end
|
data/vertebrae.gemspec
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
lib = File.expand_path('lib', __dir__)
|
4
4
|
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
5
|
-
require '
|
5
|
+
require 'version'
|
6
6
|
|
7
7
|
Gem::Specification.new do |s|
|
8
8
|
s.name = "vertebrae".freeze
|
@@ -11,19 +11,47 @@ Gem::Specification.new do |s|
|
|
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 = "
|
14
|
+
s.date = "2021-07-23"
|
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 = [
|
18
18
|
"LICENSE.txt",
|
19
19
|
"README.md"
|
20
20
|
]
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
21
|
+
s.files = [
|
22
|
+
".document",
|
23
|
+
".github/workflows/ci.yml",
|
24
|
+
".rspec",
|
25
|
+
".rubocop.yml",
|
26
|
+
".ruby-gemset",
|
27
|
+
".ruby-version",
|
28
|
+
"Gemfile",
|
29
|
+
"LICENSE.txt",
|
30
|
+
"README.md",
|
31
|
+
"Rakefile",
|
32
|
+
"VERSION",
|
33
|
+
"lib/api.rb",
|
34
|
+
"lib/authorization.rb",
|
35
|
+
"lib/base.rb",
|
36
|
+
"lib/configuration.rb",
|
37
|
+
"lib/connection.rb",
|
38
|
+
"lib/constants.rb",
|
39
|
+
"lib/core_ext/array.rb",
|
40
|
+
"lib/model.rb",
|
41
|
+
"lib/railties.rb",
|
42
|
+
"lib/request.rb",
|
43
|
+
"lib/response/raise_error.rb",
|
44
|
+
"lib/response_error.rb",
|
45
|
+
"lib/vertebrae.rb",
|
46
|
+
"spec/api_spec.rb",
|
47
|
+
"spec/configuration_spec.rb",
|
48
|
+
"spec/dummy/client.rb",
|
49
|
+
"spec/dummy/dummy.rb",
|
50
|
+
"spec/logger_spec.rb",
|
51
|
+
"spec/request_spec.rb",
|
52
|
+
"spec/spec_helper.rb",
|
53
|
+
"vertebrae.gemspec"
|
54
|
+
]
|
27
55
|
s.homepage = "http://github.com/controlshift/vertebrae".freeze
|
28
56
|
s.licenses = ["MIT".freeze]
|
29
57
|
s.summary = "API Client Infrastructure".freeze
|
@@ -32,28 +60,16 @@ Gem::Specification.new do |s|
|
|
32
60
|
s.specification_version = 4
|
33
61
|
end
|
34
62
|
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
else
|
47
|
-
s.add_dependency(%q<activesupport>.freeze, [">= 5.1.4"])
|
48
|
-
s.add_dependency(%q<faraday>.freeze, ["~> 1"])
|
49
|
-
s.add_dependency(%q<faraday_middleware>.freeze, ["> 0.12.2"])
|
50
|
-
s.add_dependency(%q<hashie>.freeze, ["> 3.5.7"])
|
51
|
-
s.add_dependency(%q<rspec>.freeze, [">= 0"])
|
52
|
-
s.add_dependency(%q<rake>.freeze, [">= 0"])
|
53
|
-
s.add_dependency(%q<bundler>.freeze, [">= 0"])
|
54
|
-
s.add_dependency(%q<webmock>.freeze, [">= 0"])
|
55
|
-
s.add_dependency(%q<rspec-its>.freeze, [">= 0"])
|
56
|
-
s.add_dependency(%q<rubocop>.freeze, [">= 0"])
|
57
|
-
end
|
63
|
+
s.add_runtime_dependency(%q<activesupport>.freeze, [">= 5.1.4"])
|
64
|
+
s.add_runtime_dependency(%q<faraday>.freeze, ["~> 2"])
|
65
|
+
s.add_runtime_dependency(%q<faraday-mashify>.freeze, [">= 0"])
|
66
|
+
s.add_runtime_dependency(%q<faraday-multipart>.freeze, [">= 0"])
|
67
|
+
|
68
|
+
s.add_development_dependency(%q<rspec>.freeze, [">= 0"])
|
69
|
+
s.add_development_dependency(%q<bundler>.freeze, [">= 0"])
|
70
|
+
s.add_development_dependency(%q<webmock>.freeze, [">= 0"])
|
71
|
+
s.add_development_dependency(%q<rspec-its>.freeze, [">= 0"])
|
72
|
+
s.add_development_dependency(%q<juwelier>.freeze, [">= 0"])
|
73
|
+
s.add_development_dependency(%q<rubocop>.freeze, [">= 0"])
|
58
74
|
end
|
59
75
|
|
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.
|
4
|
+
version: 1.0.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:
|
11
|
+
date: 2021-07-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -30,42 +30,42 @@ dependencies:
|
|
30
30
|
requirements:
|
31
31
|
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: '
|
33
|
+
version: '2'
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: '
|
40
|
+
version: '2'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
|
-
name:
|
42
|
+
name: faraday-mashify
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
|
-
- - "
|
45
|
+
- - ">="
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version: 0
|
47
|
+
version: '0'
|
48
48
|
type: :runtime
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
|
-
- - "
|
52
|
+
- - ">="
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version: 0
|
54
|
+
version: '0'
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
|
-
name:
|
56
|
+
name: faraday-multipart
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
|
-
- - "
|
59
|
+
- - ">="
|
60
60
|
- !ruby/object:Gem::Version
|
61
|
-
version:
|
61
|
+
version: '0'
|
62
62
|
type: :runtime
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
|
-
- - "
|
66
|
+
- - ">="
|
67
67
|
- !ruby/object:Gem::Version
|
68
|
-
version:
|
68
|
+
version: '0'
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: rspec
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
@@ -81,7 +81,7 @@ dependencies:
|
|
81
81
|
- !ruby/object:Gem::Version
|
82
82
|
version: '0'
|
83
83
|
- !ruby/object:Gem::Dependency
|
84
|
-
name:
|
84
|
+
name: bundler
|
85
85
|
requirement: !ruby/object:Gem::Requirement
|
86
86
|
requirements:
|
87
87
|
- - ">="
|
@@ -95,7 +95,7 @@ dependencies:
|
|
95
95
|
- !ruby/object:Gem::Version
|
96
96
|
version: '0'
|
97
97
|
- !ruby/object:Gem::Dependency
|
98
|
-
name:
|
98
|
+
name: webmock
|
99
99
|
requirement: !ruby/object:Gem::Requirement
|
100
100
|
requirements:
|
101
101
|
- - ">="
|
@@ -109,7 +109,7 @@ dependencies:
|
|
109
109
|
- !ruby/object:Gem::Version
|
110
110
|
version: '0'
|
111
111
|
- !ruby/object:Gem::Dependency
|
112
|
-
name:
|
112
|
+
name: rspec-its
|
113
113
|
requirement: !ruby/object:Gem::Requirement
|
114
114
|
requirements:
|
115
115
|
- - ">="
|
@@ -123,7 +123,7 @@ dependencies:
|
|
123
123
|
- !ruby/object:Gem::Version
|
124
124
|
version: '0'
|
125
125
|
- !ruby/object:Gem::Dependency
|
126
|
-
name:
|
126
|
+
name: juwelier
|
127
127
|
requirement: !ruby/object:Gem::Requirement
|
128
128
|
requirements:
|
129
129
|
- - ">="
|
@@ -161,7 +161,6 @@ extra_rdoc_files:
|
|
161
161
|
files:
|
162
162
|
- ".document"
|
163
163
|
- ".github/workflows/ci.yml"
|
164
|
-
- ".gitignore"
|
165
164
|
- ".rspec"
|
166
165
|
- ".rubocop.yml"
|
167
166
|
- ".ruby-gemset"
|
@@ -170,20 +169,27 @@ files:
|
|
170
169
|
- LICENSE.txt
|
171
170
|
- README.md
|
172
171
|
- Rakefile
|
172
|
+
- VERSION
|
173
|
+
- lib/api.rb
|
174
|
+
- lib/authorization.rb
|
175
|
+
- lib/base.rb
|
176
|
+
- lib/configuration.rb
|
177
|
+
- lib/connection.rb
|
178
|
+
- lib/constants.rb
|
173
179
|
- lib/core_ext/array.rb
|
180
|
+
- lib/model.rb
|
181
|
+
- lib/railties.rb
|
182
|
+
- lib/request.rb
|
183
|
+
- lib/response/raise_error.rb
|
184
|
+
- lib/response_error.rb
|
174
185
|
- lib/vertebrae.rb
|
175
|
-
-
|
176
|
-
-
|
177
|
-
-
|
178
|
-
-
|
179
|
-
-
|
180
|
-
-
|
181
|
-
-
|
182
|
-
- lib/vertebrae/railties.rb
|
183
|
-
- lib/vertebrae/request.rb
|
184
|
-
- lib/vertebrae/response/raise_error.rb
|
185
|
-
- lib/vertebrae/response_error.rb
|
186
|
-
- lib/vertebrae/version.rb
|
186
|
+
- spec/api_spec.rb
|
187
|
+
- spec/configuration_spec.rb
|
188
|
+
- spec/dummy/client.rb
|
189
|
+
- spec/dummy/dummy.rb
|
190
|
+
- spec/logger_spec.rb
|
191
|
+
- spec/request_spec.rb
|
192
|
+
- spec/spec_helper.rb
|
187
193
|
- vertebrae.gemspec
|
188
194
|
homepage: http://github.com/controlshift/vertebrae
|
189
195
|
licenses:
|
@@ -204,7 +210,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
204
210
|
- !ruby/object:Gem::Version
|
205
211
|
version: '0'
|
206
212
|
requirements: []
|
207
|
-
rubygems_version: 3.4.
|
213
|
+
rubygems_version: 3.4.1
|
208
214
|
signing_key:
|
209
215
|
specification_version: 4
|
210
216
|
summary: API Client Infrastructure
|
data/.gitignore
DELETED
@@ -1,26 +0,0 @@
|
|
1
|
-
# rcov generated
|
2
|
-
coverage
|
3
|
-
coverage.data
|
4
|
-
|
5
|
-
# rdoc generated
|
6
|
-
rdoc
|
7
|
-
|
8
|
-
# yard generated
|
9
|
-
doc
|
10
|
-
.yardoc
|
11
|
-
|
12
|
-
# bundler
|
13
|
-
.bundle
|
14
|
-
Gemfile.lock
|
15
|
-
|
16
|
-
# jeweler generated
|
17
|
-
pkg
|
18
|
-
|
19
|
-
# For MacOS:
|
20
|
-
#
|
21
|
-
.DS_Store
|
22
|
-
.idea
|
23
|
-
|
24
|
-
# For TextMate
|
25
|
-
*.tmproj
|
26
|
-
tmtags
|
data/lib/vertebrae/version.rb
DELETED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|