write_xlsx 0.81.0 → 0.81.1

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/.gitignore +1 -0
  3. data/Changes +3 -0
  4. data/README.md +1 -1
  5. data/examples/a_simple.rb +0 -1
  6. data/examples/add_vba_project.rb +0 -1
  7. data/examples/array_formula.rb +0 -1
  8. data/examples/autofilter.rb +0 -1
  9. data/examples/chart_area.rb +0 -1
  10. data/examples/chart_bar.rb +0 -1
  11. data/examples/chart_data_table.rb +0 -1
  12. data/examples/chart_data_tools.rb +0 -1
  13. data/examples/chart_doughnut.rb +0 -1
  14. data/examples/chart_line.rb +0 -1
  15. data/examples/chart_pie.rb +0 -1
  16. data/examples/chart_radar.rb +0 -1
  17. data/examples/chart_scatter.rb +0 -1
  18. data/examples/chart_secondary_axis.rb +0 -1
  19. data/examples/chart_stock.rb +0 -1
  20. data/examples/colors.rb +0 -1
  21. data/examples/comments1.rb +0 -1
  22. data/examples/comments2.rb +0 -1
  23. data/examples/conditional_format.rb +0 -1
  24. data/examples/data_validate.rb +0 -1
  25. data/examples/date_time.rb +0 -1
  26. data/examples/defined_name.rb +0 -1
  27. data/examples/demo.rb +0 -1
  28. data/examples/diag_border.rb +0 -1
  29. data/examples/formats.rb +0 -1
  30. data/examples/headers.rb +0 -1
  31. data/examples/hide_row_col.rb +0 -1
  32. data/examples/hide_sheet.rb +0 -1
  33. data/examples/hyperlink1.rb +0 -1
  34. data/examples/indent.rb +0 -1
  35. data/examples/macros.rb +0 -1
  36. data/examples/merge1.rb +0 -1
  37. data/examples/merge2.rb +0 -1
  38. data/examples/merge3.rb +0 -1
  39. data/examples/merge4.rb +0 -1
  40. data/examples/merge5.rb +0 -1
  41. data/examples/merge6.rb +0 -1
  42. data/examples/outline.rb +0 -1
  43. data/examples/outline_collapsed.rb +0 -1
  44. data/examples/panes.rb +0 -1
  45. data/examples/properties.rb +0 -1
  46. data/examples/protection.rb +0 -1
  47. data/examples/regions.rb +0 -1
  48. data/examples/rich_strings.rb +0 -1
  49. data/examples/right_to_left.rb +0 -1
  50. data/examples/shape1.rb +0 -1
  51. data/examples/shape2.rb +0 -1
  52. data/examples/shape3.rb +0 -1
  53. data/examples/shape4.rb +0 -1
  54. data/examples/shape5.rb +0 -1
  55. data/examples/shape6.rb +0 -1
  56. data/examples/shape7.rb +0 -1
  57. data/examples/shape8.rb +0 -1
  58. data/examples/sparklines1.rb +0 -1
  59. data/examples/sparklines2.rb +0 -1
  60. data/examples/stats.rb +0 -1
  61. data/examples/stats_ext.rb +0 -1
  62. data/examples/stocks.rb +0 -1
  63. data/examples/tab_colors.rb +0 -1
  64. data/examples/tables.rb +0 -1
  65. data/lib/write_xlsx.rb +0 -1
  66. data/lib/write_xlsx/chart.rb +32 -5
  67. data/lib/write_xlsx/version.rb +1 -5
  68. data/test/helper.rb +1 -2
  69. data/test/regression/test_chart_gap04.rb +54 -0
  70. data/test/regression/test_chart_gap05.rb +56 -0
  71. data/test/regression/xlsx_files/chart_gap04.xlsx +0 -0
  72. data/test/regression/xlsx_files/chart_gap05.xlsx +0 -0
  73. data/write_xlsx.gemspec +3 -1
  74. metadata +27 -4
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 2393c3aa40869f02381b920ea72227502bd095a6
4
- data.tar.gz: f6e538f97000ba15bd3507db94117a9cca492459
3
+ metadata.gz: a47873b65edc4837593147baf4b03c8b7a0aca4c
4
+ data.tar.gz: 3b18363eaa6f1f1ac48a15c28dd39285202369bf
5
5
  SHA512:
6
- metadata.gz: ec5a9d30c96b3bd5043b8ee50773cca2b183869d0b9cb3c7a83fbed670baee1970ecdedcc1681d316cd3846515c9b376d2886ff5c95be318d04ad94f72ec1f27
7
- data.tar.gz: faac0dcd09879f013e237a9333bbd4a109e1bcbe6c6eb03cc0d9765c9bde376ad2f907ee850b52f51f9df35625fa3ce3cc3c94d9529fb57b3a2273b4c294e393
6
+ metadata.gz: 30ff5c82ce5ede263bee14816a0b52463f60a5336641176dc6bca5669d244996790abbac68491ff1a028b11fa1466a87d86de3ef355e82307832b93cc5cddb5f
7
+ data.tar.gz: 48d97134f94f572573f1981da0c900a4ce1ac8dea0cf7cba35ccacdd8b27b30e06f61a3b86dae90f54b16999b0014bfa50505a36579ffa7a754099fa3f22e660
data/.gitignore CHANGED
@@ -1,3 +1,4 @@
1
+ TAGS
1
2
  *.gem
