timely 0.0.2 → 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (52) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +4 -0
  3. data/.rspec +2 -0
  4. data/.travis.yml +14 -0
  5. data/CHANGELOG.md +5 -0
  6. data/Gemfile +1 -12
  7. data/README.md +5 -0
  8. data/Rakefile +1 -139
  9. data/gemfiles/rails3.gemfile +8 -0
  10. data/gemfiles/rails4.gemfile +9 -0
  11. data/lib/timely.rb +7 -3
  12. data/lib/timely/date.rb +20 -0
  13. data/lib/timely/date_chooser.rb +10 -5
  14. data/lib/timely/date_range.rb +47 -10
  15. data/lib/timely/rails.rb +10 -3
  16. data/lib/timely/rails/calendar_tag.rb +52 -0
  17. data/lib/timely/rails/date.rb +5 -0
  18. data/lib/timely/rails/date_group.rb +68 -99
  19. data/lib/timely/rails/date_range_validity_module.rb +27 -0
  20. data/lib/timely/rails/date_time.rb +20 -0
  21. data/lib/timely/rails/extensions.rb +23 -11
  22. data/lib/timely/rails/period.rb +31 -0
  23. data/lib/timely/rails/season.rb +65 -75
  24. data/lib/timely/railtie.rb +7 -0
  25. data/lib/timely/temporal_patterns/finder.rb +152 -0
  26. data/lib/timely/temporal_patterns/frequency.rb +108 -0
  27. data/lib/timely/temporal_patterns/interval.rb +67 -0
  28. data/lib/timely/temporal_patterns/pattern.rb +160 -0
  29. data/lib/timely/time_since.rb +17 -0
  30. data/lib/timely/version.rb +3 -0
  31. data/spec/calendar_tag_spec.rb +29 -0
  32. data/spec/date_chooser_spec.rb +36 -27
  33. data/spec/date_group_spec.rb +9 -9
  34. data/spec/date_range_spec.rb +58 -20
  35. data/spec/date_spec.rb +20 -12
  36. data/spec/extensions_spec.rb +32 -0
  37. data/spec/rails/date_spec.rb +16 -0
  38. data/spec/rails/date_time_spec.rb +20 -0
  39. data/spec/rails/period_spec.rb +17 -0
  40. data/spec/schema.rb +5 -0
  41. data/spec/season_spec.rb +21 -24
  42. data/spec/spec_helper.rb +5 -20
  43. data/spec/string_spec.rb +4 -3
  44. data/spec/support/coverage.rb +26 -0
  45. data/spec/temporal_patterns_spec.rb +28 -0
  46. data/spec/time_since_spec.rb +24 -0
  47. data/spec/time_spec.rb +14 -14
  48. data/spec/trackable_date_set_spec.rb +14 -14
  49. data/spec/week_days_spec.rb +18 -18
  50. data/timely.gemspec +34 -98
  51. metadata +244 -21
  52. data/lib/timely/temporal_patterns.rb +0 -441
