apill 2.0.1 → 2.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/apill/matchers/version_matcher.rb +5 -0
- data/lib/apill/version.rb +1 -1
- data/spec/apill/matchers/version_matcher_spec.rb +13 -0
- 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: 324554154383f6408cffde10e537effa59d4b928
|
4
|
+
data.tar.gz: c5b4dbfa7b10c87ae1861526fcda7eb6a1a55016
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8e5ba589f30445e86f402e2aefb0c9ea22b5dda8943a85bcf612a98fd48128c52749ab069cb267d267159143211d24bbf826c86d26905e895eab1a5d5210a07d
|
7
|
+
data.tar.gz: 8adaaa7dbf3dc3dba76f6be72503fc9b14973e82d5a726ad4591f9dbedbb76725f9c069c28ac71dba9b13fb37a03fe348fd4761cb034c3131797e5df42dc72ca
|
@@ -1,3 +1,4 @@
|
|
1
|
+
require 'apill/configuration'
|
1
2
|
require 'apill/matchers/generic_matcher'
|
2
3
|
|
3
4
|
module Apill
|
@@ -19,6 +20,10 @@ class VersionMatcher
|
|
19
20
|
def requested_version
|
20
21
|
accept_header.version || default_version
|
21
22
|
end
|
23
|
+
|
24
|
+
def default_version
|
25
|
+
@default_version || Apill.configuration.default_api_version
|
26
|
+
end
|
22
27
|
end
|
23
28
|
end
|
24
29
|
end
|
data/lib/apill/version.rb
CHANGED
@@ -61,6 +61,19 @@ describe VersionMatcher do
|
|
61
61
|
expect(matcher.matches?(request)).to be_a TrueClass
|
62
62
|
end
|
63
63
|
end
|
64
|
+
|
65
|
+
it 'matches the default version in the configuration if none is passed in' do
|
66
|
+
Apill.configuration.default_api_version = '100.0'
|
67
|
+
|
68
|
+
request = {
|
69
|
+
'API_APPLICATION_NAME' => 'matrix',
|
70
|
+
'HTTP_ACCEPT' => 'application/vnd.matrix+zion',
|
71
|
+
}
|
72
|
+
|
73
|
+
matcher = VersionMatcher.new(version_constraint: '100.0')
|
74
|
+
|
75
|
+
expect(matcher.matches?(request)).to be_a TrueClass
|
76
|
+
end
|
64
77
|
end
|
65
78
|
end
|
66
79
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: apill
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0
|
4
|
+
version: 2.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- jfelchner
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-11-
|
11
|
+
date: 2014-11-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: human_error
|