timeboss 0.2.4 → 0.2.5

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c7b388d456d8eec7675cc2a654f4f966b6f3f1f00b12e047e49012a135ca2b25
4
- data.tar.gz: 8251a808044da5726a9934e10e1f32d7f6fd41c38a6bb16e38632b3e7d4da412
3
+ metadata.gz: e6b6b0fe418ccba6ac446549992d5a9d1317b095afd603fd8517f9f43ddb2754
4
+ data.tar.gz: 494e8602b7ce8662503ce8720da802a3351a74116e73b6e9cee64c1b8bf82895
5
5
  SHA512:
6
- metadata.gz: af06d432fc9e1384e4a9e575061b7ca8107bdf7913bfda744c4a8328148e4e2e81d1bfda9f2ece79c2abd1dea49591f06ec349240b6f2e981950f469266deaac
7
- data.tar.gz: 7733f507d6d8d96b0d59639d38063cb6b68a4d6ccbb03c02a2e563dfef743e4dc76756628ebe703d04965aa7e7ea02e89f5aebf467733876d9f5ce85f72917bb
6
+ metadata.gz: 82fec7e7f6e798469d99853dc30b6233eb55a55bd8e09d79143be086c790677d8249cbeacb72ab94c6ce20ad9a5dd2d4ecf4f96d3d7c4c65179749c7ae8597ca
7
+ data.tar.gz: 03a6a53d9b0316ec5074855ed5f240cad7a578a72ce12eda272d6fa6a2a4f70237416814bd3783342849e47e21503fc3e75d3170e79388a58be23244c307d7c6
@@ -11,7 +11,8 @@ module TimeBoss
11
11
  end
12
12
 
13
13
  def parse(identifier = nil)
14
- return parse_identifier(identifier.presence) unless identifier&.include?(RANGE_DELIMITER)
14
+ return nil unless identifier.present?
15
+ return parse_identifier(identifier) unless identifier&.include?(RANGE_DELIMITER)
15
16
  bases = identifier.split(RANGE_DELIMITER).map { |i| parse_identifier(i.strip) } unless identifier.nil?
16
17
  bases ||= [parse_identifier(nil)]
17
18
  Period.new(calendar, *bases)
@@ -1,4 +1,4 @@
1
1
  # frozen_string_literal: true
2
2
  module TimeBoss
3
- VERSION = "0.2.4"
3
+ VERSION = "0.2.5"
4
4
  end
@@ -493,10 +493,9 @@ module TimeBoss
493
493
  expect(date.end_date).to eq Date.parse('2017-04-08')
494
494
  end
495
495
 
496
- it 'gives you this year if you give it nothing' do
497
- year = subject.this_year
498
- expect(subject.parse(nil)).to eq year
499
- expect(subject.parse('')).to eq year
496
+ it 'gives you nothing if you give it nothing' do
497
+ expect(subject.parse(nil)).to be nil
498
+ expect(subject.parse('')).to be nil
500
499
  end
501
500
  end
502
501
 
@@ -475,10 +475,9 @@ module TimeBoss
475
475
  expect(date.end_date).to eq Date.parse('2017-04-08')
476
476
  end
477
477
 
478
- it 'gives you this year if you give it nothing' do
479
- year = subject.this_year
480
- expect(subject.parse(nil)).to eq year
481
- expect(subject.parse('')).to eq year
478
+ it 'gives you nothing if you give it nothing' do
479
+ expect(subject.parse(nil)).to be nil
480
+ expect(subject.parse('')).to be nil
482
481
  end
483
482
  end
484
483
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: timeboss
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.4
4
+ version: 0.2.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kevin McDonald
@@ -199,7 +199,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
199
199
  - !ruby/object:Gem::Version
200
200
  version: '0'
201
201
  requirements: []
202
- rubygems_version: 3.0.8
202
+ rubyforge_project:
203
+ rubygems_version: 2.7.7
203
204
  signing_key:
204
205
  specification_version: 4
205
206
  summary: Broadcast Calendar navigation in Ruby made simple