data/timely.gemspec CHANGED
@@ -1,99 +1,35 @@
1
- ## This is the rakegem gemspec template. Make sure you read and understand
2
- ## all of the comments. Some sections require modification, and others can
3
- ## be deleted if you don't need them. Once you understand the contents of
4
- ## this file, feel free to delete any comments that begin with two hash marks.
5
- ## You can find comprehensive Gem::Specification documentation, at
6
- ## http://docs.rubygems.org/read/chapter/20
7
- Gem::Specification.new do |s|
8
- s.specification_version = 2 if s.respond_to? :specification_version=
9
- s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
10
- s.rubygems_version = '1.3.5'
11
-
12
- ## Leave these as is they will be modified for you by the rake gemspec task.
13
- ## If your rubyforge_project name is different, then edit it and comment out
14
- ## the sub! line in the Rakefile
15
- s.name = 'timely'
16
- s.version = '0.0.2'
17
- s.date = '2012-05-27'
18
- s.rubyforge_project = 'timely'
19
-
20
- ## Make sure your summary is short. The description may be as long
21
- ## as you like.
22
- s.summary = "Set of time, date, weekday related methods."
23
- s.description = "See README for full details on how to install, use, etc."
24
-
25
- ## List the primary authors. If there are a bunch of authors, it's probably
26
- ## better to set the email to an email list or something. If you don't have
27
- ## a custom homepage, consider using your GitHub URL or the like.
28
- s.authors = ["Michael Noack"]
29
- s.email = 'development@travellink.com.au'
30
- s.homepage = 'http://github.com/sealink/timely'
31
-
32
- ## This gets added to the $LOAD_PATH so that 'lib/NAME.rb' can be required as
33
- ## require 'NAME.rb' or'/lib/NAME/file.rb' can be as require 'NAME/file.rb'
34
- s.require_paths = %w[lib]
35
-
36
- ## This sections is only necessary if you have C extensions.
37
- # s.require_paths << 'ext'
38
- # s.extensions = %w[ext/extconf.rb]
39
-
40
- ## If your gem includes any executables, list them here.
41
- # s.executables = ["name"]
42
-
43
- ## Specify any RDoc options here. You'll want to add your README and
44
- ## LICENSE files to the extra_rdoc_files list.
45
- s.rdoc_options = ["--charset=UTF-8"]
46
- s.extra_rdoc_files = %w[README.md LICENSE]
47
-
48
- ## List your runtime dependencies here. Runtime dependencies are those
49
- ## that are needed for an end user to actually USE your code.
50
-
51
- ## List your development dependencies here. Development dependencies are
52
- ## those that are only needed during development
53
- # s.add_development_dependency('DEVDEPNAME', [">= 1.1.0", "< 2.0.0"])
54
-
55
- ## Leave this section as-is. It will be automatically generated from the
56
- ## contents of your Git repository via the gemspec task. DO NOT REMOVE
57
- ## THE MANIFEST COMMENTS, they are used as delimiters by the task.
58
- # = MANIFEST =
59
- s.files = %w[
60
- Gemfile
61
- HISTORY.md
62
- LICENSE
63
- README.md
64
- Rakefile
65
- lib/timely.rb
66
- lib/timely/date.rb
67
- lib/timely/date_chooser.rb
68
- lib/timely/date_range.rb
69
- lib/timely/date_time.rb
70
- lib/timely/rails.rb
71
- lib/timely/rails/date_group.rb
72
- lib/timely/rails/extensions.rb
73
- lib/timely/rails/season.rb
74
- lib/timely/range.rb
75
- lib/timely/string.rb
76
- lib/timely/temporal_patterns.rb
77
- lib/timely/time.rb
78
- lib/timely/trackable_date_set.rb
79
- lib/timely/week_days.rb
80
- rails/init.rb
81
- spec/date_chooser_spec.rb
82
- spec/date_group_spec.rb
83
- spec/date_range_spec.rb
84
- spec/date_spec.rb
85
- spec/schema.rb
86
- spec/season_spec.rb
87
- spec/spec_helper.rb
88
- spec/string_spec.rb
89
- spec/time_spec.rb
90
- spec/trackable_date_set_spec.rb
91
- spec/week_days_spec.rb
92
- timely.gemspec
93
- ]
94
- # = MANIFEST =
95
-
96
- ## Test files will be grabbed from the file list. Make sure the path glob
97
- ## matches what you actually use.
98
- s.test_files = s.files.select { |path| path =~ /^test\/test_.*\.rb/ }
1
+ # coding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'timely/version'
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = "timely"
8
+ spec.version = Timely::VERSION
9
+ spec.authors = ["Michael Noack"]
10
+ spec.email = ["support@travellink.com.au"]
11
+ spec.description = %q{Set of time, date, weekday related methods.}
12
+ spec.summary = %q{Set of time, date, weekday related methods.}
13
+ spec.homepage = 'http://github.com/sealink/timely'
14
+
15
+ spec.license = "MIT"
16
+
17
+ spec.files = `git ls-files`.split($/)
18
+ spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
19
+ spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
20
+ spec.require_paths = ["lib"]
21
+
22
+ spec.add_development_dependency "bundler", "~> 1.3"
23
+ spec.add_development_dependency "rake"
24
+ spec.add_development_dependency 'rspec'
25
+ spec.add_development_dependency 'rspec-its'
26
+ spec.add_development_dependency 'simplecov'
27
+ spec.add_development_dependency 'simplecov-rcov'
28
+ spec.add_development_dependency 'coveralls'
29
+ spec.add_development_dependency 'sqlite3'
30
+ spec.add_development_dependency 'activesupport'
31
+ spec.add_development_dependency 'activerecord'
32
+ spec.add_development_dependency 'actionpack'
33
+ spec.add_development_dependency 'timecop'
34
+ spec.add_development_dependency 'travis'
99
35
  end
metadata CHANGED
@@ -1,80 +1,303 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: timely
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
5
- prerelease:
4
+ version: 0.1.0
6
5
  platform: ruby
7
6
  authors:
8
7
  - Michael Noack
9
8
  autorequire:
10
9
  bindir: bin
11
10
  cert_chain: []
