query_string_interface 0.2.0 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/Gemfile CHANGED
@@ -4,6 +4,7 @@ gemspec
4
4
 
5
5
  gem "rake", "0.8.7"
6
6
  gem "i18n"
7
+ gem "tzinfo"
7
8
 
8
9
  platforms :mri_18 do
9
10
  gem "ruby-debug"
data/Gemfile.lock CHANGED
@@ -1,33 +1,33 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- query_string_interface (0.1.0)
4
+ query_string_interface (0.3.0)
5
5
  activesupport (>= 3.0.0)
6
6
 
7
7
  GEM
8
8
  remote: http://rubygems.org/
9
9
  specs:
10
- activesupport (3.1.0)
10
+ activesupport (3.1.3)
11
11
  multi_json (~> 1.0)
12
12
  archive-tar-minitar (0.5.2)
13
- columnize (0.3.4)
13
+ columnize (0.3.5)
14
14
  diff-lcs (1.1.3)
15
15
  i18n (0.6.0)
16
16
  linecache (0.46)
17
17
  rbx-require-relative (> 0.0.4)
18
18
  linecache19 (0.5.12)
19
19
  ruby_core_source (>= 0.1.4)
20
- multi_json (1.0.3)
20
+ multi_json (1.0.4)
21
21
  rake (0.8.7)
22
22
  rbx-require-relative (0.0.5)
23
- rspec (2.6.0)
24
- rspec-core (~> 2.6.0)
25
- rspec-expectations (~> 2.6.0)
26
- rspec-mocks (~> 2.6.0)
27
- rspec-core (2.6.4)
28
- rspec-expectations (2.6.0)
23
+ rspec (2.7.0)
24
+ rspec-core (~> 2.7.0)
25
+ rspec-expectations (~> 2.7.0)
26
+ rspec-mocks (~> 2.7.0)
27
+ rspec-core (2.7.1)
28
+ rspec-expectations (2.7.0)
29
29
  diff-lcs (~> 1.1.2)
30
- rspec-mocks (2.6.0)
30
+ rspec-mocks (2.7.0)
31
31
  ruby-debug (0.10.4)
32
32
  columnize (>= 0.1)
33
33
  ruby-debug-base (~> 0.10.4.0)
@@ -43,10 +43,11 @@ GEM
43
43
  ruby-debug-base19 (>= 0.11.19)
44
44
  ruby_core_source (0.1.5)
45
45
  archive-tar-minitar (>= 0.5.2)
46
- simplecov (0.5.3)
46
+ simplecov (0.5.4)
47
47
  multi_json (~> 1.0.3)
48
48
  simplecov-html (~> 0.5.3)
49
49
  simplecov-html (0.5.3)
50
+ tzinfo (0.3.31)
50
51
 
51
52
  PLATFORMS
52
53
  ruby
@@ -59,3 +60,4 @@ DEPENDENCIES
59
60
  ruby-debug
60
61
  ruby-debug19
61
62
  simplecov
63
+ tzinfo
@@ -1,13 +1,15 @@
1
1
  module QueryStringInterface
2
2
  module Parsers
3
3
  class DateTimeParser
4
- DATE_REGEX = /^(?:\d{4}-\d{2}-\d{2}|\d{4}-\d{1,2}-\d{1,2}[T \t]+\d{1,2}:\d{2}:\d{2}(\.[0-9]*)?([ \t]*)(Z?|[-+]\d{2}?(:?\d{2})?))$/
4
+ DATE_REGEX = /^(?:\d{4}-\d{2}-\d{2}|\d{4}-\d{1,2}-\d{1,2}[T \t]+\d{1,2}:\d{2}:\d{2}(\.[0-9]*)?([ \t]*)(Z?|[-+\s]\d{2}?(:?\d{2})?))$/
5
+ ESCAPED_ZONE_REGEX = /\s(\d{2}:\d{2})$/
5
6
 
6
7
  def parseable?(value, operator)
7
8
  DATE_REGEX.match(value)
8
9
  end
9
10
 
10
11
  def parse(value)
12
+ value.gsub!(ESCAPED_ZONE_REGEX) { "+#{$1}" }
11
13
  Time.parse(value)
12
14
  end
13
15
  end
@@ -1,3 +1,3 @@
1
1
  module QueryStringInterface
2
- VERSION = "0.2.0"
2
+ VERSION = "0.3.0"
3
3
  end
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: query_string_interface
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.2.0
5
+ version: 0.3.0
6
6
  platform: ruby
7
7
  authors:
8
8
  - Vicente Mundim