fast_excel 0.4.1 → 0.5.0

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.
Files changed (117) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/test.yml +1 -7
  3. data/CHANGELOG.md +9 -0
  4. data/Gemfile +1 -1
  5. data/examples/example.rb +2 -0
  6. data/examples/example_date_time.rb +38 -0
  7. data/fast_excel.gemspec +2 -2
  8. data/lib/fast_excel/binding/format.rb +17 -0
  9. data/lib/fast_excel/binding/workbook.rb +39 -17
  10. data/lib/fast_excel/binding/worksheet.rb +57 -13
  11. data/lib/fast_excel/binding.rb +7 -7
  12. data/lib/fast_excel.rb +27 -20
  13. data/libxlsxwriter/.github/FUNDING.yml +1 -0
  14. data/libxlsxwriter/.github/ISSUE_TEMPLATE.md +85 -0
  15. data/libxlsxwriter/.github/PULL_REQUEST_TEMPLATE.md +130 -0
  16. data/libxlsxwriter/.github/workflows/cmake_actions.yml +48 -0
  17. data/libxlsxwriter/.github/workflows/code_style.yml +23 -0
  18. data/libxlsxwriter/.github/workflows/coverity.yml +22 -0
  19. data/libxlsxwriter/.github/workflows/make_actions.yml +52 -0
  20. data/libxlsxwriter/.github/workflows/valgrind.yml +23 -0
  21. data/libxlsxwriter/.github/workflows/windows_build.yml +54 -0
  22. data/libxlsxwriter/.github/workflows/zig_build.yml +22 -0
  23. data/libxlsxwriter/.gitignore +16 -1
  24. data/libxlsxwriter/.indent.pro +24 -0
  25. data/libxlsxwriter/CMakeLists.txt +156 -56
  26. data/libxlsxwriter/CONTRIBUTING.md +2 -2
  27. data/libxlsxwriter/Changes.txt +344 -2
  28. data/libxlsxwriter/LICENSE.txt +66 -8
  29. data/libxlsxwriter/Makefile +151 -54
  30. data/libxlsxwriter/Package.swift +42 -0
  31. data/libxlsxwriter/Readme.md +4 -2
  32. data/libxlsxwriter/build.zig +324 -0
  33. data/libxlsxwriter/build.zig.zon +11 -0
  34. data/libxlsxwriter/cmake/FindMINIZIP.cmake +3 -3
  35. data/libxlsxwriter/cocoapods/libxlsxwriter-umbrella.h +6 -0
  36. data/libxlsxwriter/include/xlsxwriter/app.h +2 -1
  37. data/libxlsxwriter/include/xlsxwriter/chart.h +236 -32
  38. data/libxlsxwriter/include/xlsxwriter/chartsheet.h +7 -7
  39. data/libxlsxwriter/include/xlsxwriter/comment.h +76 -0
  40. data/libxlsxwriter/include/xlsxwriter/common.h +111 -50
  41. data/libxlsxwriter/include/xlsxwriter/content_types.h +8 -1
  42. data/libxlsxwriter/include/xlsxwriter/core.h +1 -1
  43. data/libxlsxwriter/include/xlsxwriter/custom.h +1 -1
  44. data/libxlsxwriter/include/xlsxwriter/drawing.h +11 -20
  45. data/libxlsxwriter/include/xlsxwriter/format.h +121 -8
  46. data/libxlsxwriter/include/xlsxwriter/hash_table.h +1 -1
  47. data/libxlsxwriter/include/xlsxwriter/metadata.h +49 -0
  48. data/libxlsxwriter/include/xlsxwriter/packager.h +27 -16
  49. data/libxlsxwriter/include/xlsxwriter/relationships.h +1 -1
  50. data/libxlsxwriter/include/xlsxwriter/shared_strings.h +1 -1
  51. data/libxlsxwriter/include/xlsxwriter/styles.h +13 -7
  52. data/libxlsxwriter/include/xlsxwriter/table.h +51 -0
  53. data/libxlsxwriter/include/xlsxwriter/theme.h +1 -1
  54. data/libxlsxwriter/include/xlsxwriter/third_party/emyg_dtoa.h +26 -0
  55. data/libxlsxwriter/include/xlsxwriter/third_party/ioapi.h +27 -25
  56. data/libxlsxwriter/include/xlsxwriter/third_party/md5.h +45 -0
  57. data/libxlsxwriter/include/xlsxwriter/third_party/zip.h +155 -153
  58. data/libxlsxwriter/include/xlsxwriter/utility.h +70 -8
  59. data/libxlsxwriter/include/xlsxwriter/vml.h +55 -0
  60. data/libxlsxwriter/include/xlsxwriter/workbook.h +218 -47
  61. data/libxlsxwriter/include/xlsxwriter/worksheet.h +2770 -241
  62. data/libxlsxwriter/include/xlsxwriter/xmlwriter.h +12 -8
  63. data/libxlsxwriter/include/xlsxwriter.h +4 -2
  64. data/libxlsxwriter/libxlsxwriter.podspec +8 -5
  65. data/libxlsxwriter/src/Makefile +58 -21
  66. data/libxlsxwriter/src/app.c +5 -2
  67. data/libxlsxwriter/src/chart.c +396 -81
  68. data/libxlsxwriter/src/chartsheet.c +22 -22
  69. data/libxlsxwriter/src/comment.c +443 -0
  70. data/libxlsxwriter/src/content_types.c +40 -1
  71. data/libxlsxwriter/src/core.c +2 -2
  72. data/libxlsxwriter/src/custom.c +1 -1
  73. data/libxlsxwriter/src/drawing.c +160 -40
  74. data/libxlsxwriter/src/format.c +109 -25
  75. data/libxlsxwriter/src/hash_table.c +1 -1
  76. data/libxlsxwriter/src/metadata.c +283 -0
  77. data/libxlsxwriter/src/packager.c +794 -94
  78. data/libxlsxwriter/src/relationships.c +1 -1
  79. data/libxlsxwriter/src/shared_strings.c +2 -4
  80. data/libxlsxwriter/src/styles.c +353 -58
  81. data/libxlsxwriter/src/table.c +304 -0
  82. data/libxlsxwriter/src/theme.c +1 -1
  83. data/libxlsxwriter/src/utility.c +143 -43
  84. data/libxlsxwriter/src/vml.c +1062 -0
  85. data/libxlsxwriter/src/workbook.c +567 -77
  86. data/libxlsxwriter/src/worksheet.c +6668 -1462
  87. data/libxlsxwriter/src/xmlwriter.c +95 -5
  88. data/libxlsxwriter/third_party/dtoa/Makefile +42 -0
  89. data/libxlsxwriter/third_party/dtoa/emyg_dtoa.c +461 -0
  90. data/libxlsxwriter/third_party/dtoa/emyg_dtoa.h +26 -0
  91. data/libxlsxwriter/third_party/md5/Makefile +42 -0
  92. data/libxlsxwriter/third_party/md5/md5.c +291 -0
  93. data/libxlsxwriter/third_party/md5/md5.h +45 -0
  94. data/libxlsxwriter/third_party/minizip/Makefile +3 -8
  95. data/libxlsxwriter/third_party/minizip/Makefile.orig +8 -4
  96. data/libxlsxwriter/third_party/minizip/MiniZip64_Changes.txt +1 -1
  97. data/libxlsxwriter/third_party/minizip/configure.ac +1 -1
  98. data/libxlsxwriter/third_party/minizip/crypt.h +13 -16
  99. data/libxlsxwriter/third_party/minizip/ioapi.c +31 -57
  100. data/libxlsxwriter/third_party/minizip/ioapi.h +31 -23
  101. data/libxlsxwriter/third_party/minizip/iowin32.c +29 -45
  102. data/libxlsxwriter/third_party/minizip/iowin32.h +4 -4
  103. data/libxlsxwriter/third_party/minizip/miniunz.c +29 -56
  104. data/libxlsxwriter/third_party/minizip/minizip.c +38 -49
  105. data/libxlsxwriter/third_party/minizip/mztools.c +1 -7
  106. data/libxlsxwriter/third_party/minizip/unzip.c +202 -342
  107. data/libxlsxwriter/third_party/minizip/unzip.h +74 -74
  108. data/libxlsxwriter/third_party/minizip/zip.c +165 -218
  109. data/libxlsxwriter/third_party/minizip/zip.h +164 -154
  110. data/libxlsxwriter/third_party/tmpfileplus/Makefile +3 -3
  111. data/libxlsxwriter/version.txt +1 -1
  112. data/test/auto_width_test.rb +20 -0
  113. data/test/default_format_test.rb +1 -1
  114. data/test/validations_test.rb +3 -3
  115. data/test/worksheet_test.rb +6 -1
  116. metadata +33 -7
  117. data/libxlsxwriter/.travis.yml +0 -37
