weekling 1.0.1 → 1.0.2
Sign up to get free protection for your applications and to get access to all the features.
- data.tar.gz.sig +0 -0
- data/HISTORY.md +7 -0
- data/README.md +2 -2
- data/lib/aef/weekling/version.rb +1 -1
- data/lib/aef/weekling/week.rb +1 -1
- data/spec/aef/weekling/week_day_spec.rb +16 -0
- data/spec/aef/weekling/week_spec.rb +16 -0
- metadata +14 -14
- metadata.gz.sig +0 -0
data.tar.gz.sig
CHANGED
Binary file
|
data/HISTORY.md
CHANGED
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]:
|
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]:
|
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
|
|
data/lib/aef/weekling/version.rb
CHANGED
data/lib/aef/weekling/week.rb
CHANGED
@@ -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.
|
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.
|
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-
|
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: &
|
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: *
|
63
|
+
version_requirements: *8499980
|
64
64
|
- !ruby/object:Gem::Dependency
|
65
65
|
name: rake
|
66
|
-
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: *
|
74
|
+
version_requirements: *8499520
|
75
75
|
- !ruby/object:Gem::Dependency
|
76
76
|
name: rspec
|
77
|
-
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: *
|
85
|
+
version_requirements: *8499020
|
86
86
|
- !ruby/object:Gem::Dependency
|
87
87
|
name: simplecov
|
88
|
-
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: *
|
96
|
+
version_requirements: *8498520
|
97
97
|
- !ruby/object:Gem::Dependency
|
98
98
|
name: pry
|
99
|
-
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: *
|
107
|
+
version_requirements: *8497820
|
108
108
|
- !ruby/object:Gem::Dependency
|
109
109
|
name: yard
|
110
|
-
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: *
|
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
|