htot_conv 1.0.0 → 1.1.0

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: 82aa21a70b04d057c215d61118c86979a1ecbbf1
4
- data.tar.gz: 4e6a5c0134486792ac5b008feb7c10726d9883c5
3
+ metadata.gz: d4da682b780c3e60acaca1f0f9e58b3ee05093e1
4
+ data.tar.gz: f81ca329608b01c808b8ade2959bd4a375cd9374
5
5
  SHA512:
6
- metadata.gz: cd4a0afbc095573d0ff9a1b4f3d928308f40ed865708bffdf467f767ec4d80b4f640bb29b5542f3319242f79b06e16c1dfc0515d2d1496d36fa8072cd77126ae
7
- data.tar.gz: 93c995abaee53bdb8a428c05bd57c57e48dc936ebd5a93bf7c5b04e6541b70f10c67d287dfc434d9d0ee2ff0f94d23bb244729b453cfe8f09fdcf76f4fe7815d
6
+ metadata.gz: e3cdbe7f7ca82f32647831cada306928ea51bda2054e488efa0b259267dfd321919ebc9a84c2cc7fee253bd8b39d16fa1e2af2b665c408ec9b9e0b3eb4e0217a
7
+ data.tar.gz: 6e8e298f5c4f56935487c66b9a4b9286e9a8ddf7e6e7b8d4b07e3d58b69f59a265f176c4582600a201fad95fb6f57ac4102fa34a8dc4dfa6eec482a29cb944b0
data/.travis.yml CHANGED
@@ -2,9 +2,10 @@ sudo: false
2
2
  language: ruby
3
3
  cache: bundler
4
4
  rvm:
5
- - 2.4.1
6
- - 2.3.4
7
- - 2.2.7
5
+ - 2.5.0
6
+ - 2.4.3
7
+ - 2.3.6
8
+ - 2.2.9
8
9
  before_install: gem install bundler
9
10
  notifications:
10
11
  email: false
data/docs/index.md CHANGED
@@ -35,6 +35,12 @@ The sample input used in this section are as follows:
35
35
  * key header: H1, H2, H3
36
36
  * value header: H(1), H(2)
37
37
 
38
+ ### common options
39
+
40
+ `--shironuri=yes` : fill all the cells with white color
41
+
42
+ ![](image/output_xlsx_type2_shironuri.png)
43
+
38
44
  ## `xlsx_type0`
39
45
 
40
46
  ![](image/output_xlsx_type0.png)
@@ -43,6 +49,8 @@ The sample input used in this section are as follows:
43
49
 
44
50
  ![](image/output_xlsx_type1.png)
45
51
 
52
+ ### options for `xlsx_type1`
53
+
46
54
  `--outline-rows=yes` : group rows
47
55
 
48
56
  ![](image/output_xlsx_type1_outline_rows_yes.png)
@@ -55,6 +63,8 @@ Not implemented (TODO):
55
63
 
56
64
  ![](image/output_xlsx_type2.png)
57
65
 
66
+ ### options for `xlsx_type2`
67
+
58
68
  `--integrate-cells={colspan,rowspan}` : group columns/rows.
59
69
 
60
70
  ![](image/output_xlsx_type2_integrate_cells_colspan.png)
@@ -67,6 +77,8 @@ Not implemented (TODO):
67
77
 
68
78
  ![](image/output_xlsx_type3.png)
69
79
 
80
+ ### options for `xlsx_type3`
81
+
70
82
  `--integrate-cells={colspan,rowspan,both}` : group columns/rows.
71
83
 
72
84
  ![](image/output_xlsx_type3_integrate_cells_both.png)
@@ -75,6 +87,8 @@ Not implemented (TODO):
75
87
 
76
88
  ![](image/output_xlsx_type4.png)
77
89
 
90
+ ### options for `xlsx_type4`
91
+
78
92
  `--integrate-cells={colspan,rowspan,both}` : group columns/rows.
79
93
 
80
94
  ![](image/output_xlsx_type4_integrate_cells_both.png)
@@ -83,6 +97,8 @@ Not implemented (TODO):
83
97
 
84
98
  ![](image/output_xlsx_type5.png)
85
99
 
100
+ ### options for `xlsx_type5`
101
+
86
102
  `--integrate-cells=colspan` : group columns/rows.
87
103
 
88
104
  ![](image/output_xlsx_type5_integrate_cells_colspan.png)
@@ -20,15 +20,37 @@ module HTOTConv
20
20
  end
21
21
 
22
22
  class XlsxBase < Base
