xlsxwriter 0.0.4 → 0.0.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (44) hide show
  1. checksums.yaml +5 -5
  2. data/ext/xlsxwriter/libxlsxwriter/License.txt +1 -1
  3. data/ext/xlsxwriter/libxlsxwriter/Makefile +1 -1
  4. data/ext/xlsxwriter/libxlsxwriter/include/xlsxwriter.h +2 -2
  5. data/ext/xlsxwriter/libxlsxwriter/include/xlsxwriter/app.h +1 -1
  6. data/ext/xlsxwriter/libxlsxwriter/include/xlsxwriter/chart.h +104 -4
  7. data/ext/xlsxwriter/libxlsxwriter/include/xlsxwriter/common.h +7 -2
  8. data/ext/xlsxwriter/libxlsxwriter/include/xlsxwriter/content_types.h +1 -1
  9. data/ext/xlsxwriter/libxlsxwriter/include/xlsxwriter/core.h +1 -1
  10. data/ext/xlsxwriter/libxlsxwriter/include/xlsxwriter/custom.h +1 -1
  11. data/ext/xlsxwriter/libxlsxwriter/include/xlsxwriter/drawing.h +1 -1
  12. data/ext/xlsxwriter/libxlsxwriter/include/xlsxwriter/format.h +1 -1
  13. data/ext/xlsxwriter/libxlsxwriter/include/xlsxwriter/hash_table.h +1 -1
  14. data/ext/xlsxwriter/libxlsxwriter/include/xlsxwriter/packager.h +1 -1
  15. data/ext/xlsxwriter/libxlsxwriter/include/xlsxwriter/relationships.h +1 -1
  16. data/ext/xlsxwriter/libxlsxwriter/include/xlsxwriter/shared_strings.h +1 -1
  17. data/ext/xlsxwriter/libxlsxwriter/include/xlsxwriter/styles.h +1 -1
  18. data/ext/xlsxwriter/libxlsxwriter/include/xlsxwriter/theme.h +1 -1
  19. data/ext/xlsxwriter/libxlsxwriter/include/xlsxwriter/utility.h +10 -5
  20. data/ext/xlsxwriter/libxlsxwriter/include/xlsxwriter/workbook.h +1 -1
  21. data/ext/xlsxwriter/libxlsxwriter/include/xlsxwriter/worksheet.h +136 -38
  22. data/ext/xlsxwriter/libxlsxwriter/include/xlsxwriter/xmlwriter.h +2 -2
  23. data/ext/xlsxwriter/libxlsxwriter/src/Makefile +11 -1
  24. data/ext/xlsxwriter/libxlsxwriter/src/app.c +1 -1
  25. data/ext/xlsxwriter/libxlsxwriter/src/chart.c +66 -10
  26. data/ext/xlsxwriter/libxlsxwriter/src/content_types.c +1 -1
  27. data/ext/xlsxwriter/libxlsxwriter/src/core.c +1 -1
  28. data/ext/xlsxwriter/libxlsxwriter/src/custom.c +2 -2
  29. data/ext/xlsxwriter/libxlsxwriter/src/drawing.c +1 -1
  30. data/ext/xlsxwriter/libxlsxwriter/src/format.c +1 -1
  31. data/ext/xlsxwriter/libxlsxwriter/src/hash_table.c +1 -1
  32. data/ext/xlsxwriter/libxlsxwriter/src/packager.c +4 -4
  33. data/ext/xlsxwriter/libxlsxwriter/src/relationships.c +1 -1
  34. data/ext/xlsxwriter/libxlsxwriter/src/shared_strings.c +1 -1
  35. data/ext/xlsxwriter/libxlsxwriter/src/styles.c +1 -1
  36. data/ext/xlsxwriter/libxlsxwriter/src/theme.c +1 -1
  37. data/ext/xlsxwriter/libxlsxwriter/src/utility.c +27 -1
  38. data/ext/xlsxwriter/libxlsxwriter/src/workbook.c +8 -6
  39. data/ext/xlsxwriter/libxlsxwriter/src/worksheet.c +143 -26
  40. data/ext/xlsxwriter/libxlsxwriter/src/xmlwriter.c +2 -2
  41. data/ext/xlsxwriter/worksheet.c +2 -0
  42. data/lib/xlsxwriter/version.rb +1 -1
  43. data/test/test-errors.rb +19 -0
  44. metadata +5 -3
