weekling 1.0.1 → 1.0.2

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.
data.tar.gz.sig CHANGED
Binary file
data/HISTORY.md CHANGED
@@ -1,3 +1,10 @@
1
+ 1.0.2 / 2012-09-21
2
+ ==================
3
+
4
+ * 1 major bugfix
5
+
6
+ * Fixed an invalid initialization of Week objects when the given early- or late-in-year Date object's year is different than the year the Week is in
7
+
1
8
  1.0.1 / 2012-02-24
2
9
  ==================
3
10
 
data/README.md CHANGED
@@ -343,7 +343,7 @@ following command:
343
343
  Please notice that you may need other keys for dependent libraries, so you may
344
344
  have to install dependencies manually.
345
345
 
346
- [gemkey]: http://aef.name/crypto/aef-gem.pem
346
+ [gemkey]: https://aef.name/crypto/aef-gem.pem
347
347
 
348
348
  ### Normal
349
349
 
@@ -385,7 +385,7 @@ named like the version with a prefixed lower-case "v", as required by Semantic
385
385
  Versioning. Every tag will be signed by my [OpenPGP public key][openpgp] which
386
386
  enables you to verify your copy of the code cryptographically.
387
387
 
388
- [openpgp]: http://aef.name/crypto/aef-openpgp.asc
388
+ [openpgp]: https://aef.name/crypto/aef-openpgp.asc
389
389
 
390
390
  Add the key to your GnuPG keyring by the following command:
391
391
 
@@ -24,7 +24,7 @@ module Aef
24
24
  #
25
25
  # Using Semantic Versioning (2.0.0-rc.1) rules
26
26
  # @see http://semver.org/
27
- VERSION = '1.0.1'.freeze
27
+ VERSION = '1.0.2'.freeze
28
28
 
29
29
  end
30
30
  end
@@ -86,7 +86,7 @@ module Aef
86
86
  @index = object.index.to_i
87
87
  elsif object.respond_to?(:to_date)
88
88
  date = object.to_date
89
- @year = Year.new(date.year)
89
+ @year = Year.new(date.cwyear)
90
90
  @index = date.cweek
91
91
  else
92
92
  raise ArgumentError, 'A single argument must either respond to #year and #index or to #to_date'
@@ -124,6 +124,22 @@ describe Aef::Weekling::WeekDay do
124
124
  week_day.index.should eql 3
125
125
  end
126
126
 
127
+ it "should be able to initialize a weekday within the last week of a year by a given Date object which is already in the following year" do
128
+ date = Date.new(1802, 1, 1)
129
+
130
+ week_day = described_class.new(date)
131
+ week_day.week.should eql Aef::Weekling::Week.new(1801, 53)
132
+ week_day.index.should eql 5
133
+ end
134
+
135
+ it "should be able to initialize a weekday within the first week of a year by a given Date object which is still in the previous year" do
136
+ date = Date.new(2008, 12, 30)
137
+
138
+ week_day = described_class.new(date)
139
+ week_day.week.should eql Aef::Weekling::Week.new(2009, 1)
140
+ week_day.index.should eql 2
141
+ end
142
+
127
143
  it "should allow to create a weekday by a given DateTime object" do
128
144
  datetime = DateTime.parse('2011-04-06T16:45:30')
129
145
 
@@ -119,6 +119,22 @@ describe Aef::Weekling::Week do
119
119
  week.index.should eql date.cweek
120
120
  end
121
121
 
122
+ it "should be able to initialize the last week of a year by a given Date object which is already in the following year" do
123
+ date = Date.new(1802, 1, 1)
124
+ week = described_class.new(date)
125
+
126
+ week.year.should eql Aef::Weekling::Year.new(1801)
127
+ week.index.should eql 53
128
+ end
129
+
130
+ it "should be able to initialize the first week of a year by a given Date object which is still in the previous year" do
131
+ date = Date.new(2008, 12, 30)
132
+ week = described_class.new(date)
133
+
134
+ week.year.should eql Aef::Weekling::Year.new(2009)
135
+ week.index.should eql 1
136
+ end
137
+
122
138
  it "should be able to initialize a week by a given DateTime object" do
