display-calendar 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 53d1dcb3bf75f4e64f4f0cb964af3d065bf6f0df
4
- data.tar.gz: ce7fa4f0a8967b5d4d6cd7a6f87abf9835ec2fa6
3
+ metadata.gz: d151b45ded441030b1652e6f66bfd65928158067
4
+ data.tar.gz: de209b1dfb23b97422e8bddeacef2969ecc2596e
5
5
  SHA512:
6
- metadata.gz: a23212130422d0ea629223405ac9e646a67b42ef367b486855ca9511985995bf197373f3b35e106a81e9b21a96d2652efb10ad2013dac6b988576a5207e8a688
7
- data.tar.gz: 16f5d4252c7156ed56427216022a7f66f8fdbf278f6378d308f59a9dc221deeedb57537d183a902d85264b35912a3082164c7c80aa5fb72d29ea874fba6fcdff
6
+ metadata.gz: 0f046f3593b4ac20c89719a0d8c908b614457287b039cb5b80bdb910b6cbbbd1c37542f23957dec3e840688fd4d1abd79878bcb2b2ec4c8a326c5d2acce3a8fa
7
+ data.tar.gz: da303d2b2312a830509a7b06e9bf6d0c881b28f802d0f3ed371768d40c58b80c03f87c7bce336dc6cd2c1834be5acfc46a24d9d5bc54f262ccff97cb613887c6
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Display::Calendar
2
2
 
3
- TODO: Write a gem description
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
- puts put_month(month,year)
14
- puts put_wday
15
- print " " * wday
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
- printf("%2d ", d)
20
+ result << sprintf("%2d ", d.to_s)
18
21
  wday += 1
19
22
  if wday == 7
20
- puts
23
+ result << "\n"
21
24
  wday = 0
22
25
  end
23
26
  end
24
- puts
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)
@@ -1,5 +1,5 @@
1
1
  module Display
2
2
  class Calendar
3
- VERSION = "0.0.2"
3
+ VERSION = "0.0.3"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: display-calendar
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - youyo