@@ -3,7 +3,7 @@
3
3
  *
4
4
  * Used in conjunction with the libxlsxwriter library.
5
5
  *
6
- * Copyright 2014-2017, John McNamara, jmcnamara@cpan.org. See LICENSE.txt.
6
+ * Copyright 2014-2018, John McNamara, jmcnamara@cpan.org. See LICENSE.txt.
7
7
  *
8
8
  */
9
9
 
@@ -349,7 +349,7 @@ lxw_new_attribute_dbl(const char *key, double value)
349
349
  struct xml_attribute *attribute = malloc(sizeof(struct xml_attribute));
350
350
 
351
351
  LXW_ATTRIBUTE_COPY(attribute->key, key);
352
- lxw_snprintf(attribute->value, LXW_MAX_ATTRIBUTE_LENGTH, "%.16g", value);
352
+ lxw_sprintf_dbl(attribute->value, value);
353
353
 
354
354
  return attribute;
355
355
  }
@@ -67,6 +67,8 @@ worksheet_init(int argc, VALUE *argv, VALUE self) {
67
67
 
68
68
  Data_Get_Struct(argv[0], struct workbook, wb_ptr);
69
69
  ptr->worksheet = workbook_add_worksheet(wb_ptr->workbook, name);
70
+ if (!ptr->worksheet)
71
+ rb_raise(rb_eRuntimeError, "worksheet was not created");
70
72
  return self;
71
73
  }
72
74
 
@@ -1,4 +1,4 @@
1
1
  module XlsxWriter
2
2
  # :nodoc:
3
- VERSION='0.0.4'.freeze
3
+ VERSION='0.0.5'.freeze
4
4
  end
@@ -0,0 +1,19 @@
1
+ require 'test/unit'
2
+
3
+ class TestErrors < Test::Unit::TestCase
4
+ def test_long_sheet_name
5
+ file_path = 'tmp/error_long_sheet_name.xlsx'
6
+ was_in_block = false
7
+ XlsxWriter::Workbook.open(file_path) do |wb|
8
+ assert_raise(RuntimeError.new('worksheet was not created')) do
9
+ wb.add_worksheet('a' * 32) do |ws|
10
+ was_in_block = true
11
+ ws.add_row(['test'])
12
+ end
13
+ end
14
+ end
15
+ assert_equal(was_in_block, false)
16
+ ensure
17
+ File.delete file_path if file_path && File.exist?(file_path)
18
+ end
19
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: xlsxwriter
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nick H
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-10-23 00:00:00.000000000 Z
11
+ date: 2018-06-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake-compiler
@@ -153,6 +153,7 @@ files:
153
153
  - test/test-data.rb
154
154
  - test/test-default-row.rb
155
155
  - test/test-defined-name.rb
156
+ - test/test-errors.rb
156
157
  - test/test-escapes.rb
157
158
  - test/test-fit-to-pages.rb
158
159
  - test/test-formatting.rb
@@ -197,7 +198,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
197
198
  version: '0'
198
199
  requirements: []
199
200
  rubyforge_project:
200
- rubygems_version: 2.6.14
201
+ rubygems_version: 2.7.7
201
202
  signing_key:
202
203
  specification_version: 4
203
204
  summary: Ruby interface to libxlsxwriter
@@ -213,6 +214,7 @@ test_files:
213
214
  - test/test-set-selection.rb
214
215
  - test/test-chart-area.rb
215
216
  - test/run-test.rb
217
+ - test/test-errors.rb
216
218
  - test/test-chart-column.rb
217
219
  - test/test-types.rb
218
220
  - test/test-set-start-page.rb