123
139
  date = DateTime.now
124
140
  week = described_class.new(date)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: weekling
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 1.0.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -48,11 +48,11 @@ cert_chain:
48
48
  -----END CERTIFICATE-----
49
49
 
50
50
  '
51
- date: 2012-04-04 00:00:00.000000000 Z
51
+ date: 2012-09-21 00:00:00.000000000 Z
52
52
  dependencies:
53
53
  - !ruby/object:Gem::Dependency
54
54
  name: bundler
55
- requirement: &22840780 !ruby/object:Gem::Requirement
55
+ requirement: &8499980 !ruby/object:Gem::Requirement
56
56
  none: false
57
57
  requirements:
58
58
  - - ~>
@@ -60,10 +60,10 @@ dependencies:
60
60
  version: 1.1.0
61
61
  type: :development
62
62
  prerelease: false
63
- version_requirements: *22840780
63
+ version_requirements: *8499980
64
64
  - !ruby/object:Gem::Dependency
65
65
  name: rake
66
- requirement: &22840260 !ruby/object:Gem::Requirement
66
+ requirement: &8499520 !ruby/object:Gem::Requirement
67
67
  none: false
68
68
  requirements:
69
69
  - - ~>
@@ -71,10 +71,10 @@ dependencies:
71
71
  version: 0.9.2
72
72
  type: :development
73
73
  prerelease: false
74
- version_requirements: *22840260
74
+ version_requirements: *8499520
75
75
  - !ruby/object:Gem::Dependency
76
76
  name: rspec
77
- requirement: &22839760 !ruby/object:Gem::Requirement
77
+ requirement: &8499020 !ruby/object:Gem::Requirement
78
78
  none: false
79
79
  requirements:
80
80
  - - ~>
@@ -82,10 +82,10 @@ dependencies:
82
82
  version: 2.8.0
83
83
  type: :development
84
84
  prerelease: false
85
- version_requirements: *22839760
85
+ version_requirements: *8499020
86
86
  - !ruby/object:Gem::Dependency
87
87
  name: simplecov
88
- requirement: &22839300 !ruby/object:Gem::Requirement
88
+ requirement: &8498520 !ruby/object:Gem::Requirement
89
89
  none: false
90
90
  requirements:
91
91
  - - ~>
@@ -93,10 +93,10 @@ dependencies:
93
93
  version: 0.6.1
94
94
  type: :development
95
95
  prerelease: false
96
- version_requirements: *22839300
96
+ version_requirements: *8498520
97
97
  - !ruby/object:Gem::Dependency
98
98
  name: pry
99
- requirement: &22838840 !ruby/object:Gem::Requirement
99
+ requirement: &8497820 !ruby/object:Gem::Requirement
100
100
  none: false
101
101
  requirements:
102
102
  - - ~>
@@ -104,10 +104,10 @@ dependencies:
104
104
  version: 0.9.8
105
105
  type: :development
106
106
  prerelease: false
107
- version_requirements: *22838840
107
+ version_requirements: *8497820
108
108
  - !ruby/object:Gem::Dependency
109
109
  name: yard
110
- requirement: &22838380 !ruby/object:Gem::Requirement
110
+ requirement: &8497220 !ruby/object:Gem::Requirement
111
111
  none: false
112
112
  requirements:
113
113
  - - ~>
@@ -115,7 +115,7 @@ dependencies:
115
115
  version: 0.7.5
116
116
  type: :development
117
117
  prerelease: false
118
- version_requirements: *22838380
118
+ version_requirements: *8497220
119
119
  description: ! 'Weekling is a Ruby library which provides class representations to
120
120
  make date
121
121
 
metadata.gz.sig CHANGED
Binary file