display-calendar 0.0.2 → 0.0.3
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/README.md +2 -2
- data/lib/display/calendar/calendar.rb +11 -6
- data/lib/display/calendar/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d151b45ded441030b1652e6f66bfd65928158067
|
4
|
+
data.tar.gz: de209b1dfb23b97422e8bddeacef2969ecc2596e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0f046f3593b4ac20c89719a0d8c908b614457287b039cb5b80bdb910b6cbbbd1c37542f23957dec3e840688fd4d1abd79878bcb2b2ec4c8a326c5d2acce3a8fa
|
7
|
+
data.tar.gz: da303d2b2312a830509a7b06e9bf6d0c881b28f802d0f3ed371768d40c58b80c03f87c7bce336dc6cd2c1834be5acfc46a24d9d5bc54f262ccff97cb613887c6
|
data/README.md
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# Display::Calendar
|
2
2
|
|
3
|
-
|
3
|
+
Display Calendar.
|
4
4
|
|
5
5
|
## Installation
|
6
6
|
|
@@ -24,7 +24,7 @@ Or install it yourself as:
|
|
24
24
|
require 'display/calendar'
|
25
25
|
|
26
26
|
cal = Display::Calendar.new
|
27
|
-
cal.calendar(12,2014)
|
27
|
+
puts cal.calendar(12,2014)
|
28
28
|
```
|
29
29
|
|
30
30
|
## Contributing
|
@@ -10,20 +10,25 @@ module Display
|
|
10
10
|
lastday = get_lastday(month,year)
|
11
11
|
wday = firstday.wday
|
12
12
|
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
result = ""
|
14
|
+
result << put_month(month,year)
|
15
|
+
result << "\n"
|
16
|
+
result << put_wday
|
17
|
+
result << "\n"
|
18
|
+
result << " " * wday
|
16
19
|
firstday.day.upto(lastday.day) do |d|
|
17
|
-
|
20
|
+
result << sprintf("%2d ", d.to_s)
|
18
21
|
wday += 1
|
19
22
|
if wday == 7
|
20
|
-
|
23
|
+
result << "\n"
|
21
24
|
wday = 0
|
22
25
|
end
|
23
26
|
end
|
24
|
-
|
27
|
+
result << "\n"
|
28
|
+
return result
|
25
29
|
end
|
26
30
|
|
31
|
+
|
27
32
|
private
|
28
33
|
def get_firstday(month,year)
|
29
34
|
return Date.new(year,month,1)
|