chronic_between 0.2.11 → 0.2.12

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.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 477a43d00b7b5f5ba9bb9577cbec7e23f74e37b0
4
+ data.tar.gz: 4154370117160cf97a9a248e25115ea2f21df855
5
+ SHA512:
6
+ metadata.gz: c2e5a20e6905e8d4b629b48b7df90f3f86ad457efb36f6fa60398050a7dea075c0dba0e1ac04ecb37b9b471a75ebb1bad2635150a9d116624d2fa5902dffe5a5
7
+ data.tar.gz: 2ec61b2561c8ae823426a6878dfc0324ca2cf18f8c5451cd62a4a474b25b0985c7bc00801f85197941c8d0ed3407f534366daf3a8a11f4bd65d3eb45dadfe06d
checksums.yaml.gz.sig ADDED
Binary file
@@ -13,11 +13,13 @@ class ChronicBetween
13
13
  def initialize(x)
14
14
 
15
15
  @times = x.is_a?(String) ? x.split(/[,;&]/).map(&:strip) : x
16
+ puts '@times : ' + @times.inspect
16
17
  @routes = {}; @params = {}
17
18
  end
18
19
 
19
- def within?(date)
20
+ def within?(raw_date)
20
21
 
22
+ date = raw_date.respond_to? ? :to_datetime : raw_date
21
23
  dates = []
22
24
 
23
25
  ranges(@params, date)
@@ -27,7 +29,8 @@ class ChronicBetween
27
29
  closed_times.map!{|x| x[/^#{negatives}(.*)/,2]}
28
30
 
29
31
  dates = build times
30
- inside_range = dates.detect {|d1, d2| date.between? d1, d2}
32
+ puts 'dates : ' + dates.inspect
33
+ inside_range = dates.detect {|d1, d2| p [d1,d2]; date.between? d1, d2}
31
34
 
32
35
  neg_dates = build closed_times
33
36
  inside_restrictions = neg_dates.detect {|d1, d2| date.between? d1, d2}
@@ -51,6 +54,7 @@ class ChronicBetween
51
54
  # e.g. Mon-Fri 9:00-16:30
52
55
  get %r{(\w+)-(\w+)\s+(\d[\w:]*)-(\d[\w:]*)$} do
53
56
  d1, d2, t1, t2 = params[:captures]
57
+ puts 'fooo'
54
58
  date_range_time_range(date, d1 ,d2, t1, t2)
55
59
  end
56
60
 
@@ -174,6 +178,7 @@ class ChronicBetween
174
178
 
175
179
  def build(times)
176
180
  times.inject([]) do |result, x|
181
+ puts 'x: ' + x
177
182
  r = run_route(x.strip)
178
183
  r.first.is_a?(Array) ? result + r : result << r
179
184
  end
@@ -185,6 +190,7 @@ class ChronicBetween
185
190
  x = (cdate2.to_date - n)
186
191
  datetime_range(x, t1, t2)
187
192
  end
193
+ return dates
188
194
  end
189
195
 
190
196
  def cdatetime_range(date, d1, t1, t2)
@@ -207,4 +213,4 @@ class ChronicBetween
207
213
 
208
214
  alias datetime_range time_range
209
215
 
210
- end
216
+ end
data.tar.gz.sig CHANGED
Binary file
metadata CHANGED
@@ -1,14 +1,13 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: chronic_between
3
- version: !ruby/object:Gem::Version
4
- prerelease:
5
- version: 0.2.11
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.2.12
6
5
  platform: ruby
7
- authors:
6
+ authors:
8
7
  - James Robertson
9
8
  autorequire:
10
9
  bindir: bin
11
- cert_chain:
10
+ cert_chain:
12
11
  - |
13
12
  -----BEGIN CERTIFICATE-----
14
13
  MIIDRDCCAiygAwIBAgIBADANBgkqhkiG9w0BAQUFADBIMRIwEAYDVQQDDAlnZW1t
@@ -30,67 +29,64 @@ cert_chain:
30
29
  aQjggWe+thx9aRnac+FunPZ7ltAgjkOreOsrc0fCXFmRlvDjbnCNBvpi4PhfHXzh
31
30
  VK9OMDms3W3rq/ODn7ohj8ao4ZtQdcvF
32
31
  -----END CERTIFICATE-----
33
-
34
- date: 2013-02-06 00:00:00 Z
35
- dependencies:
36
- - !ruby/object:Gem::Dependency
32
+ date: 2013-05-14 00:00:00.000000000 Z
33
+ dependencies:
34
+ - !ruby/object:Gem::Dependency
37
35
  name: chronic
38
- prerelease: false
39
- requirement: &id001 !ruby/object:Gem::Requirement
40
- none: false
41
- requirements:
42
- - - ">="
43
- - !ruby/object:Gem::Version
44
- version: "0"
36
+ requirement: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - '>='
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
45
41
  type: :runtime
46
- version_requirements: *id001
47
- - !ruby/object:Gem::Dependency
48
- name: app-routes
49
42
  prerelease: false
50
- requirement: &id002 !ruby/object:Gem::Requirement
51
- none: false
52
- requirements:
53
- - - ">="
54
- - !ruby/object:Gem::Version
55
- version: "0"
43
+ version_requirements: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - '>='
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
48
+ - !ruby/object:Gem::Dependency
49
+ name: app-routes
50
+ requirement: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - '>='
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
56
55
  type: :runtime
57
- version_requirements: *id002
56
+ prerelease: false
57
+ version_requirements: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - '>='
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
58
62
  description:
59
63
  email:
60
64
  executables: []
61
-
62
65
  extensions: []
63
-
64
66
  extra_rdoc_files: []
65
-
66
- files:
67
+ files:
67
68
  - lib/chronic_between.rb
68
69
  homepage:
69
70
  licenses: []
70
-
71
+ metadata: {}
71
72
  post_install_message:
72
73
  rdoc_options: []
73
-
74
- require_paths:
74
+ require_paths:
75
75
  - lib
76
- required_ruby_version: !ruby/object:Gem::Requirement
77
- none: false
78
- requirements:
79
- - - ">="
80
- - !ruby/object:Gem::Version
81
- version: "0"
82
- required_rubygems_version: !ruby/object:Gem::Requirement
83
- none: false
84
- requirements:
85
- - - ">="
86
- - !ruby/object:Gem::Version
87
- version: "0"
76
+ required_ruby_version: !ruby/object:Gem::Requirement
77
+ requirements:
78
+ - - '>='
79
+ - !ruby/object:Gem::Version
80
+ version: '0'
81
+ required_rubygems_version: !ruby/object:Gem::Requirement
82
+ requirements:
83
+ - - '>='
84
+ - !ruby/object:Gem::Version
85
+ version: '0'
88
86
  requirements: []
89
-
90
87
  rubyforge_project:
91
- rubygems_version: 1.8.23
88
+ rubygems_version: 2.0.0.rc.2
92
89
  signing_key:
93
- specification_version: 3
90
+ specification_version: 4
94
91
  summary: chronic_between
95
92
  test_files: []
96
-
metadata.gz.sig CHANGED
Binary file