@@ -37,7 +37,7 @@
37
37
 
38
38
  */
39
39
 
40
- /* Pragma added by libxlsxwriter project to avoid warnings with -pedantic -ansi. */
40
+ /* Pragma added by libxlsxwriter to avoid warnings with -pedantic -ansi. */
41
41
  #ifndef _WIN32
42
42
  #pragma GCC system_header
43
43
  #endif
@@ -49,7 +49,7 @@
49
49
  extern "C" {
50
50
  #endif
51
51
 
52
- /* #define HAVE_BZIP2 */
52
+ //#define HAVE_BZIP2
53
53
 
54
54
  #ifndef _ZLIB_H
55
55
  #include "zlib.h"
@@ -59,6 +59,14 @@ extern "C" {
59
59
  #include "ioapi.h"
60
60
  #endif
61
61
 
62
+ /* Encryption not required by libxlsxwriter. */
63
+ #ifndef NOCRYPT
64
+ #define NOCRYPT
65
+ #endif
66
+ #ifndef NOUNCRYPT
67
+ #define NOUNCRYPT
68
+ #endif
69
+
62
70
  #ifdef HAVE_BZIP2
63
71
  #include "bzlib.h"
64
72
  #endif
@@ -93,12 +101,12 @@ typedef voidp zipFile;
93
101
  /* tm_zip contain date/time info */
94
102
  typedef struct tm_zip_s
95
103
  {
96
- uInt tm_sec; /* seconds after the minute - [0,59] */
97
- uInt tm_min; /* minutes after the hour - [0,59] */
98
- uInt tm_hour; /* hours since midnight - [0,23] */
99
- uInt tm_mday; /* day of the month - [1,31] */
100
- uInt tm_mon; /* months since January - [0,11] */
101
- uInt tm_year; /* years - [1980..2044] */
104
+ int tm_sec; /* seconds after the minute - [0,59] */
105
+ int tm_min; /* minutes after the hour - [0,59] */
106
+ int tm_hour; /* hours since midnight - [0,23] */
107
+ int tm_mday; /* day of the month - [1,31] */
108
+ int tm_mon; /* months since January - [0,11] */
109
+ int tm_year; /* years - [1980..2044] */
102
110
  } tm_zip;
103
111
 
104
112
  typedef struct
@@ -118,8 +126,8 @@ typedef const char* zipcharpc;
118
126
  #define APPEND_STATUS_CREATEAFTER (1)
119
127
  #define APPEND_STATUS_ADDINZIP (2)
120
128
 
121
- extern zipFile ZEXPORT zipOpen OF((const char *pathname, int append));
122
- extern zipFile ZEXPORT zipOpen64 OF((const void *pathname, int append));
129
+ extern zipFile ZEXPORT zipOpen(const char *pathname, int append);
130
+ extern zipFile ZEXPORT zipOpen64(const void *pathname, int append);
123
131
  /*
124
132
  Create a zipfile.
125
133
  pathname contain on Windows XP a filename like "c:\\zlib\\zlib113.zip" or on
@@ -136,41 +144,46 @@ extern zipFile ZEXPORT zipOpen64 OF((const void *pathname, int append));
136
144
 
137
145
  /* Note : there is no delete function into a zipfile.
138
146
  If you want delete file into a zipfile, you must open a zipfile, and create another
139
- Of couse, you can use RAW reading and writing to copy the file you did not want delte
147
+ Of course, you can use RAW reading and writing to copy the file you did not want delete
140
148
  */
141
149
 
142
- extern zipFile ZEXPORT zipOpen2 OF((const char *pathname,
143
- int append,
144
- zipcharpc* globalcomment,
145
- zlib_filefunc_def* pzlib_filefunc_def));
150
+ extern zipFile ZEXPORT zipOpen2(const char *pathname,
151
+ int append,
152
+ zipcharpc* globalcomment,
153
+ zlib_filefunc_def* pzlib_filefunc_def);
146
154
 
147
- extern zipFile ZEXPORT zipOpen2_64 OF((const void *pathname,
155
+ extern zipFile ZEXPORT zipOpen2_64(const void *pathname,
148
156
  int append,
149
157
  zipcharpc* globalcomment,
150
- zlib_filefunc64_def* pzlib_filefunc_def));
151
-
152
- extern int ZEXPORT zipOpenNewFileInZip OF((zipFile file,
153
- const char* filename,
154
- const zip_fileinfo* zipfi,
155
- const void* extrafield_local,
156
- uInt size_extrafield_local,
157
- const void* extrafield_global,
158
- uInt size_extrafield_global,
159
- const char* comment,
160
- int method,
161
- int level));
162
-
163
- extern int ZEXPORT zipOpenNewFileInZip64 OF((zipFile file,
164
- const char* filename,
165
- const zip_fileinfo* zipfi,
166
- const void* extrafield_local,
167
- uInt size_extrafield_local,
168
- const void* extrafield_global,
169
- uInt size_extrafield_global,
170
- const char* comment,
171
- int method,
172
- int level,
173
- int zip64));
158
+ zlib_filefunc64_def* pzlib_filefunc_def);
159
+
160
+ extern zipFile ZEXPORT zipOpen3(const void *pathname,
161
+ int append,
162
+ zipcharpc* globalcomment,
163
+ zlib_filefunc64_32_def* pzlib_filefunc64_32_def);
164
+
165
+ extern int ZEXPORT zipOpenNewFileInZip(zipFile file,
166
+ const char* filename,
167
+ const zip_fileinfo* zipfi,
168
+ const void* extrafield_local,
169
+ uInt size_extrafield_local,
170
+ const void* extrafield_global,
171
+ uInt size_extrafield_global,
172
+ const char* comment,
173
+ int method,
174
+ int level);
175
+
176
+ extern int ZEXPORT zipOpenNewFileInZip64(zipFile file,
177
+ const char* filename,
178
+ const zip_fileinfo* zipfi,
179
+ const void* extrafield_local,
180
+ uInt size_extrafield_local,
181
+ const void* extrafield_global,
182
+ uInt size_extrafield_global,
183
+ const char* comment,
184
+ int method,
185
+ int level,
186
+ int zip64);
174
187
 
175
188
  /*
176
189
  Open a file in the ZIP for writing.
@@ -189,70 +202,69 @@ extern int ZEXPORT zipOpenNewFileInZip64 OF((zipFile file,
189
202
  */
190
203
 
191
204
 
192
- extern int ZEXPORT zipOpenNewFileInZip2 OF((zipFile file,
193
- const char* filename,
194
- const zip_fileinfo* zipfi,
195
- const void* extrafield_local,
196
- uInt size_extrafield_local,
197
- const void* extrafield_global,
198
- uInt size_extrafield_global,
199
- const char* comment,
200
- int method,
201
- int level,
202
- int raw));
203
-
204
-
205
- extern int ZEXPORT zipOpenNewFileInZip2_64 OF((zipFile file,
206
- const char* filename,
207
- const zip_fileinfo* zipfi,
208
- const void* extrafield_local,
209
- uInt size_extrafield_local,
210
- const void* extrafield_global,
211
- uInt size_extrafield_global,
212
- const char* comment,
213
- int method,
214
- int level,
215
- int raw,
216
- int zip64));
205
+ extern int ZEXPORT zipOpenNewFileInZip2(zipFile file,
206
+ const char* filename,
207
+ const zip_fileinfo* zipfi,
208
+ const void* extrafield_local,
209
+ uInt size_extrafield_local,
210
+ const void* extrafield_global,
211
+ uInt size_extrafield_global,
212
+ const char* comment,
213
+ int method,
214
+ int level,
215
+ int raw);
216
+
217
+
218
+ extern int ZEXPORT zipOpenNewFileInZip2_64(zipFile file,
219
+ const char* filename,
220
+ const zip_fileinfo* zipfi,
221
+ const void* extrafield_local,
222
+ uInt size_extrafield_local,
223
+ const void* extrafield_global,
224
+ uInt size_extrafield_global,
225
+ const char* comment,
226
+ int method,
227
+ int level,
228
+ int raw,
229
+ int zip64);
217
230
  /*
218
231
  Same than zipOpenNewFileInZip, except if raw=1, we write raw file
219
232
  */
220
233
 
221
- extern int ZEXPORT zipOpenNewFileInZip3 OF((zipFile file,
222
- const char* filename,
223
- const zip_fileinfo* zipfi,
224
- const void* extrafield_local,
225
- uInt size_extrafield_local,
226
- const void* extrafield_global,
227
- uInt size_extrafield_global,
228
- const char* comment,
229
- int method,
230
- int level,
231
- int raw,
232
- int windowBits,
233
- int memLevel,
234
- int strategy,
235
- const char* password,
236
- uLong crcForCrypting));
237
-
238
- extern int ZEXPORT zipOpenNewFileInZip3_64 OF((zipFile file,
239
- const char* filename,
240
- const zip_fileinfo* zipfi,
241
- const void* extrafield_local,
242
- uInt size_extrafield_local,
243
- const void* extrafield_global,
244
- uInt size_extrafield_global,
245
- const char* comment,
246
- int method,
247
- int level,
248
- int raw,
249
- int windowBits,
250
- int memLevel,
251
- int strategy,
252
- const char* password,
253
- uLong crcForCrypting,
254
- int zip64
255
- ));
234
+ extern int ZEXPORT zipOpenNewFileInZip3(zipFile file,
235
+ const char* filename,
236
+ const zip_fileinfo* zipfi,
237
+ const void* extrafield_local,
238
+ uInt size_extrafield_local,
239
+ const void* extrafield_global,
240
+ uInt size_extrafield_global,
241
+ const char* comment,
242
+ int method,
243
+ int level,
244
+ int raw,
245
+ int windowBits,
246
+ int memLevel,
247
+ int strategy,
248
+ const char* password,
249
+ uLong crcForCrypting);
250
+
251
+ extern int ZEXPORT zipOpenNewFileInZip3_64(zipFile file,
252
+ const char* filename,
253
+ const zip_fileinfo* zipfi,
254
+ const void* extrafield_local,
255
+ uInt size_extrafield_local,
256
+ const void* extrafield_global,
257
+ uInt size_extrafield_global,
258
+ const char* comment,
259
+ int method,
260
+ int level,
261
+ int raw,
262
+ int windowBits,
263
+ int memLevel,
264
+ int strategy,
265
+ const char* password,
266
+ uLong crcForCrypting,
267
+ int zip64);
256
268
 
257
269
  /*
258
270
  Same than zipOpenNewFileInZip2, except
@@ -261,47 +273,45 @@ extern int ZEXPORT zipOpenNewFileInZip3_64 OF((zipFile file,
261
273
  crcForCrypting : crc of file to compress (needed for crypting)
262
274
  */
263
275
 
264
- extern int ZEXPORT zipOpenNewFileInZip4 OF((zipFile file,
265
- const char* filename,
266
- const zip_fileinfo* zipfi,
267
- const void* extrafield_local,
268
- uInt size_extrafield_local,
269
- const void* extrafield_global,
270
- uInt size_extrafield_global,
271
- const char* comment,
272
- int method,
273
- int level,
274
- int raw,
275
- int windowBits,
276
- int memLevel,
277
- int strategy,
278
- const char* password,
279
- uLong crcForCrypting,
280
- uLong versionMadeBy,
281
- uLong flagBase
282
- ));
283
-
284
-
285
- extern int ZEXPORT zipOpenNewFileInZip4_64 OF((zipFile file,
286
- const char* filename,
287
- const zip_fileinfo* zipfi,
288
- const void* extrafield_local,
289
- uInt size_extrafield_local,
290
- const void* extrafield_global,
291
- uInt size_extrafield_global,
292
- const char* comment,
293
- int method,
294
- int level,
295
- int raw,
296
- int windowBits,
297
- int memLevel,
298
- int strategy,
299
- const char* password,
300
- uLong crcForCrypting,
301
- uLong versionMadeBy,
302
- uLong flagBase,
303
- int zip64
304
- ));
276
+ extern int ZEXPORT zipOpenNewFileInZip4(zipFile file,
277
+ const char* filename,
278
+ const zip_fileinfo* zipfi,
279
+ const void* extrafield_local,
280
+ uInt size_extrafield_local,
281
+ const void* extrafield_global,
282
+ uInt size_extrafield_global,
283
+ const char* comment,
284
+ int method,
285
+ int level,
286
+ int raw,
287
+ int windowBits,
288
+ int memLevel,
289
+ int strategy,
290
+ const char* password,
291
+ uLong crcForCrypting,
292
+ uLong versionMadeBy,
293
+ uLong flagBase);
294
+
295
+
296
+ extern int ZEXPORT zipOpenNewFileInZip4_64(zipFile file,
297
+ const char* filename,
298
+ const zip_fileinfo* zipfi,
299
+ const void* extrafield_local,
300
+ uInt size_extrafield_local,
301
+ const void* extrafield_global,
302
+ uInt size_extrafield_global,
303
+ const char* comment,
304
+ int method,
305
+ int level,
306
+ int raw,
307
+ int windowBits,
308
+ int memLevel,
309
+ int strategy,
310
+ const char* password,
311
+ uLong crcForCrypting,
312
+ uLong versionMadeBy,
313
+ uLong flagBase,
314
+ int zip64);
305
315
  /*
306
316
  Same than zipOpenNewFileInZip4, except
307
317
  versionMadeBy : value for Version made by field
@@ -309,25 +319,25 @@ extern int ZEXPORT zipOpenNewFileInZip4_64 OF((zipFile file,
309
319
  */
310
320
 
311
321
 
312
- extern int ZEXPORT zipWriteInFileInZip OF((zipFile file,
313
- const void* buf,
314
- unsigned len));
322
+ extern int ZEXPORT zipWriteInFileInZip(zipFile file,
323
+ const void* buf,
324
+ unsigned len);
315
325
  /*
316
326
  Write data in the zipfile
317
327
  */
318
328
 
319
- extern int ZEXPORT zipCloseFileInZip OF((zipFile file));
329
+ extern int ZEXPORT zipCloseFileInZip(zipFile file);
320
330
  /*
321
331
  Close the current file in the zipfile
322
332
  */
323
333
 
324
- extern int ZEXPORT zipCloseFileInZipRaw OF((zipFile file,
325
- uLong uncompressed_size,
326
- uLong crc32));
334
+ extern int ZEXPORT zipCloseFileInZipRaw(zipFile file,
335
+ uLong uncompressed_size,
336
+ uLong crc32);
327
337
 
328
- extern int ZEXPORT zipCloseFileInZipRaw64 OF((zipFile file,
329
- ZPOS64_T uncompressed_size,
330
- uLong crc32));
338
+ extern int ZEXPORT zipCloseFileInZipRaw64(zipFile file,
339
+ ZPOS64_T uncompressed_size,
340
+ uLong crc32);
331
341
 
332
342
  /*
333
343
  Close the current file in the zipfile, for file opened with
@@ -335,14 +345,14 @@ extern int ZEXPORT zipCloseFileInZipRaw64 OF((zipFile file,
335
345
  uncompressed_size and crc32 are value for the uncompressed size
336
346
  */
337
347
 
338
- extern int ZEXPORT zipClose OF((zipFile file,
339
- const char* global_comment));
348
+ extern int ZEXPORT zipClose(zipFile file,
349
+ const char* global_comment);
340
350
  /*
341
351
  Close the zipfile
342
352
  */
343
353
 
344
354
 
345
- extern int ZEXPORT zipRemoveExtraInfoBlock OF((char* pData, int* dataLen, short sHeader));
355
+ extern int ZEXPORT zipRemoveExtraInfoBlock(char* pData, int* dataLen, short sHeader);
346
356
  /*
347
357
  zipRemoveExtraInfoBlock - Added by Mathias Svensson
348
358
 
@@ -33,10 +33,10 @@ endif
33
33
  all: tmpfileplus.o tmpfileplus.so
34
34
 
35
35
  %.o : %.c
36
- $(Q)$(CC) -c $(CFLAGS) $<
36
+ $(Q)$(CC) -c $(CFLAGS) $(TARGET_ARCH) $<
37
37
 
38
38
  %.so : %.c
39
- $(Q)$(CC) $(FPIC) -c $(CFLAGS) $< -o $@
39
+ $(Q)$(CC) $(FPIC) -c $(CFLAGS) $(TARGET_ARCH) $< -o $@
40
40
 
41
41
  clean:
42
- $(Q)/bin/rm -f *.o *.so
42
+ $(Q)rm -f *.o *.so
@@ -1 +1 @@
1
- 2019-06-17 01:19:43 +0800 56b73bb
1
+ 2023-12-29 19:18:35 +0700 e3ede9d
@@ -16,4 +16,24 @@ describe "FastExcel text_width" do
16
16
 
17
17
  assert_equal(sheet.calculated_column_widths, {0 => 3.52, 1 => 5.28, 2 => 14.96, 3 => 44.88})
18
18
  end
19
+
20
+ it "should set the default column width for an empty column on close" do
21
+ workbook = FastExcel.open(constant_memory: false)
22
+ sheet = workbook.add_worksheet
23
+ sheet.auto_width = true
24
+
25
+ sheet.append_row([
26
+ nil,
27
+ "tini",
28
+ "Longer",
29
+ "Some longer text!",
30
+ "This gem is FFI binding for libxlsxwriter C library"
31
+ ])
32
+
33
+ assert_equal(sheet.calculated_column_widths, {0 => nil, 1 => 3.52, 2 => 5.28, 3 => 14.96, 4 => 44.88})
34
+
35
+ workbook.close
36
+
37
+ assert_equal(sheet.calculated_column_widths, {0 => FastExcel::DEF_COL_WIDTH, 1 => 3.52, 2 => 5.28, 3 => 14.96, 4 => 44.88})
38
+ end
19
39
  end
@@ -9,7 +9,7 @@ describe "FastExcel default_format" do
9
9
  bold: true
10
10
  })
11
11
 
12
- #FastExcel.print_ffi_obj(workbook.default_format)
12
+ # FastExcel.print_ffi_obj(workbook.default_format)
13
13
 
14
14
  assert_equal("ArialFoo", workbook.default_format.font_family)
15
15
  assert_equal(17, workbook.default_format.font_size)
@@ -11,7 +11,7 @@ describe "FastExcel validations" do
11
11
  end
12
12
 
13
13
  assert_equal(ArgumentError, error.class)
14
- assert_equal("Invalid worksheet name 'Payments Report': (16 - error_sheetname_already_used) Worksheet name is already in use.", error.message)
14
+ assert_equal("Invalid worksheet name 'Payments Report': (17 - error_sheetname_already_used) Worksheet name is already in use.", error.message)
15
15
  end
16
16
 
17
17
  it "should not raise error when worksheet name is null" do
@@ -33,7 +33,7 @@ describe "FastExcel validations" do
33
33
  end
34
34
 
35
35
  assert_equal(ArgumentError, error.class)
36
- assert_equal("Invalid worksheet name 'ABCDEFGHIJKLMNOPQRSTUVWXYZ012345': (13 - error_sheetname_length_exceeded) Worksheet name exceeds Excel's limit of 31 characters.", error.message)
36
+ assert_equal("Invalid worksheet name 'ABCDEFGHIJKLMNOPQRSTUVWXYZ012345': (14 - error_sheetname_length_exceeded) Worksheet name exceeds Excel's limit of 31 characters.", error.message)
37
37
  end
38
38
 
39
39
  it "should not raise error when the sheet name is at maximum length" do
@@ -53,6 +53,6 @@ describe "FastExcel validations" do
53
53
  end
54
54
 
55
55
  assert_equal(ArgumentError, error.class)
56
- assert_equal("Invalid worksheet name 'a?': (14 - error_invalid_sheetname_character) Worksheet name cannot contain invalid characters: '[ ] : * ? / \\'", error.message)
56
+ assert_equal("Invalid worksheet name 'a?': (15 - error_invalid_sheetname_character) Worksheet name cannot contain invalid characters: '[ ] : * ? / \\'", error.message)
57
57
  end
58
58
  end
@@ -96,8 +96,10 @@ describe "FastExcel::WorksheetExt append_row" do
96
96
  it "should map fields correctly" do
97
97
  workbook = FastExcel.open(constant_memory: true)
98
98
 
99
- ws = workbook.add_worksheet
99
+ ws = workbook.add_worksheet("1 should map fields correctly")
100
+
100
101
  ws.set_right_to_left
102
+
101
103
  assert_equal(ws[:right_to_left], 1)
102
104
 
103
105
  ws = workbook.add_worksheet
@@ -117,6 +119,7 @@ describe "FastExcel::WorksheetExt append_row" do
117
119
  assert_equal(ws[:margin_top], 3.5)
118
120
  assert_equal(ws[:margin_bottom], 4.5)
119
121
 
122
+ assert_equal(ws[:vbreaks_count], 0)
120
123
 
121
124
  breaks = [20, 40, 60, 20, 0]
122
125
  FFI::MemoryPointer.new(:uint16, breaks.size) do |buffer|
@@ -124,6 +127,8 @@ describe "FastExcel::WorksheetExt append_row" do
124
127
  ws.set_v_pagebreaks(buffer)
125
128
  end
126
129
 
130
+ # FastExcel.print_ffi_obj(ws)
131
+
127
132
  assert_equal(ws[:vbreaks_count], 4)
128
133
  end
129
134
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fast_excel
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.1
4
+ version: 0.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Pavel Evstigneev
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-01-12 00:00:00.000000000 Z
11
+ date: 2024-01-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: ffi
@@ -60,6 +60,7 @@ files:
60
60
  - examples/example_auto_width.rb
61
61
  - examples/example_chart.rb
62
62
  - examples/example_colors.rb
63
+ - examples/example_date_time.rb
63
64
  - examples/example_filters.rb
64
65
  - examples/example_formula.rb
65
66
  - examples/example_hyperlink.rb
@@ -77,15 +78,27 @@ files:
77
78
  - lib/fast_excel/binding/format.rb
78
79
  - lib/fast_excel/binding/workbook.rb
79
80
  - lib/fast_excel/binding/worksheet.rb
81
+ - libxlsxwriter/.github/FUNDING.yml
82
+ - libxlsxwriter/.github/ISSUE_TEMPLATE.md
83
+ - libxlsxwriter/.github/PULL_REQUEST_TEMPLATE.md
84
+ - libxlsxwriter/.github/workflows/cmake_actions.yml
85
+ - libxlsxwriter/.github/workflows/code_style.yml
86
+ - libxlsxwriter/.github/workflows/coverity.yml
87
+ - libxlsxwriter/.github/workflows/make_actions.yml
88
+ - libxlsxwriter/.github/workflows/valgrind.yml
89
+ - libxlsxwriter/.github/workflows/windows_build.yml
90
+ - libxlsxwriter/.github/workflows/zig_build.yml
80
91
  - libxlsxwriter/.gitignore
81
92
  - libxlsxwriter/.indent.pro
82
- - libxlsxwriter/.travis.yml
83
93
  - libxlsxwriter/CMakeLists.txt
84
94
  - libxlsxwriter/CONTRIBUTING.md
85
95
  - libxlsxwriter/Changes.txt
86
96
  - libxlsxwriter/LICENSE.txt
87
97
  - libxlsxwriter/Makefile
98
+ - libxlsxwriter/Package.swift
88
99
  - libxlsxwriter/Readme.md
100
+ - libxlsxwriter/build.zig
101
+ - libxlsxwriter/build.zig.zon
89
102
  - libxlsxwriter/cmake/FindMINIZIP.cmake
90
103
  - libxlsxwriter/cmake/FindPackage.cmake
91
104
  - libxlsxwriter/cmake/i686-toolchain.cmake
@@ -95,6 +108,7 @@ files:
95
108
  - libxlsxwriter/include/xlsxwriter/app.h
96
109
  - libxlsxwriter/include/xlsxwriter/chart.h
97
110
  - libxlsxwriter/include/xlsxwriter/chartsheet.h
111
+ - libxlsxwriter/include/xlsxwriter/comment.h
98
112
  - libxlsxwriter/include/xlsxwriter/common.h
99
113
  - libxlsxwriter/include/xlsxwriter/content_types.h
100
114
  - libxlsxwriter/include/xlsxwriter/core.h
@@ -102,17 +116,22 @@ files:
102
116
  - libxlsxwriter/include/xlsxwriter/drawing.h
103
117
  - libxlsxwriter/include/xlsxwriter/format.h
104
118
  - libxlsxwriter/include/xlsxwriter/hash_table.h
119
+ - libxlsxwriter/include/xlsxwriter/metadata.h
105
120
  - libxlsxwriter/include/xlsxwriter/packager.h
106
121
  - libxlsxwriter/include/xlsxwriter/relationships.h
107
122
  - libxlsxwriter/include/xlsxwriter/shared_strings.h
108
123
  - libxlsxwriter/include/xlsxwriter/styles.h
124
+ - libxlsxwriter/include/xlsxwriter/table.h
109
125
  - libxlsxwriter/include/xlsxwriter/theme.h
126
+ - libxlsxwriter/include/xlsxwriter/third_party/emyg_dtoa.h
110
127
  - libxlsxwriter/include/xlsxwriter/third_party/ioapi.h
128
+ - libxlsxwriter/include/xlsxwriter/third_party/md5.h
111
129
  - libxlsxwriter/include/xlsxwriter/third_party/queue.h
112
130
  - libxlsxwriter/include/xlsxwriter/third_party/tmpfileplus.h
113
131
  - libxlsxwriter/include/xlsxwriter/third_party/tree.h
114
132
  - libxlsxwriter/include/xlsxwriter/third_party/zip.h
115
133
  - libxlsxwriter/include/xlsxwriter/utility.h
134
+ - libxlsxwriter/include/xlsxwriter/vml.h
116
135
  - libxlsxwriter/include/xlsxwriter/workbook.h
117
136
  - libxlsxwriter/include/xlsxwriter/worksheet.h
118
137
  - libxlsxwriter/include/xlsxwriter/xmlwriter.h
@@ -122,21 +141,31 @@ files:
122
141
  - libxlsxwriter/src/app.c
123
142
  - libxlsxwriter/src/chart.c
124
143
  - libxlsxwriter/src/chartsheet.c
144
+ - libxlsxwriter/src/comment.c
125
145
  - libxlsxwriter/src/content_types.c
126
146
  - libxlsxwriter/src/core.c
127
147
  - libxlsxwriter/src/custom.c
128
148
  - libxlsxwriter/src/drawing.c
129
149
  - libxlsxwriter/src/format.c
130
150
  - libxlsxwriter/src/hash_table.c
151
+ - libxlsxwriter/src/metadata.c
131
152
  - libxlsxwriter/src/packager.c
132
153
  - libxlsxwriter/src/relationships.c
133
154
  - libxlsxwriter/src/shared_strings.c
134
155
  - libxlsxwriter/src/styles.c
156
+ - libxlsxwriter/src/table.c
135
157
  - libxlsxwriter/src/theme.c
136
158
  - libxlsxwriter/src/utility.c
159
+ - libxlsxwriter/src/vml.c
137
160
  - libxlsxwriter/src/workbook.c
138
161
  - libxlsxwriter/src/worksheet.c
139
162
  - libxlsxwriter/src/xmlwriter.c
163
+ - libxlsxwriter/third_party/dtoa/Makefile
164
+ - libxlsxwriter/third_party/dtoa/emyg_dtoa.c
165
+ - libxlsxwriter/third_party/dtoa/emyg_dtoa.h
166
+ - libxlsxwriter/third_party/md5/Makefile
167
+ - libxlsxwriter/third_party/md5/md5.c
168
+ - libxlsxwriter/third_party/md5/md5.h
140
169
  - libxlsxwriter/third_party/minizip/Makefile
141
170
  - libxlsxwriter/third_party/minizip/Makefile.am
142
171
  - libxlsxwriter/third_party/minizip/Makefile.orig
@@ -187,16 +216,13 @@ required_ruby_version: !ruby/object:Gem::Requirement
187
216
  - - ">="
188
217
  - !ruby/object:Gem::Version
189
218
  version: '2.0'
190
- - - "<"
191
- - !ruby/object:Gem::Version
192
- version: '4.0'
193
219
  required_rubygems_version: !ruby/object:Gem::Requirement
194
220
  requirements:
195
221
  - - ">="
196
222
  - !ruby/object:Gem::Version
197
223
  version: '0'
198
224
  requirements: []
199
- rubygems_version: 3.4.3
225
+ rubygems_version: 3.5.3
200
226
  signing_key:
201
227
  specification_version: 4
202
228
  summary: Ultra Fast Excel Writer