http_range 1.1.1 → 1.2.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: 246bb94ed8b4e0884b2a32a64048c0a88e17e01a
4
- data.tar.gz: f98bc9e3a61596f2323cd3be1c730b1db355d778
3
+ metadata.gz: 6b3a78f935e3df0d2506ce61fd577f514be04c2a
4
+ data.tar.gz: d851832a14182dec3c044d3dd604899f9c501ca6
5
5
  SHA512:
6
- metadata.gz: 67f42c7422fb9d50721a5a63e06d585841d067ea19d9141446da10a36fc2bb6511c9bf9c75d330b0ad77b528ce3c7e7430e18fa8318235d1b09a07f35dca8cb3
7
- data.tar.gz: 58cde1cbaa60e9fab3df05016cdfe8888fa3f694049cd7b5704e4db5d040b2efb3417febf7234f89a38d66b66498f51a28e41eee898627e8755d2ee69ae95b7e
6
+ metadata.gz: 1ff3237e954af1b0fd8ecefc652fe2f1013e3ab1f212d529acf12eb119b85d5653a22cf024adf642dc2b0e0dfa33c1d0f1ce44fbd50c9df5014fcc581aefea4b
7
+ data.tar.gz: 0fbe6c90f0acc760a61072461d6eeb0deb34fd8326c105e15905f142ca01aec50914eafcb5ec40fa34d43179529b40f497c492ed709ab58c9c0be4c08f36580c
@@ -52,9 +52,9 @@ class HTTPRange
52
52
  (?<attribute>[a-zA-Z][\w\.-]*)
53
53
  \s+
54
54
  (?<first_exclusive>\])?
55
- (?<first>[^\.]*?)
55
+ (?<first>\S*?[^\.])?
56
56
  \.\.
57
- (?<last>[^\.]*?)
57
+ (?<last>[^\.]\S*?)?
58
58
  (?<last_exclusive>\[)?
59
59
  \z/x
60
60
 
@@ -1,3 +1,3 @@
1
1
  class HTTPRange
2
- VERSION = '1.1.1'
2
+ VERSION = '1.2.0'
3
3
  end
@@ -33,6 +33,24 @@ RSpec.describe HTTPRange do
33
33
  it { expect(subject.order).to eq('desc') }
34
34
  end
35
35
 
36
+ context "for a Range header with no first or last endpoints" do
37
+ let(:header) { "Range: created_at .." }
38
+
39
+ it { expect(subject.attribute).to eq('created_at') }
40
+ it { expect(subject.first).to be_nil }
41
+ it { expect(subject.last).to be_nil }
42
+ it { expect(subject.max).to be_nil }
43
+ end
44
+
45
+ context "for a Range header with ISO-8601 dates plus nanoseconds" do
46
+ let(:header) { "Range: created_at 2014-09-23T17:21:10.324562213Z..2014-09-23T17:21:10.328823821Z" }
47
+
48
+ it { expect(subject.attribute).to eq('created_at') }
49
+ it { expect(subject.first).to eq('2014-09-23T17:21:10.324562213Z') }
50
+ it { expect(subject.last).to eq('2014-09-23T17:21:10.328823821Z') }
51
+ it { expect(subject.max).to be_nil }
52
+ end
53
+
36
54
  context "for a Range header with an invalid order param" do
37
55
  let(:header) { "Range: purple.cycle-cleaner_knob ]1e3f..2e5a; order=true" }
38
56
 
@@ -1,4 +1,4 @@
1
- require 'http_range'
1
+ require 'http_range/middleware/accept_ranges'
2
2
  require 'spec_helper'
3
3
 
4
4
  RSpec.describe HTTPRange::Middleware::AcceptRanges do
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: http_range
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.1
4
+ version: 1.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brad Fults
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-09-19 00:00:00.000000000 Z
11
+ date: 2014-09-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler