timely 0.3.4 → 0.4.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.
- checksums.yaml +5 -5
- data/.ruby-version +1 -1
- data/.travis.yml +7 -7
- data/CHANGELOG.md +4 -0
- data/README.md +13 -12
- data/gemfiles/{rails3.gemfile → rails6.gemfile} +1 -1
- data/lib/timely/date_range.rb +1 -1
- data/lib/timely/version.rb +1 -1
- data/spec/date_range_spec.rb +5 -4
- data/timely.gemspec +1 -1
- metadata +6 -9
- data/HISTORY.md +0 -3
- data/gemfiles/rails4.gemfile +0 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 36062e70f6f891b86756085fcad60f2bd9e4b835c981d63eb6de79c3d3686918
|
4
|
+
data.tar.gz: 04626beef2e728acb924fc9a29413a13f4ebd2769af4825aaabce3a062607fba
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: da490cb6717e3e8a3d814bb48022b62b6fb0e21b515fc6a4d25e9011f89ff10f1f1bdc90175ea71f8c440062584ba9be7185b85e7a3bb08b158b542f8446f3ea
|
7
|
+
data.tar.gz: 71d85acac0eabfa64971724a479b8d758721b8fac00ab2071d515926c5418e1155bab611ca28a5012a24a2ab7edd6de776e035d5a350e32ed9eefed6bdb34aea
|
data/.ruby-version
CHANGED
@@ -1 +1 @@
|
|
1
|
-
2.
|
1
|
+
2.6.3
|
data/.travis.yml
CHANGED
@@ -1,22 +1,22 @@
|
|
1
1
|
language: ruby
|
2
2
|
rvm:
|
3
|
-
- 2.2.2
|
4
|
-
- 2.3.0
|
5
3
|
- 2.4
|
4
|
+
- 2.5
|
5
|
+
- 2.6
|
6
6
|
matrix:
|
7
7
|
fast_finish: true
|
8
8
|
exclude:
|
9
9
|
- rvm: 2.4
|
10
|
-
gemfile: gemfiles/
|
10
|
+
gemfile: gemfiles/rails6.gemfile
|
11
|
+
|
12
|
+
before_install:
|
13
|
+
- gem install bundler
|
11
14
|
script: bundle exec rake spec
|
12
15
|
gemfile:
|
13
|
-
- gemfiles/rails3.gemfile
|
14
|
-
- gemfiles/rails4.gemfile
|
15
16
|
- gemfiles/rails5.gemfile
|
17
|
+
- gemfiles/rails6.gemfile
|
16
18
|
notifications:
|
17
19
|
email:
|
18
20
|
- support@travellink.com.au
|
19
|
-
flowdock:
|
20
|
-
secure: QC1mV/0NZwA4tU2K1BQSety/seEf7ujL3uUlddXrMm0yHp0NBMlo1tnQ7KKopSKoyoPj9M9KmfhrCdbdZXDOU57WucH+pz7Tn9Zp9VkPUMniN4rYSwkrF17vihM5NpdyDzqo5mzthVPUEV0DtlK+Uu2W4wMUpu1uKaahFzHJH6k=
|
21
21
|
sudo: false
|
22
22
|
cache: bundler
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -1,5 +1,4 @@
|
|
1
|
-
Timely
|
2
|
-
======
|
1
|
+
# Timely
|
3
2
|
|
4
3
|
[](https://travis-ci.org/sealink/timely)
|
5
4
|
[](https://coveralls.io/r/sealink/timely)
|
@@ -11,18 +10,20 @@ Timely
|
|
11
10
|
Various helpers to work with times, dates and weekdays, etc.
|
12
11
|
|
13
12
|
It includes the following (see end for full descriptions)
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
13
|
+
|
14
|
+
- Core extensions to Date and Time
|
15
|
+
- DateChooser, a class to help select a subset of dates within any range, e.g. All 2nd Sundays, Every 15th of the month, All Tuesdays and Wednesdays
|
16
|
+
- WeekDays, a class to manage the selection of weekdays, outputs a integer representing which days as a number between 0 and 127 (e.g. a 7 bit integer)
|
17
|
+
- DateRange: A subclass of Range for dates with various helpers and aliases
|
18
|
+
- TrackableDateSet: Recording set of dates processed/processing
|
19
|
+
- TemporalPatterns: Various other classes related to time, e.g. Frequency
|
20
20
|
|
21
21
|
It includes the following rails extensions (only loaded if inside rails project):
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
22
|
+
|
23
|
+
- Date Group, a date range which can also be limited to WeekDays, e.g. all weekends between March and April
|
24
|
+
- Season, a collection of Date Groups
|
25
|
+
- weekdays_field, a way to declare an integer field to store weekdays (weekdays is stored as 7 bit integer)
|
26
|
+
- acts_as_seasonal, a way to declare a season_id foreign key as well as some helper methods
|
26
27
|
|
27
28
|
# INSTALLATION
|
28
29
|
|
data/lib/timely/date_range.rb
CHANGED
@@ -58,7 +58,7 @@ module Timely
|
|
58
58
|
if first && last
|
59
59
|
if first == last
|
60
60
|
first.strftime(fmt)
|
61
|
-
elsif first == first.at_beginning_of_month && last == last.at_end_of_month
|
61
|
+
elsif first.year == last.year && first == first.at_beginning_of_month && last == last.at_end_of_month
|
62
62
|
if first.month == last.month
|
63
63
|
first.strftime(month_fmt)
|
64
64
|
else
|
data/lib/timely/version.rb
CHANGED
data/spec/date_range_spec.rb
CHANGED
@@ -1,21 +1,21 @@
|
|
1
1
|
require 'spec_helper'
|
2
2
|
|
3
3
|
describe Timely::DateRange do
|
4
|
-
|
4
|
+
|
5
5
|
it "should allow initialization with two dates" do
|
6
6
|
expect { @date_range = Timely::DateRange.new(Date.today, Date.today + 3) }.to_not raise_error
|
7
7
|
expect(@date_range.start_date).to eq Date.today
|
8
8
|
expect(@date_range.end_date).to eq Date.today + 3
|
9
9
|
expect(@date_range.number_of_nights).to eq 4
|
10
10
|
end
|
11
|
-
|
11
|
+
|
12
12
|
it "should allow initialization with one date" do
|
13
13
|
expect { @date_range = Timely::DateRange.new(Date.today) }.to_not raise_error
|
14
14
|
expect(@date_range.start_date).to eq Date.today
|
15
15
|
expect(@date_range.end_date).to eq Date.today
|
16
16
|
expect(@date_range.number_of_nights).to eq 1
|
17
17
|
end
|
18
|
-
|
18
|
+
|
19
19
|
it "should allow initialization with a range" do
|
20
20
|
expect { @date_range = Timely::DateRange.new(Date.today..Date.today + 3) }.to_not raise_error
|
21
21
|
expect(@date_range.start_date).to eq Date.today
|
@@ -27,6 +27,7 @@ describe Timely::DateRange do
|
|
27
27
|
expect(Timely::DateRange.new('2000-01-04'.to_date, '2000-01-06'.to_date).to_s).to eq '2000-01-04 to 2000-01-06 (inclusive)'
|
28
28
|
expect(Timely::DateRange.new('2000-01-01'.to_date, '2000-05-31'.to_date).to_s).to eq 'Jan 2000 to May 2000'
|
29
29
|
expect(Timely::DateRange.new('2000-01-01'.to_date, '2000-01-31'.to_date).to_s).to eq 'Jan 2000'
|
30
|
+
expect(Timely::DateRange.new('2000-01-01'.to_date, '2001-01-31'.to_date).to_s).to eq '2000-01-01 to 2001-01-31 (inclusive)'
|
30
31
|
Date::DATE_FORMATS[:short] = '%Y-%m-%d'
|
31
32
|
expect(Timely::DateRange.to_s('2000-01-01'.to_date, nil)).to eq 'on or after 2000-01-01'
|
32
33
|
expect(Timely::DateRange.to_s(nil, '2000-01-31'.to_date)).to eq 'on or before 2000-01-31'
|
@@ -74,5 +75,5 @@ describe Timely::DateRange do
|
|
74
75
|
expect(@date_range.intersecting_dates(Timely::DateRange.new("2000-01-03".to_date, "2000-01-05".to_date))).to eq ("2000-01-03".to_date.."2000-01-03".to_date)
|
75
76
|
expect(@date_range.intersecting_dates(Timely::DateRange.new("2000-01-02".to_date, "2000-01-04".to_date))).to eq ("2000-01-03".to_date.."2000-01-03".to_date)
|
76
77
|
end
|
77
|
-
|
78
|
+
|
78
79
|
end
|
data/timely.gemspec
CHANGED
@@ -19,7 +19,7 @@ Gem::Specification.new do |spec|
|
|
19
19
|
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
20
20
|
spec.require_paths = ["lib"]
|
21
21
|
|
22
|
-
spec.add_development_dependency "bundler", "~> 1
|
22
|
+
spec.add_development_dependency "bundler", "~> 2.0.1"
|
23
23
|
spec.add_development_dependency "rake"
|
24
24
|
spec.add_development_dependency 'rspec'
|
25
25
|
spec.add_development_dependency 'rspec-its'
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: timely
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Michael Noack
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2019-06-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version:
|
19
|
+
version: 2.0.1
|
20
20
|
type: :development
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version:
|
26
|
+
version: 2.0.1
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: rake
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -220,13 +220,11 @@ files:
|
|
220
220
|
- ".travis.yml"
|
221
221
|
- CHANGELOG.md
|
222
222
|
- Gemfile
|
223
|
-
- HISTORY.md
|
224
223
|
- LICENSE
|
225
224
|
- README.md
|
226
225
|
- Rakefile
|
227
|
-
- gemfiles/rails3.gemfile
|
228
|
-
- gemfiles/rails4.gemfile
|
229
226
|
- gemfiles/rails5.gemfile
|
227
|
+
- gemfiles/rails6.gemfile
|
230
228
|
- lib/timely.rb
|
231
229
|
- lib/timely/date.rb
|
232
230
|
- lib/timely/date_chooser.rb
|
@@ -295,8 +293,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
295
293
|
- !ruby/object:Gem::Version
|
296
294
|
version: '0'
|
297
295
|
requirements: []
|
298
|
-
|
299
|
-
rubygems_version: 2.6.14.1
|
296
|
+
rubygems_version: 3.0.3
|
300
297
|
signing_key:
|
301
298
|
specification_version: 4
|
302
299
|
summary: Set of time, date, weekday related methods.
|
data/HISTORY.md
DELETED