Skip to content

Commit

Permalink
Merge pull request #331 from roo-rb/fix_convertation_of_cell
Browse files Browse the repository at this point in the history
Fix convertation of cell
  • Loading branch information
stevendaniels authored Aug 21, 2016
2 parents 96940b2 + bd5c6d1 commit b399a5a
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 6 deletions.
7 changes: 5 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
language: ruby
rvm:
- 2.0.0
- 2.1.8
- 2.2.4
- 2.3.1
- ruby-head
- jruby-19mode # JRuby in 1.9 mode
- rbx-2
matrix:
include:
- rvm: 2.0.0
gemfile: Gemfile_ruby2
- rvm: 2.1.8
gemfile: Gemfile_ruby2
allow_failures:
- rvm: ruby-head
- rvm: jruby-19mode
Expand Down
27 changes: 27 additions & 0 deletions Gemfile_ruby2
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
source 'https://rubygems.org'

gemspec

group :test do
# additional testing libs
gem 'webmock'
gem 'shoulda'
gem 'rspec', '>= 3.0.0'
gem 'vcr'
gem 'simplecov', '>= 0.9.0', require: false
gem 'coveralls', require: false
# gem "pry"
gem "activesupport", "~> 4.2.0"
end

group :local_development do
gem "listen", "~> 3.0.6"
gem 'terminal-notifier-guard', require: false if RUBY_PLATFORM.downcase.include?('darwin')
gem 'guard-rspec', '>= 4.3.1', require: false
gem 'guard-minitest', require: false
gem 'guard-bundler', require: false
gem 'guard-preek', require: false
gem 'guard-rubocop', require: false
gem 'guard-reek', github: 'pericles/guard-reek', require: false
gem 'pry'
end
9 changes: 5 additions & 4 deletions lib/roo/excelx/sheet_doc.rb
Original file line number Diff line number Diff line change
Expand Up @@ -90,17 +90,18 @@ def cell_from_xml(cell_xml, hyperlink)
cell_xml.children.each do |cell|
case cell.name
when 'is'
cell.children.each do |inline_str|
if inline_str.name == 't'
return Excelx::Cell.create_cell(:string, inline_str.content, formula, style, hyperlink, coordinate)
end
content_arr = cell.search('t').map(&:content)
unless content_arr.empty?
return Excelx::Cell.create_cell(:string, content_arr.join(''), formula, style, hyperlink, coordinate)
end
when 'f'
formula = cell.content
when 'v'
return create_cell_from_value(value_type, cell, formula, format, style, hyperlink, base_date, coordinate)
end
end

Excelx::Cell::Empty.new(coordinate)
end

def create_cell_from_value(value_type, cell, formula, format, style, hyperlink, base_date, coordinate)
Expand Down
2 changes: 2 additions & 0 deletions test/test_roo.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
# with the wrong spreadsheet class
#STDERR.reopen "/dev/null","w"

Encoding.default_external = "UTF-8"

require 'test_helper'
require 'stringio'

Expand Down

0 comments on commit b399a5a

Please sign in to comment.