apill 3.1.0 → 3.1.1

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: 8bb09a75851259a89a82d3d9aff3a5aa05a7f72a
4
- data.tar.gz: db6adc23f9d21ce30143c5aa7083af136aed499e
3
+ metadata.gz: 82eff4962347e3b4c65a8223c44d57728b42b327
4
+ data.tar.gz: a8bdd368f13006347c8598336ad95205bb98efc8
5
5
  SHA512:
6
- metadata.gz: e1ca8cda7cf22f3f190b0dd91524ad577b5ddb8da3bbd41c8fedfc289f986ea95be73f00e01acac0e43ba1ac11994111e4832d2d270a1ddb13194a0c19cd051a
7
- data.tar.gz: fb581d7be8f0a54863939b990779f55bc968ca65b13ef2e45454ba0b106d1a87c1bb3dadf8fa0929d7291bb66c3362bf6bf153e28703271beed6edd18d8916ba
6
+ metadata.gz: 63b7196beff9b5535f9734c2abd8674623fcb139682e0dd42ee63cc57720402bc7cd829f2311dfcc83dfcfa1e0b2c3e7c8834e640d60e44be5b45d202c3c146f
7
+ data.tar.gz: 8eeb02a3792009cba05528d7469a4aa0d89624a98f6ac47098a2fc45f0b05bbbb06ebc795d4e0f5d1e77ca070754039699d8e84b7e968d969e5b889bedf57f22
@@ -1,7 +1,8 @@
1
1
  module Apill
2
2
  class Parameters
3
3
  class Filter
4
- NUMERICAL_RANGE = /\A([\d\.]+?)\.\.\.?([\d\.]+?)\z/
4
+ NUMERICAL = /[\d_\.]+?/
5
+ NUMERICAL_RANGE = /\A(#{NUMERICAL})\.\.\.?(#{NUMERICAL}|Infinity)\z/
5
6
 
6
7
  attr_accessor :raw_parameters
7
8
 
@@ -38,7 +39,11 @@ class Filter
38
39
  if range_points = value.match(NUMERICAL_RANGE)
39
40
  exclusive = value.include? '...'
40
41
  starting_point = range_points[1].to_f
41
- ending_point = range_points[2].to_f
42
+ ending_point = if range_points[2] == 'Infinity'
43
+ Float::INFINITY
44
+ else
45
+ range_points[2].to_f
46
+ end
42
47
 
43
48
  Range.new(starting_point, ending_point, exclusive)
44
49
  else
data/lib/apill/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Apill
2
- VERSION = '3.1.0'
2
+ VERSION = '3.1.1'
3
3
  end
@@ -67,14 +67,18 @@ describe Filtering do
67
67
  filtering = Filtering.new(filtering_resource,
68
68
  'filter' => {
69
69
  'stuff' => '100...200',
70
- 'other_stuff' => '333.33..888.0',
70
+ 'infinity' => '9...Infinity',
71
+ 'other_stuff' => '3_333.33..8_8__8.0',
71
72
  })
72
73
 
73
74
  allow(filtering_resource).to receive(:for_stuff).
74
75
  with(100.0...200.0).
75
76
  and_return filtering_resource
77
+ allow(filtering_resource).to receive(:infinity).
78
+ with(9...Float::INFINITY).
79
+ and_return filtering_resource
76
80
  allow(filtering_resource).to receive(:other_stuff).
77
- with(333.33..888.0).
81
+ with(3333.33..888.0).
78
82
  and_return 'other_stuffed'
79
83
 
80
84
  expect(filtering.processed).to eql 'other_stuffed'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: apill
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.1.0
4
+ version: 3.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - jfelchner