vertebrae 0.2.8 → 0.2.9
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/VERSION +1 -1
- data/lib/connection.rb +7 -7
- data/lib/request.rb +1 -0
- data/spec/api_spec.rb +16 -1
- data/vertebrae.gemspec +3 -3
- 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: b636dfc198fa18d2bbd56d43576c5c0d23856b2f
|
4
|
+
data.tar.gz: 5a96a3195d639196ee9d8ec35346ce2b3ff1f0c8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 12cc3175ee678bfef5a0d87b92a7b16dc6bcac15674cf346f626764c98bdfcff0615b88be476749907a093d7ef8e5de731be5b2d10e32ed7c1d9e3ca5f9f6da2
|
7
|
+
data.tar.gz: 5f97dfbab048ab323fa89f84789b24bf5a139f38d279a713911704289d707aca99f13873c3a4e4f88f232127822ca1458eed9223e942dff6838f53c7c06e8a09
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.2.
|
1
|
+
0.2.9
|
data/lib/connection.rb
CHANGED
@@ -23,10 +23,14 @@ module Vertebrae
|
|
23
23
|
def initialize(options)
|
24
24
|
@options = options
|
25
25
|
@configuration = Vertebrae::Configuration.new(options)
|
26
|
-
@connection = nil
|
27
26
|
@stack = nil
|
28
27
|
end
|
29
28
|
|
29
|
+
def options=(options)
|
30
|
+
@options = options
|
31
|
+
@configuration = Vertebrae::Configuration.new(options)
|
32
|
+
end
|
33
|
+
|
30
34
|
# Default middleware stack that uses default adapter as specified at
|
31
35
|
# configuration stage.
|
32
36
|
#
|
@@ -59,14 +63,10 @@ module Vertebrae
|
|
59
63
|
end
|
60
64
|
end
|
61
65
|
|
62
|
-
# Returns a
|
66
|
+
# Returns a Faraday::Connection object
|
63
67
|
#
|
64
68
|
def connection
|
65
|
-
|
66
|
-
@connection
|
67
|
-
else
|
68
|
-
@connection ||= Faraday.new(configuration.faraday_options.merge(:builder => stack))
|
69
|
-
end
|
69
|
+
Faraday.new(configuration.faraday_options.merge(:builder => stack))
|
70
70
|
end
|
71
71
|
end
|
72
72
|
end
|
data/lib/request.rb
CHANGED
data/spec/api_spec.rb
CHANGED
@@ -1,11 +1,26 @@
|
|
1
1
|
require 'spec_helper'
|
2
2
|
|
3
3
|
describe Vertebrae::API do
|
4
|
-
|
5
4
|
subject { described_class.new(options) }
|
6
5
|
|
7
6
|
it { described_class.included_modules.should include Vertebrae::Request }
|
8
7
|
|
8
|
+
describe 'initialize' do
|
9
|
+
before(:each) do
|
10
|
+
Vertebrae::API.any_instance.stub(:default_options).and_return({content_type: 'foo'})
|
11
|
+
end
|
12
|
+
|
13
|
+
context 'with an empty hash' do
|
14
|
+
let(:options) { {} }
|
15
|
+
specify { expect(subject.connection.options).to eq({content_type: 'foo'}) }
|
16
|
+
end
|
17
|
+
|
18
|
+
context 'with a default content-type' do
|
19
|
+
let(:options) { {content_type: 'text/csv'} }
|
20
|
+
specify { expect(subject.connection.options).to eq({content_type: 'text/csv'}) }
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
9
24
|
describe 'dummy' do
|
10
25
|
describe 'should delegate to the client class' do
|
11
26
|
specify{ Dummy.new.should respond_to(:api) }
|
data/vertebrae.gemspec
CHANGED
@@ -2,16 +2,16 @@
|
|
2
2
|
# DO NOT EDIT THIS FILE DIRECTLY
|
3
3
|
# Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
|
4
4
|
# -*- encoding: utf-8 -*-
|
5
|
-
# stub: vertebrae 0.2.
|
5
|
+
# stub: vertebrae 0.2.9 ruby lib
|
6
6
|
|
7
7
|
Gem::Specification.new do |s|
|
8
8
|
s.name = "vertebrae"
|
9
|
-
s.version = "0.2.
|
9
|
+
s.version = "0.2.9"
|
10
10
|
|
11
11
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
12
12
|
s.require_paths = ["lib"]
|
13
13
|
s.authors = ["Nathan Woodhull"]
|
14
|
-
s.date = "2014-08-
|
14
|
+
s.date = "2014-08-04"
|
15
15
|
s.description = "A set of low level infrastructure and reusable code for building API clients"
|
16
16
|
s.email = "nathan@controlshiftlabs.com"
|
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.2.
|
4
|
+
version: 0.2.9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nathan Woodhull
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-08-
|
11
|
+
date: 2014-08-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|