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 +4 -4
- data/.travis.yml +4 -3
- data/docs/image/output_xlsx_type2_shironuri.png +0 -0
- data/docs/index.md +16 -0
- data/lib/htot_conv/generator/base.rb +22 -0
- data/lib/htot_conv/generator/xlsx_type1.rb +2 -2
- data/lib/htot_conv/generator/xlsx_type2.rb +2 -2
- data/lib/htot_conv/generator/xlsx_type3.rb +2 -2
- data/lib/htot_conv/generator/xlsx_type4.rb +2 -2
- data/lib/htot_conv/generator/xlsx_type5.rb +2 -2
- data/lib/htot_conv/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d4da682b780c3e60acaca1f0f9e58b3ee05093e1
|
4
|
+
data.tar.gz: f81ca329608b01c808b8ade2959bd4a375cd9374
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e3cdbe7f7ca82f32647831cada306928ea51bda2054e488efa0b259267dfd321919ebc9a84c2cc7fee253bd8b39d16fa1e2af2b665c408ec9b9e0b3eb4e0217a
|
7
|
+
data.tar.gz: 6e8e298f5c4f56935487c66b9a4b9286e9a8ddf7e6e7b8d4b07e3d58b69f59a265f176c4582600a201fad95fb6f57ac4102fa34a8dc4dfa6eec482a29cb944b0
|
data/.travis.yml
CHANGED
Binary file
|
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)
|
data/lib/htot_conv/version.rb
CHANGED
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.
|
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:
|
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
|