Skip to content

Commit

Permalink
Drop our Roo::ZipFile abstraction in favor of more recent dependencies.
Browse files Browse the repository at this point in the history
  • Loading branch information
Empact committed Nov 24, 2014
1 parent 2d1b12a commit d466950
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 14 deletions.
1 change: 1 addition & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
* enhancements
* Extend Roo::Spreadsheet.open to accept Tempfiles and other arguments responding to #path. Note they require an :extension option to be declared, as the tempfile mangles the extension. #84.
* Remove deprecated code.
* Remove the Roo::ZipFile abstraction. Roo now depends on rubyzip 1.0.0+
* Extract Roo::Excel and Roo::Excel2003XML to roo-xls
* Extract Roo::Google to roo-google
* Accept the tmpdir_root option in Roo::Excelx
Expand Down
5 changes: 3 additions & 2 deletions lib/roo/base.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
require 'tmpdir'
require 'stringio'
require 'nokogiri'
require 'roo/zip_file'
require 'roo/utils'

# Base class for all other types of spreadsheets
Expand Down Expand Up @@ -634,7 +633,9 @@ def open_from_stream(stream, tmpdir)
end

def unzip(filename, tmpdir)
Roo::ZipFile.open(filename) do |zip|
require 'zip/filesystem'

Zip::File.open(filename) do |zip|
process_zipfile_packed(zip, tmpdir)
end
end
Expand Down
3 changes: 2 additions & 1 deletion lib/roo/excelx.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
require 'date'
require 'nokogiri'
require 'roo/link'
require 'zip/filesystem'

class Roo::Excelx < Roo::Base
autoload :Workbook, 'roo/excelx/workbook'
Expand Down Expand Up @@ -427,7 +428,7 @@ def comments(sheet=nil)
# Extracts all needed files from the zip file
def process_zipfile(tmpdir, zipfilename)
@sheet_files = []
Roo::ZipFile.foreach(zipfilename) do |entry|
Zip::File.foreach(zipfilename) do |entry|
path =
case entry.name.downcase
when /workbook.xml$/
Expand Down
3 changes: 2 additions & 1 deletion lib/roo/open_office.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
require 'date'
require 'nokogiri'
require 'cgi'
require 'zip/filesystem'

class Roo::OpenOffice < Roo::Base
# initialization and opening of a spreadsheet file
Expand All @@ -13,7 +14,7 @@ def initialize(filename, options={})
@tmpdir = make_tmpdir(filename.split('/').last, options[:tmpdir_root])
@filename = local_filename(filename, @tmpdir, packed)
#TODO: @cells_read[:default] = false
Roo::ZipFile.open(@filename) do |zip_file|
Zip::File.open(@filename) do |zip_file|
if content_entry = zip_file.glob("content.xml").first
content_entry.extract(File.join(@tmpdir, 'roo_content.xml'))
else
Expand Down
9 changes: 0 additions & 9 deletions lib/roo/zip_file.rb

This file was deleted.

2 changes: 1 addition & 1 deletion roo.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ Gem::Specification.new do |spec|
spec.require_paths = ['lib']

spec.add_dependency 'nokogiri'
spec.add_dependency 'rubyzip', '~> 1'
spec.add_dependency 'rubyzip', '>= 1.0.0'

spec.add_development_dependency 'bundler', '>= 1.7'
spec.add_development_dependency 'rake', '>= 10.0'
Expand Down

0 comments on commit d466950

Please sign in to comment.