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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 65008c57d17fb82a15d324f195cacbd30e6dfeb9
4
- data.tar.gz: 2616e1865c1439b020562fb78d9b9734989beb9b
3
+ metadata.gz: 324554154383f6408cffde10e537effa59d4b928
4
+ data.tar.gz: c5b4dbfa7b10c87ae1861526fcda7eb6a1a55016
5
5
  SHA512:
6
- metadata.gz: f6da66b5e33f3d908deddb8a021a69c17d91d9c440633d7f4a8710c9dba97b8c99d786dfddcd01429e6da7d068c8fcc68a13da94935786aa64b6e88c0d61895d
7
- data.tar.gz: 12d5c522a20079faa70f272f17cd3accff2e0436d0573300fb07c2df9f4e18f558adb3ff1a04d62bdb2b30db371f4cb3a9b2ed40538dcd34b0ee6bbcc144c533
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
@@ -1,3 +1,3 @@
1
1
  module Apill
2
- VERSION = '2.0.1'
2
+ VERSION = '2.1.0'
3
3
  end
@@ -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.1
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-06 00:00:00.000000000 Z
11
+ date: 2014-11-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: human_error