23
+ def self.option_help
24
+ super.merge({
25
+ :shironuri => {
26
+ :default => false,
27
+ :pat => FalseClass,
28
+ :desc => "Fill all the cells with white color (default: no)",
29
+ },
30
+ })
31
+ end
32
+
23
33
  def output_to_worksheet(ws)
24
34
  raise NotImplementedError.new("#{self.class.name}.#{__method__} is an abstract method.")
25
35
  end
26
36
 
27
37
  def output(outputfile)
28
38
  wb = RubyXL::Workbook.new
39
+ shironuri(wb, wb[0]) if @option[:shironuri]
29
40
  output_to_worksheet(wb[0])
30
41
  wb.write(outputfile)
31
42
  end
43
+
44
+ private
45
+ def shironuri(wb, ws)
46
+ style_index = wb.modify_fill(nil, "ffffff")
47
+ ws.cols << RubyXL::ColumnRange.new(
48
+ :min => 1,
49
+ :max => 0x4000,
50
+ :style_index => style_index,
51
+ :width => RubyXL::ColumnRange::DEFAULT_WIDTH,
52
+ )
53
+ end
32
54
  end
33
55
  end
34
56
  end
@@ -6,13 +6,13 @@ module HTOTConv
6
6
  module Generator
7
7
  class XlsxType1 < XlsxBase
8
8
  def self.option_help
9
- {
9
+ super.merge({
10
10
  :outline_rows => {
11
11
  :default => false,
12
12
  :pat => FalseClass,
13
13
  :desc => "group rows (default: no)",
14
14
  },
15
- }
15
+ })
16
16
  end
17
17
 
18
18
  def output_to_worksheet(ws)
@@ -6,7 +6,7 @@ module HTOTConv
6
6
  module Generator
7
7
  class XlsxType2 < XlsxBase
8
8
  def self.option_help
9
- {
9
+ super.merge({
10
10
  :integrate_cells => {
11
11
  :default => nil,
12
12
  :pat => [:colspan, :rowspan],
@@ -17,7 +17,7 @@ module HTOTConv
17
17
  :pat => FalseClass,
18
18
  :desc => "group rows (default: no)",
19
19
  },
20
- }
20
+ })
21
21
  end
22
22
 
23
23
  def output_to_worksheet(ws)
@@ -6,13 +6,13 @@ module HTOTConv
6
6
  module Generator
7
7
  class XlsxType3 < XlsxBase
8
8
  def self.option_help
9
- {
9
+ super.merge({
10
10
  :integrate_cells => {
11
11
  :default => nil,
12
12
  :pat => [:colspan, :rowspan, :both],
13
13
  :desc => "integrate key cells (specify 'colspan', 'rowspan' or 'both')",
14
14
  },
15
- }
15
+ })
16
16
  end
17
17
 
18
18
  def output_to_worksheet(ws)
@@ -6,13 +6,13 @@ module HTOTConv
6
6
  module Generator
7
7
  class XlsxType4 < XlsxBase
8
8
  def self.option_help
9
- {
9
+ super.merge({
10
10
  :integrate_cells => {
11
11
  :default => nil,
12
12
  :pat => [:colspan, :rowspan, :both],
13
13
  :desc => "integrate key cells (specify 'colspan', 'rowspan' or 'both')",
14
14
  },
15
- }
15
+ })
16
16
  end
17
17
 
18
18
  def output_to_worksheet(ws)
@@ -6,13 +6,13 @@ module HTOTConv
6
6
  module Generator
7
7
  class XlsxType5 < XlsxBase
8
8
  def self.option_help
9
- {
9
+ super.merge({
10
10
  :integrate_cells => {
11
11
  :default => nil,
12
12
  :pat => [:colspan],
13
13
  :desc => "integrate key cells (specify 'colspan')",
14
14
  },
15
- }
15
+ })
16
16
  end
17
17
 
18
18
  def output_to_worksheet(ws)
@@ -1,4 +1,4 @@
1
1
  # frozen_string_literal: true
2
2
  module HTOTConv
3
- VERSION = "1.0.0"
3
+ VERSION = "1.1.0"
4
4
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: htot_conv
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - "@cat_in_136"
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-12-24 00:00:00.000000000 Z
11
+ date: 2018-02-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rubyXL
@@ -116,6 +116,7 @@ files:
116
116
  - docs/image/output_xlsx_type2.png
117
117
  - docs/image/output_xlsx_type2_integrate_cells_colspan.png
118
118
  - docs/image/output_xlsx_type2_outline_rows_yes.png
119
+ - docs/image/output_xlsx_type2_shironuri.png
119
120
  - docs/image/output_xlsx_type3.png
120
121
  - docs/image/output_xlsx_type3_integrate_cells_both.png
121
122
  - docs/image/output_xlsx_type4.png