12
- date: 2012-05-27 00:00:00.000000000 Z
13
- dependencies: []
14
- description: See README for full details on how to install, use, etc.
15
- email: development@travellink.com.au
11
+ date: 2016-06-15 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: bundler
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '1.3'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '1.3'
27
+ - !ruby/object:Gem::Dependency
28
+ name: rake
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ">="
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: rspec
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ">="
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ">="
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
55
+ - !ruby/object:Gem::Dependency
56
+ name: rspec-its
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - ">="
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ">="
67
+ - !ruby/object:Gem::Version
68
+ version: '0'
69
+ - !ruby/object:Gem::Dependency
70
+ name: simplecov
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - ">="
74
+ - !ruby/object:Gem::Version
75
+ version: '0'
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - ">="
81
+ - !ruby/object:Gem::Version
82
+ version: '0'
83
+ - !ruby/object:Gem::Dependency
84
+ name: simplecov-rcov
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - ">="
88
+ - !ruby/object:Gem::Version
89
+ version: '0'
90
+ type: :development
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - ">="
95
+ - !ruby/object:Gem::Version
96
+ version: '0'
97
+ - !ruby/object:Gem::Dependency
98
+ name: coveralls
99
+ requirement: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - ">="
102
+ - !ruby/object:Gem::Version
103
+ version: '0'
104
+ type: :development
105
+ prerelease: false
106
+ version_requirements: !ruby/object:Gem::Requirement
107
+ requirements:
108
+ - - ">="
109
+ - !ruby/object:Gem::Version
110
+ version: '0'
111
+ - !ruby/object:Gem::Dependency
112
+ name: sqlite3
113
+ requirement: !ruby/object:Gem::Requirement
114
+ requirements:
115
+ - - ">="
116
+ - !ruby/object:Gem::Version
117
+ version: '0'
118
+ type: :development
119
+ prerelease: false
120
+ version_requirements: !ruby/object:Gem::Requirement
121
+ requirements:
122
+ - - ">="
123
+ - !ruby/object:Gem::Version
124
+ version: '0'
125
+ - !ruby/object:Gem::Dependency
126
+ name: activesupport
127
+ requirement: !ruby/object:Gem::Requirement
128
+ requirements:
129
+ - - ">="
130
+ - !ruby/object:Gem::Version
131
+ version: '0'
132
+ type: :development
133
+ prerelease: false
134
+ version_requirements: !ruby/object:Gem::Requirement
135
+ requirements:
136
+ - - ">="
137
+ - !ruby/object:Gem::Version
138
+ version: '0'
139
+ - !ruby/object:Gem::Dependency
140
+ name: activerecord
141
+ requirement: !ruby/object:Gem::Requirement
142
+ requirements:
143
+ - - ">="
144
+ - !ruby/object:Gem::Version
145
+ version: '0'
146
+ type: :development
147
+ prerelease: false
148
+ version_requirements: !ruby/object:Gem::Requirement
149
+ requirements:
150
+ - - ">="
151
+ - !ruby/object:Gem::Version
152
+ version: '0'
153
+ - !ruby/object:Gem::Dependency
154
+ name: actionpack
155
+ requirement: !ruby/object:Gem::Requirement
156
+ requirements:
157
+ - - ">="
158
+ - !ruby/object:Gem::Version
159
+ version: '0'
160
+ type: :development
161
+ prerelease: false
162
+ version_requirements: !ruby/object:Gem::Requirement
163
+ requirements:
164
+ - - ">="
165
+ - !ruby/object:Gem::Version
166
+ version: '0'
167
+ - !ruby/object:Gem::Dependency
168
+ name: timecop
169
+ requirement: !ruby/object:Gem::Requirement
170
+ requirements:
171
+ - - ">="
172
+ - !ruby/object:Gem::Version
173
+ version: '0'
174
+ type: :development
175
+ prerelease: false
176
+ version_requirements: !ruby/object:Gem::Requirement
177
+ requirements:
178
+ - - ">="
179
+ - !ruby/object:Gem::Version
180
+ version: '0'
181
+ - !ruby/object:Gem::Dependency
182
+ name: travis
183
+ requirement: !ruby/object:Gem::Requirement
184
+ requirements:
185
+ - - ">="
186
+ - !ruby/object:Gem::Version
187
+ version: '0'
188
+ type: :development
189
+ prerelease: false
190
+ version_requirements: !ruby/object:Gem::Requirement
191
+ requirements:
192
+ - - ">="
193
+ - !ruby/object:Gem::Version
194
+ version: '0'
195
+ description: Set of time, date, weekday related methods.
196
+ email:
197
+ - support@travellink.com.au
16
198
  executables: []
17
199
  extensions: []
18
- extra_rdoc_files:
19
- - README.md
20
- - LICENSE
200
+ extra_rdoc_files: []
21
201
  files:
202
+ - ".gitignore"
203
+ - ".rspec"
204
+ - ".travis.yml"
205
+ - CHANGELOG.md
22
206
  - Gemfile
