workbook 0.8.1 → 0.9.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (74) hide show
  1. checksums.yaml +4 -4
  2. data/.codeclimate.yml +21 -0
  3. data/.gitignore +4 -1
  4. data/.ruby-version +1 -1
  5. data/.travis.yml +4 -4
  6. data/CHANGELOG.md +8 -0
  7. data/Gemfile +2 -2
  8. data/README.md +9 -7
  9. data/Rakefile +6 -6
  10. data/json_test.json +1 -0
  11. data/lib/workbook/book.rb +73 -62
  12. data/lib/workbook/cell.rb +58 -13
  13. data/lib/workbook/column.rb +31 -28
  14. data/lib/workbook/format.rb +23 -24
  15. data/lib/workbook/generatetypes.rb +4 -4
  16. data/lib/workbook/modules/cache.rb +6 -7
  17. data/lib/workbook/modules/cell.rb +77 -100
  18. data/lib/workbook/modules/diff_sort.rb +92 -83
  19. data/lib/workbook/modules/raw_objects_storage.rb +6 -8
  20. data/lib/workbook/modules/type_parser.rb +30 -22
  21. data/lib/workbook/nil_value.rb +4 -9
  22. data/lib/workbook/readers/csv_reader.rb +7 -10
  23. data/lib/workbook/readers/ods_reader.rb +51 -50
  24. data/lib/workbook/readers/txt_reader.rb +6 -8
  25. data/lib/workbook/readers/xls_reader.rb +21 -33
  26. data/lib/workbook/readers/xls_shared.rb +106 -117
  27. data/lib/workbook/readers/xlsx_reader.rb +45 -46
  28. data/lib/workbook/row.rb +99 -84
  29. data/lib/workbook/sheet.rb +47 -38
  30. data/lib/workbook/table.rb +96 -72
  31. data/lib/workbook/template.rb +12 -15
  32. data/lib/workbook/types/false.rb +0 -1
  33. data/lib/workbook/types/nil.rb +0 -1
  34. data/lib/workbook/types/nil_class.rb +1 -1
  35. data/lib/workbook/types/numeric.rb +1 -1
  36. data/lib/workbook/types/string.rb +1 -1
  37. data/lib/workbook/types/time.rb +1 -1
  38. data/lib/workbook/types/true.rb +0 -1
  39. data/lib/workbook/types/true_class.rb +1 -1
  40. data/lib/workbook/version.rb +2 -3
  41. data/lib/workbook/writers/csv_table_writer.rb +10 -13
  42. data/lib/workbook/writers/html_writer.rb +34 -38
  43. data/lib/workbook/writers/json_table_writer.rb +8 -11
  44. data/lib/workbook/writers/xls_writer.rb +30 -36
  45. data/lib/workbook/writers/xlsx_writer.rb +45 -29
  46. data/lib/workbook.rb +16 -15
  47. data/test/artifacts/currency_test.ods +0 -0
  48. data/test/helper.rb +6 -5
  49. data/test/test_book.rb +41 -38
  50. data/test/test_column.rb +26 -24
  51. data/test/test_format.rb +51 -55
  52. data/test/test_functional.rb +7 -8
  53. data/test/test_modules_cache.rb +18 -17
  54. data/test/test_modules_cell.rb +55 -46
  55. data/test/test_modules_table_diff_sort.rb +55 -64
  56. data/test/test_modules_type_parser.rb +61 -31
  57. data/test/test_readers_csv_reader.rb +48 -42
  58. data/test/test_readers_ods_reader.rb +36 -31
  59. data/test/test_readers_txt_reader.rb +21 -23
  60. data/test/test_readers_xls_reader.rb +20 -23
  61. data/test/test_readers_xls_shared.rb +2 -3
  62. data/test/test_readers_xlsx_reader.rb +44 -37
  63. data/test/test_row.rb +105 -109
  64. data/test/test_sheet.rb +35 -41
  65. data/test/test_table.rb +82 -60
  66. data/test/test_template.rb +16 -15
  67. data/test/test_types_date.rb +4 -6
  68. data/test/test_writers_csv_writer.rb +24 -0
  69. data/test/test_writers_html_writer.rb +42 -41
  70. data/test/test_writers_json_writer.rb +16 -9
  71. data/test/test_writers_xls_writer.rb +50 -35
  72. data/test/test_writers_xlsx_writer.rb +62 -34
  73. data/workbook.gemspec +25 -27
  74. metadata +96 -42
