month.rb 0.10.2 → 0.11.0
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 +4 -4
- data/lib/Month/VERSION.rb +1 -1
- data/lib/Month/to_s.rb +3 -2
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 2e2d2c2d0b65eb49360e50ef9fc40fc1939b131c8bfe4a7ad52a21f2da2e2901
|
|
4
|
+
data.tar.gz: db81251d5e568118dde63f6c3b054f9f463d535335bcdd59103019fe4986b9e8
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 27042e4a568f2b7038151d3e8b9945b38bc7d84006d9e0015ec5d0251b369e1e48b5c8cae936dbd2809012d6b12fd4e5919ff18fe4532681fc65651bb15e5d99
|
|
7
|
+
data.tar.gz: dbd59736671f214ff8d1c5492f81b54b613b50a46fafad28ef67e6a081ae87be528b41934204dd306feb16ea291273f0900ae9b3ee7dd7bd43d2411e42975ff2
|
data/lib/Month/VERSION.rb
CHANGED
data/lib/Month/to_s.rb
CHANGED
|
@@ -8,10 +8,11 @@ require 'Month/to_short'
|
|
|
8
8
|
class Month
|
|
9
9
|
|
|
10
10
|
def to_s(month_name_length = :long)
|
|
11
|
-
case month_name_length.to_sym
|
|
11
|
+
case (month_name_length.to_sym if month_name_length.respond_to?(:to_sym))
|
|
12
12
|
when :long; "#{to_long} #{year}"
|
|
13
|
-
when :short
|
|
13
|
+
when :short; "#{to_short} #{year}"
|
|
14
14
|
when :iso, :iso_8601; "#{year}-" + "%02d" % month
|
|
15
|
+
else; raise ArgumentError, "unknown month name length #{month_name_length.inspect} (expected :long, :short, :iso, or :iso_8601)"
|
|
15
16
|
end
|
|
16
17
|
end
|
|
17
18
|
|