diff options
| -rw-r--r-- | .travis.yml | 43 | ||||
| -rw-r--r-- | Gemfile | 9 | ||||
| -rw-r--r-- | README.md | 2 | ||||
| -rw-r--r-- | appveyor.yml | 23 | ||||
| -rw-r--r-- | lib/axlsx/workbook/worksheet/merged_cells.rb | 2 | ||||
| -rw-r--r-- | test/tc_axlsx.rb | 10 | ||||
| -rw-r--r-- | test/workbook/worksheet/tc_worksheet.rb | 7 |
7 files changed, 78 insertions, 18 deletions
diff --git a/.travis.yml b/.travis.yml index 8371fef4..89c56f22 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,28 +1,41 @@ language: ruby -sudo: false +sudo: required +dist: trusty +group: beta cache: bundler bundler_args: --without profile -env: - - JRUBY_OPTS="-Xcli.debug=true --debug" + notifications: irc: "irc.freenode.org#axlsx" email: recipients: on_success: always -rvm: - - 1.9.2 - - 1.9.3 - - 2.0 - - 2.1 - - 2.2 - - rbx - - jruby-19mode - - jruby-9.0.0.0 - - ruby-head - - jruby-head + matrix: + include: + - rvm: 1.9.3 + - rvm: 2.0 + - rvm: 2.1 + - rvm: 2.2 + - rvm: 2.3.1 + - rvm: rbx-3 + - rvm: jruby-19mode + env: JRUBY_OPTS="-Xcli.debug=true --debug" + - rvm: jruby-9.1.5.0 + env: JRUBY_OPTS="-Xcli.debug=true --debug" + - rvm: ruby-head + - rvm: jruby-head + env: JRUBY_OPTS="-Xcli.debug=true --debug" allow_failures: + - rvm: rbx-3 - rvm: ruby-head - - rvm: jruby-9.0.0.0 + - rvm: jruby-9.1.5.0 - rvm: jruby-head + +# https://github.com/jruby/jruby/wiki/FAQs#why-is-jruby-so-slow-to-install-via-rvm +# https://docs.travis-ci.com/user/installing-dependencies#Installing-Packages-with-the-APT-Addon +addons: + apt: + packages: + - haveged @@ -2,7 +2,12 @@ source 'https://rubygems.org' gemspec group :test do - gem 'rake', '>= 0.8.7' + if RUBY_VERSION.to_i < 2 + gem 'rake', '>= 0.8.7', '< 11' + gem 'json', '< 2' + else + gem 'rake' + end gem 'simplecov' gem 'test-unit' end @@ -15,5 +20,5 @@ platforms :rbx do gem 'rubysl' gem 'rubysl-test-unit' gem 'racc' - gem 'rubinius-coverage', '~> 2.0' + gem 'rubinius-coverage', '~> 2.0' end @@ -1,6 +1,6 @@ Axlsx: Office Open XML Spreadsheet Generation ==================================== -[](http://travis-ci.org/randym/axlsx/) +[](http://travis-ci.org/randym/axlsx/) If you are using axlsx for commercial purposes, or just want to show your appreciation for the gem, please don't hesitate to make a donation. diff --git a/appveyor.yml b/appveyor.yml new file mode 100644 index 00000000..0d7d5fce --- /dev/null +++ b/appveyor.yml @@ -0,0 +1,23 @@ +version: 2.1.0.{build}-{branch} + +environment: + matrix: + - RUBY_VERSION: 23 + - RUBY_VERSION: 22 + - RUBY_VERSION: 21 + - RUBY_VERSION: 200 + - RUBY_VERSION: 193 + +install: + - set PATH=C:\Ruby%RUBY_VERSION%\bin;%PATH% + - bundle install + +build: off + +before_test: + - ruby -v + - gem -v + - bundle -v + +test_script: + - bundle exec rake diff --git a/lib/axlsx/workbook/worksheet/merged_cells.rb b/lib/axlsx/workbook/worksheet/merged_cells.rb index 6ea1edc9..67753bd3 100644 --- a/lib/axlsx/workbook/worksheet/merged_cells.rb +++ b/lib/axlsx/workbook/worksheet/merged_cells.rb @@ -19,6 +19,8 @@ module Axlsx cells elsif cells.is_a?(Array) Axlsx::cell_range(cells, false) + elsif cells.is_a?(Row) + Axlsx::cell_range(cells, false) end end diff --git a/test/tc_axlsx.rb b/test/tc_axlsx.rb index 1be9166c..63b17f74 100644 --- a/test/tc_axlsx.rb +++ b/test/tc_axlsx.rb @@ -45,6 +45,16 @@ class TestAxlsx < Test::Unit::TestCase assert_equal(Axlsx.cell_range([c2, c1], true), "'Sheet <''>" 1'!$A$1:$B$1") end + def test_cell_range_row + p = Axlsx::Package.new + ws = p.workbook.add_worksheet + row = ws.add_row + c1 = row.add_cell + c2 = row.add_cell + c3 = row.add_cell + assert_equal("A1:C1", Axlsx.cell_range(row, false)) + end + def test_name_to_indices setup_wide @wide_test_points.each do |key, value| diff --git a/test/workbook/worksheet/tc_worksheet.rb b/test/workbook/worksheet/tc_worksheet.rb index f8bd69ae..df9da22f 100644 --- a/test/workbook/worksheet/tc_worksheet.rb +++ b/test/workbook/worksheet/tc_worksheet.rb @@ -323,6 +323,13 @@ class TestWorksheet < Test::Unit::TestCase assert_equal(doc.xpath('//xmlns:worksheet/xmlns:mergeCells/xmlns:mergeCell[@ref="E1:F1"]').size, 1) end + def test_to_xml_string_merge_cells_row + row = @ws.add_row [1, "two"] + @ws.merge_cells row + doc = Nokogiri::XML(@ws.to_xml_string) + assert_equal(doc.xpath('//xmlns:worksheet/xmlns:mergeCells/xmlns:mergeCell[@ref="A1:B1"]').size, 1) + end + def test_to_xml_string_row_breaks @ws.add_page_break("A1") doc = Nokogiri::XML(@ws.to_xml_string) |