2
3
  .bundle
3
4
  .config
data/Changes CHANGED
@@ -1,4 +1,7 @@
1
1
  Change history of write_xlsx rubygem.
2
+ 2014-12-28 v0.81.1
3
+ use test-unit gem instead of test/unit.
4
+
2
5
  2014-12-04 v0.81.0
3
6
  Add chart axis line and fill properties.
4
7
 
data/README.md CHANGED
@@ -4,7 +4,7 @@
4
4
 
5
5
  gem to create a new file in the Excel 2007+ XLSX format, and you can use the
6
6
  same interface as writeexcel gem. write_xlsx is converted from Perl's module
7
- [Excel::Writer::XLSX-0.80](https://github.com/jmcnamara/excel-writer-xlsx) .
7
+ [Excel::Writer::XLSX-0.81](https://github.com/jmcnamara/excel-writer-xlsx) .
8
8
 
9
9
  ## Description
10
10
 
data/examples/a_simple.rb CHANGED
@@ -10,7 +10,6 @@
10
10
  # convert to ruby by Hideo NAKAMURA, cxn03651@msj.biglobe.ne.jp
11
11
  #
12
12
 
13
- require 'rubygems'
14
13
  require 'write_xlsx'
15
14
 
16
15
  # Create a new workbook called simple.xls and add a worksheet
@@ -13,7 +13,6 @@
13
13
  # convert to ruby by Hideo NAKAMURA, cxn03651@msj.biglobe.ne.jp
14
14
  #
15
15
 
16
- require 'rubygems'
17
16
  require 'write_xlsx'
18
17
 
19
18
  # Note the file extension should be .xlsm.
@@ -10,7 +10,6 @@
10
10
  # convert to ruby by Hideo NAKAMURA, cxn03651@msj.biglobe.ne.jp
11
11
  #
12
12
 
13
- require 'rubygems'
14
13
  require 'write_xlsx'
15
14
 
16
15
  # Create a new workbook and add a worksheet
@@ -12,7 +12,6 @@
12
12
  # reverse('ゥ'), September 2007, John McNamara, jmcnamara@cpan.org
13
13
  #
14
14
 
15
- require 'rubygems'
16
15
  require 'write_xlsx'
17
16
 
18
17
  workbook = WriteXLSX.new( 'autofilter.xlsx' )
@@ -9,7 +9,6 @@
9
9
  # convert to ruby by Hideo NAKAMURA, cxn03651@msj.biglobe.ne.jp
10
10
  #
11
11
 
12
- require 'rubygems'
13
12
  require 'write_xlsx'
14
13
 
15
14
  workbook = WriteXLSX.new('chart_area.xlsx')
@@ -9,7 +9,6 @@
9
9
  # convert to ruby by Hideo NAKAMURA, cxn03651@msj.biglobe.ne.jp
10
10
  #
11
11
 
12
- require 'rubygems'
13
12
  require 'write_xlsx'
14
13
 
15
14
  workbook = WriteXLSX.new('chart_bar.xlsx')
@@ -10,7 +10,6 @@
10
10
  # convert to ruby by Hideo NAKAMURA, cxn03651@msj.biglobe.ne.jp
11
11
  #
12
12
 
13
- require 'rubygems'
14
13
  require 'write_xlsx'
15
14
 
16
15
  workbook = WriteXLSX.new('chart_data_table.xlsx')
@@ -13,7 +13,6 @@
13
13
  # convert to ruby by Hideo NAKAMURA, cxn03651@msj.biglobe.ne.jp
14
14
  #
15
15
 
16
- require 'rubygems'
17
16
  require 'write_xlsx'
18
17
 
19
18
  # Create a new workbook called simple.xls and add a worksheet
@@ -15,7 +15,6 @@
15
15
  # convert to ruby by Hideo NAKAMURA, cxn03651@msj.biglobe.ne.jp
16
16
  #
17
17
 
18
- require 'rubygems'
19
18
  require 'write_xlsx'
20
19
 
21
20
  workbook = WriteXLSX.new('chart_doughnut.xlsx')
@@ -9,7 +9,6 @@
9
9
  # convert to ruby by Hideo NAKAMURA, cxn03651@msj.biglobe.ne.jp
10
10
  #
11
11
 
12
- require 'rubygems'
13
12
  require 'write_xlsx'
14
13
 
15
14
  workbook = WriteXLSX.new('chart_line.xlsx')
@@ -15,7 +15,6 @@
15
15
  # convert to ruby by Hideo NAKAMURA, cxn03651@msj.biglobe.ne.jp
16
16
  #
17
17
 
18
- require 'rubygems'
19
18
  require 'write_xlsx'
20
19
 
21
20
  workbook = WriteXLSX.new('chart_pie.xlsx')
@@ -9,7 +9,6 @@
9
9
  # convert to ruby by Hideo NAKAMURA, cxn03651@msj.biglobe.ne.jp
10
10
  #
11
11
 
12
- require 'rubygems'
13
12
  require 'write_xlsx'
14
13
 
15
14
  workbook = WriteXLSX.new('chart_radar.xlsx')
@@ -9,7 +9,6 @@
9
9
  # convert to ruby by Hideo NAKAMURA, cxn03651@msj.biglobe.ne.jp
10
10
  #
11
11
 
12
- require 'rubygems'
13
12
  require 'write_xlsx'
14
13
 
15
14
  workbook = WriteXLSX.new('chart_scatter.xlsx')
@@ -9,7 +9,6 @@
9
9
  # convert to ruby by Hideo NAKAMURA, cxn03651@msj.biglobe.ne.jp
10
10
  #
11
11
 
12
- require 'rubygems'
13
12
  require 'write_xlsx'
14
13
 
15
14
  workbook = WriteXLSX.new('chart_secondary_axis.xlsx')
@@ -9,7 +9,6 @@
9
9
  # convert to ruby by Hideo NAKAMURA, cxn03651@msj.biglobe.ne.jp
10
10
  #
11
11
 
12
- require 'rubygems'
13
12
  require 'write_xlsx'
14
13
 
15
14
  workbook = WriteXLSX.new('chart_stock.xlsx')
data/examples/colors.rb CHANGED
@@ -15,7 +15,6 @@
15
15
  # converted to Ruby by Hideo Nakamura, cxn03651@msj.biglobe.ne.jp
16
16
  #
17
17
 
18
- require 'rubygems'
19
18
  require 'write_xlsx'
20
19
 
21
20
  workbook = WriteXLSX.new("colors.xlsx")
@@ -1,6 +1,5 @@
1
1
  #!/usr/bin/env ruby
2
2
  # -*- coding: utf-8 -*-
3
- require 'rubygems'
4
3
  require 'write_xlsx'
5
4
 
6
5
  workbook = WriteXLSX.new('comments1.xlsx')
@@ -1,6 +1,5 @@
1
1
  #!/usr/bin/env ruby
2
2
  # -*- coding: utf-8 -*-
3
- require 'rubygems'
4
3
  require 'write_xlsx'
5
4
 
6
5
  workbook = WriteXLSX.new('comments2.xlsx')
@@ -1,7 +1,6 @@
1
1
  #!/usr/bin/env ruby
2
2
  # -*- coding: utf-8 -*-
3
3
 
4
- require 'rubygems'
5
4
  require 'write_xlsx'
6
5
 
7
6
  workbook = WriteXLSX.new('conditional_format.xlsx')
@@ -12,7 +12,6 @@
12
12
  # converted to Ruby by Hideo Nakamura, cxn03651@msj.biglobe.ne.jp
13
13
  #
14
14
 
15
- require 'rubygems'
16
15
  require 'write_xlsx'
17
16
 
18
17
  workbook = WriteXLSX.new('data_validate.xlsx')
@@ -10,7 +10,6 @@
10
10
  # convert to ruby by Hideo NAKAMURA, cxn03651@msj.biglobe.ne.jp
11
11
  #
12
12
 
13
- require 'rubygems'
14
13
  require 'write_xlsx'
15
14
 
16
15
  workbook = WriteXLSX.new('date_time.xlsx')
@@ -1,7 +1,6 @@
1
1
  #!/usr/bin/env ruby
2
2
  # -*- coding: utf-8 -*-
3
3
 
4
- require 'rubygems'
5
4
  require 'write_xlsx'
6
5
 
7
6
  workbook = WriteXLSX.new('defined_name.xlsx')
data/examples/demo.rb CHANGED
@@ -1,7 +1,6 @@
1
1
  #!/usr/bin/env ruby
2
2
  # -*- coding: utf-8 -*-
3
3
 
4
- require 'rubygems'
5
4
  require 'write_xlsx'
6
5
 
7
6
  workbook = WriteXLSX.new('demo.xlsx')
@@ -1,7 +1,6 @@
1
1
  #!/usr/bin/env ruby
2
2
  # -*- coding: utf-8 -*-
3
3
 
4
- require 'rubygems'
5
4
  require 'write_xlsx'
6
5
 
7
6
  workbook = WriteXLSX.new('diag_border.xlsx')
data/examples/formats.rb CHANGED
@@ -13,7 +13,6 @@
13
13
  # convert to Ruby by Hideo NAKAMURA, cxn03651@msj.biglobe.ne.jp
14
14
  #
15
15
 
16
- require 'rubygems'
17
16
  require 'write_xlsx'
18
17
 
19
18
  workbook = WriteXLSX.new('formats.xlsx')
data/examples/headers.rb CHANGED
@@ -37,7 +37,6 @@
37
37
  #
38
38
  # converted to ruby by Hideo Nakamura, cxn03651@msj.biglobe.ne.jp
39
39
 
40
- require 'rubygems'
41
40
  require 'write_xlsx'
42
41
 
43
42
  workbook = WriteXLSX.new('headers.xlsx')
@@ -11,7 +11,6 @@
11
11
  # convert to ruby by Hideo NAKAMURA, cxn03651@msj.biglobe.ne.jp
12
12
  #
13
13
 
14
- require 'rubygems'
15
14
  require 'write_xlsx'
16
15
 
17
16
  workbook = WriteXLSX.new('hide_row_col.xlsx')
@@ -8,7 +8,6 @@
8
8
  # reverse('c'), April 2005, John McNamara, jmcnamara@cpan.org
9
9
  # convert to ruby by Hideo, Nakamura, cxn03651@msj.biglobe.ne.jp
10
10
  #
11
- require 'rubygems'
12
11
  require 'write_xlsx'
13
12
 
14
13
  workbook = WriteXLSX.new('hide_sheet.xlsx')
@@ -11,7 +11,6 @@
11
11
  # convert to ruby by Hideo NAKAMURA, cxn03651@msj.biglobe.ne.jp
12
12
  #
13
13
 
14
- require 'rubygems'
15
14
  require 'write_xlsx'
16
15
 
17
16
  # Create a new workbook and add a worksheet
data/examples/indent.rb CHANGED
@@ -11,7 +11,6 @@
11
11
  # convert to ruby by Hideo NAKAMURA, cxn03651@msj.biglobe.ne.jp
12
12
  #
13
13
 
14
- require 'rubygems'
15
14
  require 'write_xlsx'
16
15
 
17
16
  workbook = WriteXLSX.new('indent.xlsx')
data/examples/macros.rb CHANGED
@@ -15,7 +15,6 @@
15
15
  # convert to ruby by Hideo NAKAMURA, cxn03651@msj.biglobe.ne.jp
16
16
  #
17
17
 
18
- require 'rubygems'
19
18
  require 'write_xlsx'
20
19
 
21
20
  # Note the file extension should be .xlsm.
data/examples/merge1.rb CHANGED
@@ -13,7 +13,6 @@
13
13
  # reverse(c), August 2002, John McNamara, jmcnamara@cpan.org
14
14
  # convert to ruby by Hideo NAKAMURA, cxn03651@msj.biglobe.ne.jp
15
15
  #
16
- require 'rubygems'
17
16
  require 'write_xlsx'
18
17
 
19
18
  # Create a new workbook and add a worksheet
data/examples/merge2.rb CHANGED
@@ -14,7 +14,6 @@
14
14
  # convert to ruby by Hideo NAKAMURA, cxn03651@msj.biglobe.ne.jp
15
15
  #
16
16
 
17
- require 'rubygems'
18
17
  require 'write_xlsx'
19
18
 
20
19
  # Create a new workbook and add a worksheet
data/examples/merge3.rb CHANGED
@@ -10,7 +10,6 @@
10
10
  # convert to ruby by Hideo NAKAMURA, cxn03651@msj.biglobe.ne.jp
11
11
  #
12
12
 
13
- require 'rubygems'
14
13
  require 'write_xlsx'
15
14
 
16
15
  # Create a new workbook and add a worksheet
data/examples/merge4.rb CHANGED
@@ -10,7 +10,6 @@
10
10
  # convert to ruby by Hideo NAKAMURA, cxn03651@msj.biglobe.ne.jp
11
11
  #
12
12
 
13
- require 'rubygems'
14
13
  require 'write_xlsx'
15
14
 
16
15
  # Create a new workbook and add a worksheet
data/examples/merge5.rb CHANGED
@@ -11,7 +11,6 @@
11
11
  # convert to ruby by Hideo NAKAMURA, cxn03651@msj.biglobe.ne.jp
12
12
  #
13
13
 
14
- require 'rubygems'
15
14
  require 'write_xlsx'
16
15
 
17
16
  # Create a new workbook and add a worksheet
data/examples/merge6.rb CHANGED
@@ -10,7 +10,6 @@
10
10
  # convert to ruby by Hideo NAKAMURA, cxn03651@msj.biglobe.ne.jp
11
11
  #
12
12
 
13
- require 'rubygems'
14
13
  require 'write_xlsx'
15
14
 
16
15
  # Create a new workbook and add a worksheet
data/examples/outline.rb CHANGED
@@ -64,7 +64,6 @@
64
64
  # convert to ruby by Hideo NAKAMURA, cxn03651@msj.biglobe.ne.jp
65
65
  #
66
66
 
67
- require 'rubygems'
68
67
  require 'write_xlsx'
69
68
 
70
69
  # Create a new workbook and add some worksheets
@@ -12,7 +12,6 @@
12
12
  # convert to ruby by Hideo NAKAMURA, cxn03651@msj.biglobe.ne.jp
13
13
  #
14
14
 
15
- require 'rubygems'
16
15
  require 'write_xlsx'
17
16
 
18
17
  # Create a new workbook and add some worksheets
data/examples/panes.rb CHANGED
@@ -9,7 +9,6 @@
9
9
  # convert to ruby by Hideo NAKAMURA, cxn03651@msj.biglobe.ne.jp
10
10
  #
11
11
 
12
- require 'rubygems'
13
12
  require 'write_xlsx'
14
13
 
15
14
  # Create a new workbook called simple.xls and add a worksheet
@@ -9,7 +9,6 @@
9
9
  # convert to ruby by Hideo NAKAMURA, cxn03651@msj.biglobe.ne.jp
10
10
  #
11
11
 
12
- require 'rubygems'
13
12
  require 'write_xlsx'
14
13
 
15
14
  workbook = WriteXLSX.new('properties.xlsx')
@@ -1,7 +1,6 @@
1
1
  #!/usr/bin/env ruby
2
2
  # -*- coding: utf-8 -*-
3
3
 
4
- require 'rubygems'
5
4
  require 'write_xlsx'
6
5
 
7
6
  workbook = WriteXLSX.new('protection.xlsx')
data/examples/regions.rb CHANGED
@@ -10,7 +10,6 @@
10
10
  # convert to ruby by Hideo NAKAMURA, cxn03651@msj.biglobe.ne.jp
11
11
  #
12
12
 
13
- require 'rubygems'
14
13
  require 'write_xlsx'
15
14
 
16
15
  workbook = WriteXLSX.new('regions.xlsx')
@@ -10,7 +10,6 @@
10
10
  # convert to ruby by Hideo NAKAMURA, cxn03651@msj.biglobe.ne.jp
11
11
  #
12
12
 
13
- require 'rubygems'
14
13
  require 'write_xlsx'
15
14
 
16
15
  workbook = WriteXLSX.new('rich_strings.xlsx')
@@ -10,7 +10,6 @@
10
10
  # convert to ruby by Hideo NAKAMURA, cxn03651@msj.biglobe.ne.jp
11
11
  #
12
12
 
13
- require 'rubygems'
14
13
  require 'write_xlsx'
15
14
 
16
15
  workbook = WriteXLSX.new('right_to_left.xlsx')
data/examples/shape1.rb CHANGED
@@ -10,7 +10,6 @@
10
10
  # converted to Ruby by Hideo NAKAMURA, cxn03651@msj.biglobe.ne.jp
11
11
  #
12
12
 
13
- require 'rubygems'
14
13
  require 'write_xlsx'
15
14
 
16
15
  workbook = WriteXLSX.new('shape1.xlsx')
data/examples/shape2.rb CHANGED
@@ -10,7 +10,6 @@
10
10
  # converted to Ruby by Hideo NAKAMURA, cxn03651@msj.biglobe.ne.jp
11
11
  #
12
12
 
13
- require 'rubygems'
14
13
  require 'write_xlsx'
15
14
 
16
15
  workbook = WriteXLSX.new('shape2.xlsx')
data/examples/shape3.rb CHANGED
@@ -10,7 +10,6 @@
10
10
  # converted to Ruby by Hideo NAKAMURA, cxn03651@msj.biglobe.ne.jp
11
11
  #
12
12
 
13
- require 'rubygems'
14
13
  require 'write_xlsx'
15
14
 
16
15
  workbook = WriteXLSX.new('shape3.xlsx')
data/examples/shape4.rb CHANGED
@@ -10,7 +10,6 @@
10
10
  # converted to Ruby by Hideo NAKAMURA, cxn03651@msj.biglobe.ne.jp
11
11
  #
12
12
 
13
- require 'rubygems'
14
13
  require 'write_xlsx'
15
14
 
16
15
  workbook = WriteXLSX.new('shape4.xlsx')
data/examples/shape5.rb CHANGED
@@ -10,7 +10,6 @@
10
10
  # converted to Ruby by Hideo NAKAMURA, cxn03651@msj.biglobe.ne.jp
11
11
  #
12
12
 
13
- require 'rubygems'
14
13
  require 'write_xlsx'
15
14
 
16
15
  workbook = WriteXLSX.new('shape5.xlsx')
data/examples/shape6.rb CHANGED
@@ -10,7 +10,6 @@
10
10
  # converted to Ruby by Hideo NAKAMURA, cxn03651@msj.biglobe.ne.jp
11
11
  #
12
12
 
13
- require 'rubygems'
14
13
  require 'write_xlsx'
15
14
 
16
15
  workbook = WriteXLSX.new('shape6.xlsx')
data/examples/shape7.rb CHANGED
@@ -10,7 +10,6 @@
10
10
  # converted to Ruby by Hideo NAKAMURA, cxn03651@msj.biglobe.ne.jp
11
11
  #
12
12
 
13
- require 'rubygems'
14
13
  require 'write_xlsx'
15
14
 
16
15
  workbook = WriteXLSX.new('shape7.xlsx')
data/examples/shape8.rb CHANGED
@@ -10,7 +10,6 @@
10
10
  # converted to Ruby by Hideo NAKAMURA, cxn03651@msj.biglobe.ne.jp
11
11
  #
12
12
 
13
- require 'rubygems'
14
13
  require 'write_xlsx'
15
14
 
16
15
  workbook = WriteXLSX.new('shape8.xlsx')
@@ -13,7 +13,6 @@
13
13
  # convert to ruby by Hideo NAKAMURA, cxn03651@msj.biglobe.ne.jp
14
14
  #
15
15
 
16
- require 'rubygems'
17
16
  require 'write_xlsx'
18
17
 
19
18
  workbook = WriteXLSX.new('sparklines1.xlsx')
@@ -13,7 +13,6 @@
13
13
  # convert to ruby by Hideo NAKAMURA, cxn03651@msj.biglobe.ne.jp
14
14
  #
15
15
 
16
- require 'rubygems'
17
16
  require 'write_xlsx'
18
17
 
19
18
  workbook = WriteXLSX.new('sparklines2.xlsx')
data/examples/stats.rb CHANGED
@@ -9,7 +9,6 @@
9
9
  # convert to ruby by Hideo NAKAMURA, cxn03651@msj.biglobe.ne.jp
10
10
  #
11
11
 
12
- require 'rubygems'
13
12
  require 'write_xlsx'
14
13
 
15
14
  # Create a new workbook and add a worksheet
@@ -12,7 +12,6 @@
12
12
  # convert to ruby by Hideo NAKAMURA, cxn03651@msj.biglobe.ne.jp
13
13
  #
14
14
 
15
- require 'rubygems'
16
15
  require 'write_xlsx'
17
16
 
18
17
  # Create a new workbook and add a worksheet
data/examples/stocks.rb CHANGED
@@ -12,7 +12,6 @@
12
12
  # convert to ruby by Hideo NAKAMURA, cxn03651@msj.biglobe.ne.jp
13
13
  #
14
14
 
15
- require 'rubygems'
16
15
  require 'write_xlsx'
17
16
 
18
17
  # Create a new workbook called simple.xls and add a worksheet
@@ -8,7 +8,6 @@
8
8
  # convert to ruby by Hideo NAKAMURA, cxn03651@msj.biglobe.ne.jp
9
9
  #
10
10
 
11
- require 'rubygems'
12
11
  require 'write_xlsx'
13
12
 
14
13
  workbook = Excel::Writer::XLSX.new('tab_colors.xlsx')
data/examples/tables.rb CHANGED
@@ -12,7 +12,6 @@
12
12
  # convert to ruby by Hideo NAKAMURA, cxn03651@msj.biglobe.ne.jp
13
13
  #
14
14
 
15
- require 'rubygems'
16
15
  require 'write_xlsx'
17
16
 
18
17
  # Create a new workbook called simple.xls and add a worksheet
data/lib/write_xlsx.rb CHANGED
@@ -34,7 +34,6 @@
34
34
  # To write a string, a formatted string, a number and a formula to the
35
35
  # first worksheet in an Excel XMLX spreadsheet called ruby.xlsx:
36
36
  #
37
- # require 'rubygems'
38
37
  # require 'write_xlsx'
39
38
  #
40
39
  # # Create a new Excel workbook
@@ -241,9 +241,27 @@ def add_series(params)
241
241
 
242
242
  @series << Series.new(self, params)
243
243
 
244
+ # Set the secondary axis properties.
245
+ x2_axis = params[:x2_axis]
246
+ y2_axis = params[:y2_axis]
247
+
244
248
  # Set the gap and overlap for Bar/Column charts.
245
- @series_gap = params[:gap] if params[:gap]
246
- @series_overlap = params[:overlap] if params[:overlap]
249
+ if params[:gap]
250
+ if ptrue?(y2_axis)
251
+ @series_gap_2 = params[:gap]
252
+ else
253
+ @series_gap_1 = params[:gap]
254
+ end
255
+ end
256
+
257
+ # Set the overlap for Bar/Column charts.
258
+ if params[:overlap]
259
+ if ptrue?(y2_axis)
260
+ @series_overlap_2 = params[:overlap]
261
+ else
262
+ @series_overlap_1 = params[:overlap]
263
+ end
264
+ end
247
265
  end
248
266
 
249
267
  #
@@ -428,7 +446,7 @@ def write_bar_chart(params) # :nodoc:
428
446
 
429
447
  # Set a default overlap for stacked charts.
430
448
  if @subtype =~ /stacked/
431
- @series_overlap = 100 unless @series_overlap
449
+ @series_overlap_1 = 100 unless @series_overlap_1
432
450
  end
433
451
 
434
452
  @writer.tag_elements('c:barChart') do
@@ -442,8 +460,17 @@ def write_bar_chart(params) # :nodoc:
442
460
  # write the c:marker element.
443
461
  write_marker_value
444
462
 
445
- # Write the c:gapWidth element.
446
- write_gap_width(@series_gap)
463
+ if ptrue?(params[:primary_axes])
464
+ # Write the c:gapWidth element.
465
+ write_gap_width(@series_gap_1)
466
+ # Write the c:overlap element.
467
+ write_overlap(@series_overlap_1)
468
+ else
469
+ # Write the c:gapWidth element.
470
+ write_gap_width(@series_gap_2)
471
+ # Write the c:overlap element.
472
+ write_overlap(@series_overlap_2)
473
+ end
447
474
 
448
475
  # write the c:overlap element.
449
476
  write_overlap(@series_overlap)
@@ -1,5 +1 @@
1
- require 'write_xlsx/workbook'
2
-
3
- class WriteXLSX < Writexlsx::Workbook
4
- VERSION = "0.81.0"
5
- end
1
+ WriteXLSX_VERSION = "0.81.1"
data/test/helper.rb CHANGED
@@ -1,5 +1,4 @@
1
1
  # -*- coding: utf-8 -*-
2
- require 'rubygems'
3
2
  require 'bundler'
4
3
 
5
4
  begin
@@ -9,7 +8,7 @@
9
8
  $stderr.puts "Run `bundle install` to install missing gems"
10
9
  exit e.status_code
11
10
  end
12
- require 'test/unit'
11
+ require 'test-unit'
13
12
 
14
13
  $LOAD_PATH.unshift(File.dirname(__FILE__))
15
14
  $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
@@ -0,0 +1,54 @@
1
+ # -*- coding: utf-8 -*-
2
+ require 'helper'
3
+
4
+ class TestRegressionChartGap04 < Test::Unit::TestCase
5
+ def setup
6
+ setup_dir_var
7
+ end
8
+
9
+ def teardown
10
+ File.delete(@xlsx) if File.exist?(@xlsx)
11
+ end
12
+
13
+ def test_chart_gap04
14
+ @xlsx = 'chart_gap04.xlsx'
15
+ workbook = WriteXLSX.new(@xlsx)
16
+ worksheet = workbook.add_worksheet
17
+ chart = workbook.add_chart(:type => 'column', :embedded => 1)
18
+
19
+ # For testing, copy the randomly generated axis ids in the target xlsx file.
20
+ chart.instance_variable_set(:@axis_ids, [45938176, 59715584])
21
+ chart.instance_variable_set(:@axis2_ids, [62526208, 59718272])
22
+
23
+ data = [
24
+ [1, 2, 3, 4, 5],
25
+ [6, 8, 6, 4, 2]
26
+ ]
27
+
28
+ worksheet.write('A1', data)
29
+
30
+ chart.add_series(
31
+ :values => '=Sheet1!$A$1:$A$5',
32
+ :gap => 51,
33
+ :overlap => 12
34
+ )
35
+
36
+ chart.add_series(
37
+ :values => '=Sheet1!$B$1:$B$5',
38
+ :y2_axis => 1,
39
+ :gap => 251,
40
+ :overlap => -27
41
+ )
42
+
43
+ worksheet.insert_chart('E9', chart)
44
+
45
+ workbook.close
46
+ compare_xlsx_for_regression(File.join(@regression_output, @xlsx), @xlsx,
47
+ [],
48
+ {
49
+ 'xl/charts/chart1.xml' => ['<c:pageMargins'],
50
+ 'xl/workbook.xml' => [ '<fileVersion' ]
51
+ }
52
+ )
53
+ end
54
+ end
@@ -0,0 +1,56 @@
1
+ # -*- coding: utf-8 -*-
2
+ require 'helper'
3
+
4
+ class TestRegressionChartGap05 < Test::Unit::TestCase
5
+ def setup
6
+ setup_dir_var
7
+ end
8
+
9
+ def teardown
10
+ File.delete(@xlsx) if File.exist?(@xlsx)
11
+ end
12
+
13
+ def test_chart_gap05
14
+ @xlsx = 'chart_gap05.xlsx'
15
+ workbook = WriteXLSX.new(@xlsx)
16
+ worksheet = workbook.add_worksheet
17
+ chart = workbook.add_chart(:type => 'bar', :embedded => 1)
18
+
19
+ # For testing, copy the randomly generated axis ids in the target xlsx file.
20
+ chart.instance_variable_set(:@axis_ids, [45938176, 59715584])
21
+ chart.instance_variable_set(:@axis2_ids, [70848512, 54519680])
22
+
23
+ data = [
24
+ [1, 2, 3, 4, 5],
25
+ [6, 8, 6, 4, 2]
26
+ ]
27
+
28
+ worksheet.write('A1', data)
29
+
30
+ chart.add_series(
31
+ :values => '=Sheet1!$A$1:$A$5',
32
+ :gap => 51,
33
+ :overlap => 12
34
+ )
35
+
36
+ chart.add_series(
37
+ :values => '=Sheet1!$B$1:$B$5',
38
+ :y2_axis => 1,
39
+ :gap => 251,
40
+ :overlap => -27
41
+ )
42
+
43
+ chart.set_x2_axis(:label_position => 'next_to')
44
+
45
+ worksheet.insert_chart('E9', chart)
46
+
47
+ workbook.close
48
+ compare_xlsx_for_regression(File.join(@regression_output, @xlsx), @xlsx,
49
+ [],
50
+ {
51
+ 'xl/charts/chart1.xml' => ['<c:pageMargins'],
52
+ 'xl/workbook.xml' => [ '<fileVersion' ]
53
+ }
54
+ )
55
+ end
56
+ end
data/write_xlsx.gemspec CHANGED
@@ -5,12 +5,13 @@ require 'write_xlsx/version'
5
5
 
6
6
  Gem::Specification.new do |gem|
7
7
  gem.name = "write_xlsx"
8
- gem.version = WriteXLSX::VERSION
8
+ gem.version = WriteXLSX_VERSION
9
9
  gem.authors = ["Hideo NAKAMURA"]
10
10
  gem.email = ["cxn03651@msj.biglobe.ne.jp"]
11
11
  gem.description = "write_xlsx is a gem to create a new file in the Excel 2007+ XLSX format."
12
12
  gem.summary = "write_xlsx is a gem to create a new file in the Excel 2007+ XLSX format."
13
13
  gem.homepage = "http://github.com/cxn03651/write_xlsx#readme"
14
+ gem.license = 'MIT'
14
15
 
15
16
  gem.files = `git ls-files`.split($/)
16
17
  gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
@@ -18,6 +19,7 @@ Gem::Specification.new do |gem|
18
19
  gem.require_paths = ["lib"]
19
20
  gem.add_runtime_dependency 'rubyzip', '>= 1.0.0'
20
21
  gem.add_runtime_dependency 'zip-zip'
22
+ gem.add_development_dependency 'test-unit'
21
23
  gem.extra_rdoc_files = [
22
24
  "LICENSE.txt",
23
25
  "README.md",
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: write_xlsx
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.81.0
4
+ version: 0.81.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Hideo NAKAMURA
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-12-04 00:00:00.000000000 Z
11
+ date: 2014-12-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rubyzip
@@ -38,6 +38,20 @@ dependencies:
38
38
  - - ">="
39
39
  - !ruby/object:Gem::Version
40
40
  version: '0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: test-unit
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ">="
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ">="
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
41
55
  description: write_xlsx is a gem to create a new file in the Excel 2007+ XLSX format.
42
56
  email:
43
57
  - cxn03651@msj.biglobe.ne.jp
@@ -551,6 +565,8 @@ files:
551
565
  - test/regression/test_chart_gap01.rb
552
566
  - test/regression/test_chart_gap02.rb
553
567
  - test/regression/test_chart_gap03.rb
568
+ - test/regression/test_chart_gap04.rb
569
+ - test/regression/test_chart_gap05.rb
554
570
  - test/regression/test_chart_gridlines01.rb
555
571
  - test/regression/test_chart_gridlines02.rb
556
572
  - test/regression/test_chart_gridlines03.rb
@@ -1086,6 +1102,8 @@ files:
1086
1102
  - test/regression/xlsx_files/chart_gap01.xlsx
1087
1103
  - test/regression/xlsx_files/chart_gap02.xlsx
1088
1104
  - test/regression/xlsx_files/chart_gap03.xlsx
1105
+ - test/regression/xlsx_files/chart_gap04.xlsx
1106
+ - test/regression/xlsx_files/chart_gap05.xlsx
1089
1107
  - test/regression/xlsx_files/chart_gridlines01.xlsx
1090
1108
  - test/regression/xlsx_files/chart_gridlines02.xlsx
1091
1109
  - test/regression/xlsx_files/chart_gridlines03.xlsx
@@ -1539,7 +1557,8 @@ files:
1539
1557
  - test/worksheet/test_write_worksheet_attributes.rb
1540
1558
  - write_xlsx.gemspec
1541
1559
  homepage: http://github.com/cxn03651/write_xlsx#readme
1542
- licenses: []
1560
+ licenses:
1561
+ - MIT
1543
1562
  metadata: {}
1544
1563
  post_install_message:
1545
1564
  rdoc_options: []
@@ -1557,7 +1576,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
1557
1576
  version: '0'
1558
1577
  requirements: []
1559
1578
  rubyforge_project:
1560
- rubygems_version: 2.4.1
1579
+ rubygems_version: 2.4.5
1561
1580
  signing_key:
1562
1581
  specification_version: 4
1563
1582
  summary: write_xlsx is a gem to create a new file in the Excel 2007+ XLSX format.
@@ -1944,6 +1963,8 @@ test_files:
1944
1963
  - test/regression/test_chart_gap01.rb
1945
1964
  - test/regression/test_chart_gap02.rb
1946
1965
  - test/regression/test_chart_gap03.rb
1966
+ - test/regression/test_chart_gap04.rb
1967
+ - test/regression/test_chart_gap05.rb
1947
1968
  - test/regression/test_chart_gridlines01.rb
1948
1969
  - test/regression/test_chart_gridlines02.rb
1949
1970
  - test/regression/test_chart_gridlines03.rb
@@ -2479,6 +2500,8 @@ test_files:
2479
2500
  - test/regression/xlsx_files/chart_gap01.xlsx
2480
2501
  - test/regression/xlsx_files/chart_gap02.xlsx
2481
2502
  - test/regression/xlsx_files/chart_gap03.xlsx
2503
+ - test/regression/xlsx_files/chart_gap04.xlsx
2504
+ - test/regression/xlsx_files/chart_gap05.xlsx
2482
2505
  - test/regression/xlsx_files/chart_gridlines01.xlsx
2483
2506
  - test/regression/xlsx_files/chart_gridlines02.xlsx
2484
2507
  - test/regression/xlsx_files/chart_gridlines03.xlsx