metadata CHANGED
@@ -1,127 +1,175 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: workbook
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.1
4
+ version: 0.9.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Maarten Brouwers
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-03-27 00:00:00.000000000 Z
11
+ date: 2024-09-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
- name: ruby-prof
14
+ name: rake
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - "~>"
17
+ - - ">"
18
18
  - !ruby/object:Gem::Version
19
- version: '0.14'
19
+ version: '12.0'
20
20
  type: :development
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - "~>"
24
+ - - ">"
25
25
  - !ruby/object:Gem::Version
26
- version: '0.14'
26
+ version: '12.0'
27
27
  - !ruby/object:Gem::Dependency
28
- name: rake
28
+ name: minitest
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - "~>"
31
+ - - ">"
32
32
  - !ruby/object:Gem::Version
33
- version: '12.0'
33
+ version: '5.4'
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: '12.0'
40
+ version: '5.4'
41
41
  - !ruby/object:Gem::Dependency
42
- name: minitest
42
+ name: byebug
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - "~>"
45
+ - - ">"
46
46
  - !ruby/object:Gem::Version
47
- version: '5.4'
47
+ version: '10'
48
48
  type: :development
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - "~>"
52
+ - - ">"
53
53
  - !ruby/object:Gem::Version
54
- version: '5.4'
54
+ version: '10'
55
+ - !ruby/object:Gem::Dependency
56
+ name: standard
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - ">"
60
+ - !ruby/object:Gem::Version
61
+ version: '1.0'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ">"
67
+ - !ruby/object:Gem::Version
68
+ version: '1.0'
69
+ - !ruby/object:Gem::Dependency
70
+ name: simplecov
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - ">"
74
+ - !ruby/object:Gem::Version
75
+ version: 0.17.0
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - ">"
81
+ - !ruby/object:Gem::Version
82
+ version: 0.17.0
55
83
  - !ruby/object:Gem::Dependency
56
84
  name: spreadsheet
57
85
  requirement: !ruby/object:Gem::Requirement
58
86
  requirements:
59
- - - "~>"
87
+ - - ">"
60
88
  - !ruby/object:Gem::Version
61
- version: '1.1'
89
+ version: '1.2'
62
90
  type: :runtime
63
91
  prerelease: false
64
92
  version_requirements: !ruby/object:Gem::Requirement
65
93
  requirements:
66
- - - "~>"
94
+ - - ">"
67
95
  - !ruby/object:Gem::Version
68
- version: '1.1'
96
+ version: '1.2'
69
97
  - !ruby/object:Gem::Dependency
70
98
  name: rchardet
71
99
  requirement: !ruby/object:Gem::Requirement
72
100
  requirements:
73
- - - "~>"
101
+ - - ">="
74
102
  - !ruby/object:Gem::Version
75
- version: '1.3'
103
+ version: 1.8.0
76
104
  type: :runtime
77
105
  prerelease: false
78
106
  version_requirements: !ruby/object:Gem::Requirement
79
107
  requirements:
80
- - - "~>"
108
+ - - ">="
81
109
  - !ruby/object:Gem::Version
82
- version: '1.3'
110
+ version: 1.8.0
83
111
  - !ruby/object:Gem::Dependency
84
112
  name: json
85
113
  requirement: !ruby/object:Gem::Requirement
86
114
  requirements:
87
- - - "~>"
115
+ - - ">"
116
+ - !ruby/object:Gem::Version
117
+ version: '2.3'
118
+ type: :runtime
119
+ prerelease: false
120
+ version_requirements: !ruby/object:Gem::Requirement
121
+ requirements:
122
+ - - ">"
123
+ - !ruby/object:Gem::Version
124
+ version: '2.3'
125
+ - !ruby/object:Gem::Dependency
126
+ name: rubyzip
127
+ requirement: !ruby/object:Gem::Requirement
128
+ requirements:
129
+ - - ">"
88
130
  - !ruby/object:Gem::Version
89
- version: '2.1'
131
+ version: '1.2'
132
+ - - ">="
133
+ - !ruby/object:Gem::Version
134
+ version: 1.2.1
90
135
  type: :runtime
91
136
  prerelease: false
92
137
  version_requirements: !ruby/object:Gem::Requirement
93
138
  requirements:
94
- - - "~>"
139
+ - - ">"
140
+ - !ruby/object:Gem::Version
141
+ version: '1.2'
142
+ - - ">="
95
143
  - !ruby/object:Gem::Version
96
- version: '2.1'
144
+ version: 1.2.1
97
145
  - !ruby/object:Gem::Dependency
