timely 0.3.4 → 0.4.0

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
- SHA1:
3
- metadata.gz: 2b1578790a3652ed5ddb9a945edfb6a1ce97c8d3
4
- data.tar.gz: c90cc8c24b07e22e4adb8329a2f7f4ded66705cb
2
+ SHA256:
3
+ metadata.gz: 36062e70f6f891b86756085fcad60f2bd9e4b835c981d63eb6de79c3d3686918
4
+ data.tar.gz: 04626beef2e728acb924fc9a29413a13f4ebd2769af4825aaabce3a062607fba
5
5
  SHA512:
6
- metadata.gz: 55f0ea5284f24c00885e30a2f63ba567b560ab44e02039b1438e4c971f194b258a0273dbcbeeb79707371a15bb3ad6b7346f617c093825955a05f0110a696c5a
7
- data.tar.gz: 828865db23a5d6d06f1470c3cf912a0eec6699c6a23c969ac3ecfbbdf8641e83bcb013c51f9eeffaf0c162bf4c7faa3d836898195892db221f4ae74d3ec13878
6
+ metadata.gz: da490cb6717e3e8a3d814bb48022b62b6fb0e21b515fc6a4d25e9011f89ff10f1f1bdc90175ea71f8c440062584ba9be7185b85e7a3bb08b158b542f8446f3ea
7
+ data.tar.gz: 71d85acac0eabfa64971724a479b8d758721b8fac00ab2071d515926c5418e1155bab611ca28a5012a24a2ab7edd6de776e035d5a350e32ed9eefed6bdb34aea
data/.ruby-version CHANGED
@@ -1 +1 @@
1
- 2.4.4
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/rails3.gemfile
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
@@ -1,5 +1,9 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.4.0
4
+
5
+ * [TT-5648] Fix date_range to string when a single month covers a year period
6
+
3
7
  ## 0.3.4
4
8
 
5
9
  * [TT-4812] Remove bootstrap class from calender tag
data/README.md CHANGED
@@ -1,5 +1,4 @@
1
- Timely
2
- ======
1
+ # Timely
3
2
 
4
3
  [![Build Status](https://travis-ci.org/sealink/timely.png?branch=master)](https://travis-ci.org/sealink/timely)
5
4
  [![Coverage Status](https://coveralls.io/repos/sealink/timely/badge.png)](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
- * 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
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
- * Date Group, a date range which can also be limited to WeekDays, e.g. all weekends between March and April
23
- * Season, a collection of Date Groups
24
- * weekdays_field, a way to declare an integer field to store weekdays (weekdays is stored as 7 bit integer)
25
- * acts_as_seasonal, a way to declare a season_id foreign key as well as some helper methods
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
 
@@ -2,5 +2,5 @@ source 'https://rubygems.org'
2
2
  gemspec :path => '../'
3
3
 
4
4
  group :development, :test do
5
- gem 'activerecord', '~> 3.2.0'
5
+ gem 'activerecord', '~> 6.0.0.rc1'
6
6
  end
@@ -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
@@ -1,3 +1,3 @@
1
1
  module Timely
2
- VERSION = "0.3.4"
2
+ VERSION = "0.4.0"
3
3
  end
@@ -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.3"
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.3.4
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: 2018-11-13 00:00:00.000000000 Z
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: '1.3'
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: '1.3'
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
- rubyforge_project:
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
@@ -1,3 +0,0 @@
1
- # 0.0.1 / 2008-05-08
2
-
3
- * Initial release
@@ -1,6 +0,0 @@
1
- source 'https://rubygems.org'
2
- gemspec :path => '../'
3
-
4
- group :development, :test do
5
- gem 'activerecord', '~> 4.0'
6
- end