fat_core 1.0.0 → 1.0.1

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
  SHA1:
3
- metadata.gz: 159f439b8087d5ac894339f4d0abeb7776746576
4
- data.tar.gz: 9412fdcf88d040555fde70a069d095f175e2b11b
3
+ metadata.gz: d000b065f782f0546bf962200c5f116e967d80a6
4
+ data.tar.gz: ac1d4d5be0a403a0fc9fc9ec6d824feb0020d8a2
5
5
  SHA512:
6
- metadata.gz: f5a2bd9cb94bdc02660b5ab2ff63d15f10edb70b72c2a8fcf247ee35bd6b4ce51afc1be964da1a7ca2362f97334f60ff72eb8d44bdcadd8e8ef333988a5f3536
7
- data.tar.gz: dd375a32bf06b4d9951074e860176198df4c79903984c5fb90f8bc663c5d6cb02b3f979f35795670f1b2f0d94e984f1cdf25e414415c1525dc56d06068db32d2
6
+ metadata.gz: 3ad43b96b23a701ec911e90d7d506b50ba75bc8c82049559e0bec3995bf8d8ef7874524851385a5825599d39d00c8ea1d9ce2784b2ba7e5d0c2c86acca473354
7
+ data.tar.gz: b5e704fe49917fea1d1753a9e1874e330616b0d6cf698b70a4d1be7b30dbba864c560f6b278b549db889340e63be26776eb5b3a35531b0fe57b0fd87dfb4daf5
data/Gemfile CHANGED
@@ -3,8 +3,8 @@ source 'https://rubygems.org'
3
3
  # Specify your gem's dependencies in fat_core.gemspec
4
4
  gemspec
5
5
 
6
- group :debug do
7
- gem "byebug"
8
- gem "pry"
9
- gem "pry-doc"
10
- end
6
+ # group :debug do
7
+ # gem "byebug"
8
+ # gem "pry"
9
+ # gem "pry-doc"
10
+ # end
@@ -133,7 +133,9 @@ class Period
133
133
  def self.parse(from, to = nil)
134
134
  raise ArgumentError, 'Period.parse missing argument' unless from
135
135
  to ||= from
136
- Period.new(Date.parse_spec(from, :from), Date.parse_spec(to, :to))
136
+ first = Date.parse_spec(from, :from)
137
+ second = Date.parse_spec(to, :to)
138
+ Period.new(first, second) if first && second
137
139
  end
138
140
 
139
141
  # Return a period from a phrase in which the from date is introduced with
@@ -1,7 +1,7 @@
1
1
  module FatCore
2
2
  MAJOR = 1
3
3
  MINOR = 0
4
- PATCH = 0
4
+ PATCH = 1
5
5
 
6
6
  VERSION = [MAJOR, MINOR, PATCH].compact.join('.')
7
7
  end
@@ -108,6 +108,10 @@ describe Period do
108
108
  expect(pd.last).to eq(Date.parse('2012-12-31'))
109
109
  end
110
110
 
111
+ it 'should return nil when parsing never' do
112
+ expect(Period.parse('never')).to be_nil
113
+ end
114
+
111
115
  it 'should know how to parse a pair of date specs' do
112
116
  expect(Period.parse('2014-3Q').first).to eq Date.parse('2014-07-01')
113
117
  expect(Period.parse('2014-3Q').last).to eq Date.parse('2014-09-30')
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fat_core
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Daniel E. Doherty
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-06-07 00:00:00.000000000 Z
11
+ date: 2016-06-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: simplecov