File tree Expand file tree Collapse file tree 3 files changed +36
-2
lines changed
lib/versioncake/strategies Expand file tree Collapse file tree 3 files changed +36
-2
lines changed Original file line number Diff line number Diff line change 11## Unreleased Changes
22
3- [ Full Changelog] ( https://github.com/bwillis/versioncake/compare/v3.4 ...master )
3+ [ Full Changelog] ( https://github.com/bwillis/versioncake/compare/v4.0 ...master )
44
55Bug Fixes:
66
@@ -14,6 +14,20 @@ Deprecations:
1414
1515* None
1616
17+ ## 4.0.0 (March 10, 2020)
18+
19+ Bug Fixes:
20+
21+ * Path versions could parse incorrect version in some circumstances (#83 ) thanks [ Luke Abel] ( https://github.com/llhhaa )
22+
23+ Enhancements:
24+
25+ * Rails 6 support (#81 ) thanks [ Thomas "Teflon Ted" Davis] ( https://github.com/trak3r )
26+
27+ Deprecations:
28+
29+ * Remove Rails v3/v4 and Ruby <v2.3 support
30+
1731## 3.4.0 (March 4, 2018)
1832
1933Bug Fixes:
Original file line number Diff line number Diff line change @@ -4,7 +4,7 @@ class PathParameterStrategy < ExtractionStrategy
44 def execute ( request )
55 version = nil
66 request . path . split ( '/' ) . find do |part |
7- next unless match = part . match ( %r{v (?<version>\d +)} )
7+ next unless match = part . match ( %r{\A v (?<version>\d +)\z } )
88 version = match [ :version ]
99 break
1010 end
Original file line number Diff line number Diff line change 1010 it { is_expected . to eq 11 }
1111 end
1212
13+ context "a request with a substring matching /v\d +/ returns nil" do
14+ context "as a postpended string" do
15+ let ( :request ) { instance_double ( 'Request' , path : 'parameter/aav11/parameter' ) }
16+
17+ it { is_expected . to be_nil }
18+ end
19+
20+ context "as a prepended string" do
21+ let ( :request ) { instance_double ( 'Request' , path : 'parameter/v11aa/parameter' ) }
22+
23+ it { is_expected . to be_nil }
24+ end
25+
26+ context "as an interstital string" do
27+ let ( :request ) { instance_double ( 'Request' , path : 'parameter/aav11aa/parameter' ) }
28+
29+ it { is_expected . to be_nil }
30+ end
31+ end
32+
1333 context "a request without an api_version path parameter returns nil" do
1434 let ( :request ) { instance_double ( 'Request' , path : 'parameter/parameter' ) }
1535
You can’t perform that action at this time.
0 commit comments