carender 0.1.1 → 1.0.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/README.md +12 -10
- data/lib/carender/version.rb +1 -1
- metadata +17 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6d6c9efc344026f7a836462a83eac4163ac759380e4897f3357cd757a883b377
|
4
|
+
data.tar.gz: 0cea82cd3c852355703301a28d246e95908bfa97cfb0685a28d484c79008fa3e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 872d9267c6e3926c6224c19d80baf9db3463b870d205b4199067672c58dbfb1404bfcda9e7a14640dd508bbaca6e72320796b99378530a4b3fd68bfa134a5ff4
|
7
|
+
data.tar.gz: 24bb11c09587b4a819656069ac5c9009985b2daba2e780a3f79ebbf0cc5ac74ff067f98dda988f17fae18fa64d38bdd720b19366c00d040b49a574140fe5a7fc
|
data/README.md
CHANGED
@@ -1,12 +1,14 @@
|
|
1
1
|
# Carender
|
2
2
|
|
3
|
-
|
3
|
+
[](https://badge.fury.io/rb/carender)
|
4
|
+
[](https://travis-ci.org/kami-zh/carender)
|
4
5
|
|
5
|
-
|
6
|
+
This gem renders a monthly calendar for Ruby on Rails application.
|
6
7
|
|
7
|
-
|
8
|
+
## Usage
|
8
9
|
|
9
|
-
|
10
|
+
This gem automatically renders a monthly calendar as HTML table by fetching `params[:year]` and `params[:month]` at view context.
|
11
|
+
Following code renders a simple monthly calendar:
|
10
12
|
|
11
13
|
```erb
|
12
14
|
<%= carender do |date| %>
|
@@ -14,21 +16,21 @@ A code of simple calendar:
|
|
14
16
|
<% end %>
|
15
17
|
```
|
16
18
|
|
17
|
-
|
18
|
-
|
19
|
+
The content passed as a block is rendered in each cell.
|
20
|
+
For example, above code renders like following HTML table.
|
19
21
|
|
20
22
|
```html
|
21
23
|
<table>
|
22
24
|
<tr><th>Sun</th><th>Mon</th><th>Tue</th><th>Wed</th><th>Thu</th><th>Fri</th><th>Sat</th></tr>
|
23
25
|
<tr><td></td><td>1</td><td>2</td><td>3</td><td>4</td><td>5</td><td>6</td></tr>
|
24
26
|
<tr><td>7</td><td>8</td><td>9</td><td>10</td><td>11</td><td>12</td><td>13</td></tr>
|
25
|
-
|
26
|
-
<tr><td>21</td><td>22</td><td>23</td><td>24</td><td>25</td><td>26</td><td>27</td></tr>
|
27
|
-
<tr><td>28</td><td>29</td><td>30</td><td>31</td><td></td><td></td><td></td></tr>
|
27
|
+
...
|
28
28
|
</table>
|
29
29
|
```
|
30
30
|
|
31
|
-
|
31
|
+
### Collection
|
32
|
+
|
33
|
+
To render a calendar with a collection which is grouped by the specified column, you can pass `:collection` and `:column` arguments like as follows:
|
32
34
|
|
33
35
|
```erb
|
34
36
|
<%= carender collection: @posts, column: :posted_on do |date, posts| %>
|
data/lib/carender/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: carender
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 1.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- kami-zh
|
@@ -52,7 +52,21 @@ dependencies:
|
|
52
52
|
- - ">="
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: '0'
|
55
|
-
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: rake
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - ">="
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - ">="
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '0'
|
69
|
+
description: A monthly calendar for Rails application.
|
56
70
|
email:
|
57
71
|
- hiroki.zenigami@gmail.com
|
58
72
|
executables: []
|
@@ -91,5 +105,5 @@ rubyforge_project:
|
|
91
105
|
rubygems_version: 2.7.3
|
92
106
|
signing_key:
|
93
107
|
specification_version: 4
|
94
|
-
summary: A
|
108
|
+
summary: A monthly calendar for Rails application.
|
95
109
|
test_files: []
|