html_skeleton 0.5.2 → 0.5.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +2 -2
- data/lib/html_skeleton.rb +5 -5
- data/lib/html_skeleton_calendar.rb +3 -3
- data/lib/html_skeleton_table.rb +1 -1
- metadata +6 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e29dd94798168a8ab8267eed2aaf79df55206eebdc08529fa4d3105959761a7c
|
4
|
+
data.tar.gz: e42c7b766fd842f825e8c53b2e32652c8535728e9a67360de5b0deffafb9d364
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f1866ed93d9c6e5c2a8bb055c9a8a1529bb7117429ee8ffa57adf371902e7e373306c2ef30968f9f57a7e5e18056c0c5f5b79f36f822e69e2544f94e75769d1b
|
7
|
+
data.tar.gz: 8bb4b6fd8ca2d34f18af0fe5850a5ab9cab30b03a0792aa94a11c637fe45265f2df9216dd2686d11a98f368fc6d9b16ef4bf1c3d8c21185f0e1bf42fddf5f622
|
data/README.md
CHANGED
@@ -91,8 +91,8 @@ Examples
|
|
91
91
|
Default Options
|
92
92
|
---------------
|
93
93
|
legend: nil,
|
94
|
-
col_legend:
|
95
|
-
row_legend:
|
94
|
+
col_legend: ->(x) { x.to_s },
|
95
|
+
row_legend: ->(x) { x.id },
|
96
96
|
th_attribute: ->(col) { nil },
|
97
97
|
tr_attribute: ->(row) { nil },
|
98
98
|
table_class: 'skeleton',
|
data/lib/html_skeleton.rb
CHANGED
@@ -46,16 +46,16 @@ class HtmlSkeleton
|
|
46
46
|
abbr = day[@options[:abbrev]]
|
47
47
|
str = abbr == day ? day : %(<abbr title="#{day}">#{abbr}</abbr>)
|
48
48
|
%(<th scope="col">#{str}</th>)
|
49
|
-
}.join
|
49
|
+
}.join
|
50
50
|
end
|
51
51
|
|
52
52
|
def set_table_options(options, &block)
|
53
53
|
@options = {
|
54
54
|
legend: nil,
|
55
|
-
col_legend:
|
56
|
-
row_legend:
|
57
|
-
th_attribute: ->(_col) {
|
58
|
-
tr_attribute: ->(_row) {
|
55
|
+
col_legend: ->(x) { x.to_s },
|
56
|
+
row_legend: ->(x) { x.id },
|
57
|
+
th_attribute: ->(_col) {},
|
58
|
+
tr_attribute: ->(_row) {},
|
59
59
|
|
60
60
|
table_class: 'skeleton',
|
61
61
|
cell_proc: block || ->(row, col) { "<td>#{row} #{col}</td>" }
|
@@ -14,11 +14,11 @@ class HtmlSkeleton
|
|
14
14
|
|
15
15
|
body = (0..rows - 1).collect { |y|
|
16
16
|
str = (1..cols).collect { |x| "<td>#{a_month(year, y * cols + x)}</td>" }
|
17
|
-
"<tr>#{str.join
|
17
|
+
"<tr>#{str.join}</tr>"
|
18
18
|
}
|
19
19
|
<<~THEAD
|
20
20
|
<thead><th colspan="2">#{@options[:title]}</th></thead>
|
21
|
-
#{body.join
|
21
|
+
#{body.join}
|
22
22
|
THEAD
|
23
23
|
end
|
24
24
|
|
@@ -43,7 +43,7 @@ class HtmlSkeleton
|
|
43
43
|
first = Date.civil(year, month, 1)
|
44
44
|
last = Date.civil(year, month, -1)
|
45
45
|
|
46
|
-
cal = '<tr>'
|
46
|
+
cal = +'<tr>'
|
47
47
|
cal << '<td></td>' * days_between(first_weekday, first.wday)
|
48
48
|
first.upto(last) { |cur|
|
49
49
|
cal << a_day(cur, today, cell_proc)
|
data/lib/html_skeleton_table.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: html_skeleton
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dittmar Krall
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-06-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -28,16 +28,16 @@ dependencies:
|
|
28
28
|
name: rake
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- - "
|
31
|
+
- - ">="
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: '
|
33
|
+
version: '0'
|
34
34
|
type: :development
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
|
-
- - "
|
38
|
+
- - ">="
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: '
|
40
|
+
version: '0'
|
41
41
|
description: |2
|
42
42
|
A simple helper for creating HTML calendars and tables.
|
43
43
|
|