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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 257a4b33a0eeab346e831a3fbc7c68f32d1fb9e80abf203f3211b1ed8c020c3a
4
- data.tar.gz: 64bb363bc93a4e2d9ea2a035daf45a1a25db7c90944b32ee6116789cea5038de
3
+ metadata.gz: e29dd94798168a8ab8267eed2aaf79df55206eebdc08529fa4d3105959761a7c
4
+ data.tar.gz: e42c7b766fd842f825e8c53b2e32652c8535728e9a67360de5b0deffafb9d364
5
5
  SHA512:
6
- metadata.gz: 05b1b6a13f30ff52c60ba2da4ef461feb82f2b1220b54e08583e84fdf5b010073ff7c928d63d503ae909c3d4390bcaacc1b4a454d8d5d03bff0c2bb8a4df06a8
7
- data.tar.gz: 2b8c3c6a928688b71ddf6191c6fe531ba95afef11a245f4f37b76518c1760733da9b381a2fd5255bb8d3a7e1660559fe546ac841f34b36677533a0948b98d528
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: lambda(&:to_s),
95
- row_legend: lambda(&:id),
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: lambda(&:to_s),
56
- row_legend: lambda(&:id),
57
- th_attribute: ->(_col) { nil },
58
- tr_attribute: ->(_row) { nil },
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('')}</tr>"
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>'.dup
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)
@@ -31,6 +31,6 @@ class HtmlSkeleton
31
31
 
32
32
  def table_row(row, cols)
33
33
  cell_proc = @options[:cell_proc]
34
- cols.collect { |col| cell_proc.call(row, col) }.join('')
34
+ cols.collect { |col| cell_proc.call(row, col) }.join
35
35
  end
36
36
  end
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.2
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-02-09 00:00:00.000000000 Z
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: '13'
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: '13'
40
+ version: '0'
41
41
  description: |2
42
42
  A simple helper for creating HTML calendars and tables.
43
43