23
207
  - HISTORY.md
24
208
  - LICENSE
25
209
  - README.md
26
210
  - Rakefile
211
+ - gemfiles/rails3.gemfile
212
+ - gemfiles/rails4.gemfile
27
213
  - lib/timely.rb
28
214
  - lib/timely/date.rb
29
215
  - lib/timely/date_chooser.rb
30
216
  - lib/timely/date_range.rb
31
217
  - lib/timely/date_time.rb
32
218
  - lib/timely/rails.rb
219
+ - lib/timely/rails/calendar_tag.rb
220
+ - lib/timely/rails/date.rb
33
221
  - lib/timely/rails/date_group.rb
222
+ - lib/timely/rails/date_range_validity_module.rb
223
+ - lib/timely/rails/date_time.rb
34
224
  - lib/timely/rails/extensions.rb
225
+ - lib/timely/rails/period.rb
35
226
  - lib/timely/rails/season.rb
227
+ - lib/timely/railtie.rb
36
228
  - lib/timely/range.rb
37
229
  - lib/timely/string.rb
38
- - lib/timely/temporal_patterns.rb
230
+ - lib/timely/temporal_patterns/finder.rb
231
+ - lib/timely/temporal_patterns/frequency.rb
232
+ - lib/timely/temporal_patterns/interval.rb
233
+ - lib/timely/temporal_patterns/pattern.rb
39
234
  - lib/timely/time.rb
235
+ - lib/timely/time_since.rb
40
236
  - lib/timely/trackable_date_set.rb
237
+ - lib/timely/version.rb
41
238
  - lib/timely/week_days.rb
42
239
  - rails/init.rb
240
+ - spec/calendar_tag_spec.rb
43
241
  - spec/date_chooser_spec.rb
44
242
  - spec/date_group_spec.rb
45
243
  - spec/date_range_spec.rb
46
244
  - spec/date_spec.rb
245
+ - spec/extensions_spec.rb
246
+ - spec/rails/date_spec.rb
247
+ - spec/rails/date_time_spec.rb
248
+ - spec/rails/period_spec.rb
47
249
  - spec/schema.rb
48
250
  - spec/season_spec.rb
49
251
  - spec/spec_helper.rb
50
252
  - spec/string_spec.rb
253
+ - spec/support/coverage.rb
254
+ - spec/temporal_patterns_spec.rb
255
+ - spec/time_since_spec.rb
51
256
  - spec/time_spec.rb
52
257
  - spec/trackable_date_set_spec.rb
53
258
  - spec/week_days_spec.rb
54
259
  - timely.gemspec
55
260
  homepage: http://github.com/sealink/timely
56
- licenses: []
261
+ licenses:
262
+ - MIT
263
+ metadata: {}
57
264
  post_install_message:
58
- rdoc_options:
59
- - --charset=UTF-8
265
+ rdoc_options: []
60
266
  require_paths:
61
267
  - lib
62
268
  required_ruby_version: !ruby/object:Gem::Requirement
63
- none: false
64
269
  requirements:
65
- - - ! '>='
270
+ - - ">="
66
271
  - !ruby/object:Gem::Version
67
272
  version: '0'
68
273
  required_rubygems_version: !ruby/object:Gem::Requirement
69
- none: false
70
274
  requirements:
71
- - - ! '>='
275
+ - - ">="
72
276
  - !ruby/object:Gem::Version
73
277
  version: '0'
74
278
  requirements: []
75
- rubyforge_project: timely
76
- rubygems_version: 1.8.23
279
+ rubyforge_project:
280
+ rubygems_version: 2.4.8
77
281
  signing_key:
78
- specification_version: 2
282
+ specification_version: 4
79
283
  summary: Set of time, date, weekday related methods.
80
- test_files: []
284
+ test_files:
285
+ - spec/calendar_tag_spec.rb
286
+ - spec/date_chooser_spec.rb
287
+ - spec/date_group_spec.rb
288
+ - spec/date_range_spec.rb
289
+ - spec/date_spec.rb
290
+ - spec/extensions_spec.rb
291
+ - spec/rails/date_spec.rb
292
+ - spec/rails/date_time_spec.rb
293
+ - spec/rails/period_spec.rb
294
+ - spec/schema.rb
295
+ - spec/season_spec.rb
296
+ - spec/spec_helper.rb
297
+ - spec/string_spec.rb
298
+ - spec/support/coverage.rb
299
+ - spec/temporal_patterns_spec.rb
300
+ - spec/time_since_spec.rb
301
+ - spec/time_spec.rb
302
+ - spec/trackable_date_set_spec.rb
303
+ - spec/week_days_spec.rb