table_analysis 0.2.1 → 0.2.2

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f270cedae12f7dc99ce053cf429857570df56149e7981200dc3eaf5b13c210f5
4
- data.tar.gz: 3dc830dd2cac5e1f6e2bee1c1fcf20c491126556ac4aacdc1004c35607b4e49a
3
+ metadata.gz: 076263e923dd4735b36a781cdf07d8c4f0c37a7d49ab4c60ae9b33405b186fea
4
+ data.tar.gz: d91517297d76c232839ff84c470880de5bf29c41ce5f63d99ac33fda747ad5e5
5
5
  SHA512:
6
- metadata.gz: 70f6d793a3bce2727a12d2d9621d23c0933a2635503964b027becd4ad192c26ff16874f43782387d7a4a6c544094e8ee567724461ad6bb0d4e94a0ba6b261711
7
- data.tar.gz: 6ea75f94f16dcfba61525c69468853743d2c6a1d5d4db1491dea1d55af04bb1a12c3e47f3a8d441f8566f825850827765c9b2311935afb96b67be5d56c7938c0
6
+ metadata.gz: 6fac1db553477e6f537a90317d79c76334e436ef7448c69d9f77a6282568f73300e59756c8928d5f9e7c920108cedef072b3213872d9d042d2fec8684cc317a8
7
+ data.tar.gz: 84a4acdafbfc33c7709b516bd7e65d99a28bf2e3c30d8f697b36239459fa7c1dec5d6099747623f2be273409d463bc19719dc29b256d481b25c6e2f03384349d
data/README.md CHANGED
@@ -22,7 +22,9 @@ Or install it yourself as:
22
22
 
23
23
  ## Usage
24
24
 
25
- TODO: Write usage instructions here
25
+ doc_table_html = File.read('file/demo1.html')
26
+
27
+ TableAnalysis::Main.generator(doc_table_html, header_start_row, selected_rows)
26
28
 
27
29
  ## Development
28
30
 
data/demo.rb CHANGED
@@ -2,4 +2,4 @@ require './lib/table_analysis.rb'
2
2
 
3
3
  doc = File.read('file/demo1.html')
4
4
 
5
- TableAnalysis::Main.generator(doc, 3, 1)
5
+ TableAnalysis::Main.generator(doc, 2, 1)
data/file/demo1.html CHANGED
@@ -1,106 +1,80 @@
1
1
  <div>
2
2
  <table style="table-layout: fixed; width: 648px" cellpadding="0" cellspacing="0">
3
3
  <colgroup>
4
- <col style="width: 324px" />
5
- <col style="width: 324px" />
4
+ <col style="width: 101px" />
5
+ <col style="width: 101px" />
6
+ <col style="width: 101px" />
7
+ <col style="width: 101px" />
8
+ <col style="width: 127px" />
9
+ <col style="width: 117px" />
6
10
  </colgroup>
7
11
  <thead>
8
12
  <tr>
9
- <td style="width: 323px; border-left: 1px solid transparent; border-right: 1px solid transparent" />
13
+ <td style="width: 100px; border-left: 1px solid transparent; border-right: 1px solid transparent" />
14
+ <td style="width: 100px; border-left: 1px solid transparent; border-right: 1px solid transparent" />
15
+ <td style="width: 100px; border-left: 1px solid transparent; border-right: 1px solid transparent" />
16
+ <td style="width: 100px; border-left: 1px solid transparent; border-right: 1px solid transparent" />
17
+ <td style="width: 126px; border-left: 1px solid transparent; border-right: 1px solid transparent" />
10
18
  <td style="border-left: 1px solid transparent; border-right: 1px solid transparent" />
11
19
  </tr>
12
20
  <tr style="min-height: 27px">
13
- <td style="border-left: 1px solid #000000; border-top: 1px solid #000000; border-right: 1px solid#000000; border-bottom: 1px solid #000000; vertical-align: middle">
14
- <p style="line-height: 13.3299999237061px; text-align: center">区分</p>
21
+ <td rowspan="2" style="border-left: 1px solid #000000; border-top: 1px solid #000000; border-right: 1px solid #000000; border-bottom: 1px solid #000000; vertical-align: middle">
22
+ <p style="line-height: 13.3299999237061px; text-align: center">当期首残高(A)</p>
23
+ <p style="line-height: 13.3299999237061px; text-align: center">(千円)</p>
15
24
  </td>
16
- <td style="border-left: 1px solid #000000; border-top: 1px solid #000000; border-right: 1px solid#000000; border-bottom: 1px solid #000000; vertical-align: middle">
17
- <p style="line-height: 13.3299999237061px; text-align: center">金額(千円)</p>
25
+ <td rowspan="2" style="border-left: 1px solid #000000; border-top: 1px solid #000000; border-right: 1px solid #000000; border-bottom: 1px solid #000000; vertical-align: middle">
26
+ <p style="line-height: 13.3299999237061px; text-align: center">当期発生高(B)</p>
27
+ <p style="line-height: 13.3299999237061px; text-align: center">(千円)</p>
18
28
  </td>