98
- name: axlsx
146
+ name: caxlsx
99
147
  requirement: !ruby/object:Gem::Requirement
100
148
  requirements:
101
- - - "~>"
149
+ - - ">"
102
150
  - !ruby/object:Gem::Version
103
- version: 3.0.0.pre
151
+ version: '3.0'
104
152
  type: :runtime
105
153
  prerelease: false
106
154
  version_requirements: !ruby/object:Gem::Requirement
107
155
  requirements:
108
- - - "~>"
156
+ - - ">"
109
157
  - !ruby/object:Gem::Version
110
- version: 3.0.0.pre
158
+ version: '3.0'
111
159
  - !ruby/object:Gem::Dependency
112
160
  name: nokogiri
113
161
  requirement: !ruby/object:Gem::Requirement
114
162
  requirements:
115
- - - "~>"
163
+ - - ">"
116
164
  - !ruby/object:Gem::Version
117
- version: '1.8'
165
+ version: '1.10'
118
166
  type: :runtime
119
167
  prerelease: false
120
168
  version_requirements: !ruby/object:Gem::Requirement
121
169
  requirements:
122
- - - "~>"
170
+ - - ">"
123
171
  - !ruby/object:Gem::Version
124
- version: '1.8'
172
+ version: '1.10'
125
173
  description: Workbook contains workbooks, as in a table, contains rows, contains cells,
126
174
  reads/writes excel, ods and csv and tab separated files, and offers basic diffing
127
175
  and sorting capabilities.
@@ -132,6 +180,7 @@ executables:
132
180
  extensions: []
133
181
  extra_rdoc_files: []
134
182
  files:
183
+ - ".codeclimate.yml"
135
184
  - ".gitignore"
136
185
  - ".ruby-version"
137
186
  - ".travis.yml"
@@ -146,6 +195,7 @@ files:
146
195
  - README.md
147
196
  - Rakefile
148
197
  - bin/axldiff
198
+ - json_test.json
149
199
  - lib/workbook.rb
150
200
  - lib/workbook/book.rb
151
201
  - lib/workbook/cell.rb
@@ -192,6 +242,7 @@ files:
192
242
  - test/artifacts/book_with_tabs_and_colours.xlsx
193
243
  - test/artifacts/complex_types.ods
194
244
  - test/artifacts/complex_types.xls
245
+ - test/artifacts/currency_test.ods
195
246
  - test/artifacts/excel_different_types.csv
196
247
  - test/artifacts/excel_different_types.ods
197
248
  - test/artifacts/excel_different_types.txt
@@ -235,6 +286,7 @@ files:
235
286
  - test/test_table.rb
236
287
  - test/test_template.rb
237
288
  - test/test_types_date.rb
289
+ - test/test_writers_csv_writer.rb
238
290
  - test/test_writers_html_writer.rb
239
291
  - test/test_writers_json_writer.rb
240
292
  - test/test_writers_xls_writer.rb
@@ -244,7 +296,7 @@ homepage: http://murb.nl/blog?tags=workbook
244
296
  licenses:
245
297
  - MIT
246
298
  metadata: {}
247
- post_install_message:
299
+ post_install_message:
248
300
  rdoc_options: []
249
301
  require_paths:
250
302
  - lib
@@ -259,8 +311,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
259
311
  - !ruby/object:Gem::Version
260
312
  version: '0'
261
313
  requirements: []
262
- rubygems_version: 3.0.3
263
- signing_key:
314
+ rubygems_version: 3.4.6
315
+ signing_key:
264
316
  specification_version: 4
265
317
  summary: Workbook is a datastructure to contain books of tables (an anlogy used in
266
318
  e.g. Excel)
@@ -273,6 +325,7 @@ test_files:
273
325
  - test/artifacts/book_with_tabs_and_colours.xlsx
274
326
  - test/artifacts/complex_types.ods
275
327
  - test/artifacts/complex_types.xls
328
+ - test/artifacts/currency_test.ods
276
329
  - test/artifacts/excel_different_types.csv
277
330
  - test/artifacts/excel_different_types.ods
278
331
  - test/artifacts/excel_different_types.txt
@@ -316,6 +369,7 @@ test_files:
316
369
  - test/test_table.rb
317
370
  - test/test_template.rb
318
371
  - test/test_types_date.rb
372
+ - test/test_writers_csv_writer.rb
319
373
  - test/test_writers_html_writer.rb
320
374
  - test/test_writers_json_writer.rb
321
375
  - test/test_writers_xls_writer.rb