calendarium-romanum 0.2.0 → 0.2.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: 4045ecba2cbafa75add7356a1b2af38580dfface
4
- data.tar.gz: b87bbc08536ab54e091d230247d9b558696c4085
3
+ metadata.gz: b9480b0f651cac34e75c9b46bcf5d1be6cd6cd82
4
+ data.tar.gz: 6bc42d50fd376ab9ad14a75e9396f9b84a87c6a5
5
5
  SHA512:
6
- metadata.gz: ace22eb09e7f323af5c107052ca32ea20d2258a6d3d97733d305c262603e865204aed484b4bbcb6d3d3517bef7757e9abc15d04a92248e3227cb06a73c96f9e1
7
- data.tar.gz: 60b8f508e00f0a46a2427dc03cae8c65907249553650a676e4557e0dd88e77e9626bd072e6ae26a6f832e64188abf8eb69bb89736ed5fa4c058f8e06f8879ce0
6
+ metadata.gz: 273cfd23765b4c7c36b41350cf0fa6330b97cd7e40ca5b8d07698afa6ae10577e1a87724e481473d5bd50a13235217183c5d53df7afb01d357046d6cb6182775
7
+ data.tar.gz: f3d83d90c16d03a210d006385cf30472cb981b8c3bdf5b466f2492085357d82efb47ef560625a34f2e5ab63f72eb775ba6ee71fda182d5d3ec57c66df2dc8782
@@ -10,6 +10,10 @@ module CalendariumRomanum
10
10
  @day = day
11
11
  end
12
12
 
13
+ def self.from_date(date)
14
+ new(date.month, date.day)
15
+ end
16
+
13
17
  attr_reader :month, :day
14
18
 
15
19
  def <=>(other)
@@ -41,7 +45,7 @@ module CalendariumRomanum
41
45
 
42
46
  day_lte = case month
43
47
  when 2
44
- 28
48
+ 29
45
49
  when 1, 3, 5, 7, 8, 10, 12
46
50
  31
47
51
  else
@@ -1,3 +1,3 @@
1
1
  module CalendariumRomanum
2
- VERSION = '0.2.0'
2
+ VERSION = '0.2.1'
3
3
  end
@@ -25,6 +25,23 @@ describe CR::AbstractDate do
25
25
  end
26
26
  end
27
27
 
28
+ # test .new through .from_date on a complete leap year
29
+ describe '.from_date' do
30
+ YEAR = 2000
31
+
32
+ it 'the test year is leap' do
33
+ expect(Date.new(YEAR)).to be_leap
34
+ end
35
+
36
+ CR::Util::Year.new(YEAR).each do |date|
37
+ it date.to_s do
38
+ expect do
39
+ AD.from_date date
40
+ end.not_to raise_exception
41
+ end
42
+ end
43
+ end
44
+
28
45
  describe '#<' do
29
46
  it { expect(AD.new(1, 1)).to be < AD.new(1, 2) }
30
47
  it { expect(AD.new(1, 1)).to be < AD.new(2, 1) }
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: calendarium-romanum
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jakub Pavlík