19
- </tr>
20
- </thead>
21
- <tbody>
22
- <tr style="min-height: 27px">
23
- <td style="border-left: 1px solid #000000; border-top: 1px solid #000000; border-right: 1px solid#000000; border-bottom: 1px solid #000000; vertical-align: middle">
24
- <p style="margin-left: 12px; margin-right: 12px;text-align: left">現金</p>
25
- </td>
26
- <td style="border-left: 1px solid #000000; border-top: 1px solid #000000; border-right: 1px solid#000000; border-bottom: 1px solid #000000; vertical-align: middle">
27
- <p style="margin-right: 72px; text-align: right">5,950</p>
29
+ <td rowspan="2" style="border-left: 1px solid #000000; border-top: 1px solid #000000; border-right: 1px solid #000000; border-bottom: 1px solid #000000; vertical-align: middle">
30
+ <p style="line-height: 13.3299999237061px; text-align: center">当期回収高(C)</p>
31
+ <p style="line-height: 13.3299999237061px; text-align: center">(千円)</p>
28
32
  </td>
29
- </tr>
30
- <tr style="min-height: 27px">
31
- <td style="border-left: 1px solid #000000; border-top: 1px solid #000000; border-right: 1px solid#000000; vertical-align: middle">
32
- <p style="margin-left: 12px; margin-right: 12px;text-align: left">預金</p>
33
+ <td rowspan="2" style="border-left: 1px solid #000000; border-top: 1px solid #000000; border-right: 1px none #000000; border-bottom: 1px solid #000000; vertical-align: middle">
34
+ <p style="line-height: 13.3299999237061px; text-align: center">当期末残高</p>
35
+ <p style="line-height: 13.3299999237061px; text-align: center">(千円)</p>
33
36
  </td>
34
37
  <td style="border-left: 1px solid #000000; border-top: 1px solid #000000; border-right: 1px solid#000000; vertical-align: middle">
35
- <p style="margin-right: 72px; text-align: right"> </p>
36
- </td>
37
- </tr>
38
- <tr style="min-height: 27px">
39
- <td style="border-left: 1px solid #000000; border-right: 1px solid #000000; vertical-align: middle">
40
- <p style="margin-left: 24px; margin-right: 12px;text-align: left">当座預金</p>
41
- </td>
42
- <td style="border-left: 1px solid #000000; border-right: 1px solid #000000; vertical-align: middle">
43
- <p style="margin-right: 72px; text-align: right">1,570,916</p>
44
- </td>
45
- </tr>
46
- <tr style="min-height: 27px">
47
- <td style="border-left: 1px solid #000000; border-right: 1px solid #000000; vertical-align: middle">
48
- <p style="margin-left: 24px; margin-right: 12px;text-align: left">通知預金</p>
49
- </td>
50
- <td style="border-left: 1px solid #000000; border-right: 1px solid #000000; vertical-align: middle">
51
- <p style="margin-right: 72px; text-align: right">-</p>
52
- </td>
53
- </tr>
54
- <tr style="min-height: 27px">
55
- <td style="border-left: 1px solid #000000; border-right: 1px solid #000000; vertical-align: middle">
56
- <p style="margin-left: 24px; margin-right: 12px;text-align: left">定期預金</p>
57
- </td>
58
- <td style="border-left: 1px solid #000000; border-right: 1px solid #000000; vertical-align: middle">
59
- <p style="margin-right: 72px; text-align: right">990,000</p>
60
- </td>
61
- </tr>
62
- <tr style="min-height: 27px">
63
- <td style="border-left: 1px solid #000000; border-right: 1px solid #000000; vertical-align: middle">
64
- <p style="margin-left: 24px; margin-right: 12px;text-align: left">別段預金</p>
65
- </td>
66
- <td style="border-left: 1px solid #000000; border-right: 1px solid #000000; vertical-align: middle">
67
- <p style="margin-right: 72px; text-align: right">2,645</p>
68
- </td>
69
- </tr>
70
- <tr style="min-height: 27px">
71
- <td style="border-left: 1px solid #000000; border-right: 1px solid #000000; vertical-align: middle">
72
- <p style="margin-left: 24px; margin-right: 12px;text-align: left">振替貯金</p>
38
+ <p style="line-height: 13.3299999237061px; text-align: center">回収率(%)</p>
73
39
  </td>
