Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix convertation of cell #331

Merged
merged 4 commits into from
Aug 21, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
language: ruby
rvm:
- 2.0.0
- 2.1.8
- 2.2.4
- 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