74
- <td style="border-left: 1px solid #000000; border-right: 1px solid #000000; vertical-align: middle">
75
- <p style="margin-right: 72px; text-align: right">29,750</p>
40
+ <td rowspan="2" style="border-left: 1px none #000000; border-top: 1px solid #000000; border-right: 1px solid #000000; border-bottom: 1px solid #000000; vertical-align: middle">
41
+ <p style="line-height: 13.3299999237061px; text-align: center">滞留日数(日)</p>
76
42
  </td>
77
43
  </tr>
78
- <tr style="min-height: 27px">
44
+ <tr style="min-height: 40px">
79
45
  <td style="border-left: 1px solid #000000; border-right: 1px solid #000000; border-bottom: 1px solid #000000; vertical-align: middle">
80
- <p style="margin-left: 24px; margin-right: 12px;text-align: left">普通預金</p>
81
- </td>
82
- <td style="border-left: 1px solid #000000; border-right: 1px solid #000000; border-bottom: 1px solid #000000; vertical-align: middle">
83
- <p style="margin-right: 72px; text-align: right">20,034</p>
84
- </td>
85
- </tr>
86
- <tr style="min-height: 27px">
87
- <td style="border-left: 1px solid #000000; border-top: 1px solid #000000; border-right: 1px solid#000000; border-bottom: 1px solid #000000; vertical-align: middle">
88
- <p style="text-align: center">小計</p>
89
- </td>
90
- <td style="border-left: 1px solid #000000; border-top: 1px solid #000000; border-right: 1px solid#000000; border-bottom: 1px solid #000000; vertical-align: middle">
91
- <p style="margin-right: 72px; text-align: right">
92
- <span style="font-weight: normal">2,613,346</span>
93
- </p>
94
- </td>
95
- </tr>
96
- <tr style="min-height: 27px">
97
- <td style="border-left: 1px solid #000000; border-top: 1px solid #000000; border-right: 1px solid#000000; border-bottom: 1px solid #000000; vertical-align: middle">
98
- <p style="text-align: center">計</p>
99
- </td>
100
- <td style="border-left: 1px solid #000000; border-top: 1px solid #000000; border-right: 1px solid#000000; border-bottom: 1px solid #000000; vertical-align: middle">
101
- <p style="margin-right: 72px; text-align: right">2,619,296</p>
102
- </td>
103
- </tr>
104
- </tbody>
105
- </table>
106
- </div>
46
+ <p style="margin-left: 6px; line-height: 1.33000004291534px; text-align: center"> </p>
47
+ <div style="text-align: center">
48
+ <table style="table-layout: fixed; margin-left: auto; margin-right: auto; width: 100px" cellpadding="0"
49
+ cellspacing="0">
50
+ <colgroup>
51
+ <col style="width: 60px" />
52
+ <col style="width: 40px" />
53
+ </colgroup>
54
+ <tbody>
55
+ <tr>
56
+ <td style="width: 59px; border-left: 1px solid transparent; border-right: 1px solid transparent" />
57
+ <td style="border-left: 1px solid transparent; border-right: 1px solid transparent" />
58
+ </tr>
59
+ <tr style="min-height: 1.33333337306976px">
60
+ <td style="border-left: 0px none #000000; border-top: 0px none #000000; border-right: 0px none #000000; border-bottom: 1px solid #000000; vertical-align: top">
61
+ <p style="line-height: 13.3299999237061px; margin-bottom: 1.33000004291534px; text-align: center">
62
+ <span style="font-size: 12px">C</span>
63
+ </p>
64
+ </td>
65
+ <td rowspan="2" style="border-top: 0px none #000000; border-right: 0px none #000000; border-bottom: 0px none #000000; vertical-align: middle">
66
+ <p style="margin-left: 4px; line-height: 13.3299999237061px; text-align: center">
67
+ <span style="font-size: 12px">×100</span>
68
+ </p>
69
+ </td>
70
+ </tr>
71
+ <tr style="min-height: 1.33333337306976px">
72
+ <td style="border-left: 0px none #000000; border-top: 1px solid #000000; border-right: 0px none #000000; border-bottom: 0px none #000000; vertical-align: top">
73
+ <p style="line-height: 13.3299999237061px; margin-top: 1.33000004291534px; text-align: center">
74
+ <span style="font-size: 12px">A+B</span>
75
+ </p>
76
+ </td>
77
+ </tr>
78
+ </tbody>
79
+ </table>
80
+ </div>
@@ -1,3 +1,3 @@
1
1
  module TableAnalysis
2
- VERSION = '0.2.1'.freeze
2
+ VERSION = '0.2.2'.freeze
3
3
  end
@@ -46,7 +46,6 @@ module TableAnalysis
46
46
 
47
47
  table_maps = header_map + content_maps
48
48
 
49
- p table_maps
50
49
  table_maps
51
50
  end
52
51
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: table_analysis
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - mico_xiaozhen@sina.com