Skip to content
Closed
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: 0 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,13 +93,6 @@ puts sheet.images_at('C1') # => nil

Creek will most likely return nil for a cell with images if there is no other text cell in that row - you can use *images_at* method for retrieving images in that cell.

## Remote files

```ruby
remote_url = 'http://dev-builds.libreoffice.org/tmp/test.xlsx'
Creek::Book.new remote_url, remote: true
```

## Contributing

Contributions are welcomed. You can fork a repository, add your code changes to the forked branch, ensure all existing unit tests pass, create new unit tests which cover your new changes and finally create a pull request.
Expand Down
1 change: 0 additions & 1 deletion creek.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,4 @@ Gem::Specification.new do |spec|

spec.add_dependency 'nokogiri', '>= 1.7.0'
spec.add_dependency 'rubyzip', '>= 1.0.0'
spec.add_dependency 'http', '~> 4.0'
end
10 changes: 2 additions & 8 deletions lib/creek/book.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
require 'zip/filesystem'
require 'nokogiri'
require 'date'
require 'http'
require 'time'

module Creek

Expand All @@ -20,13 +20,7 @@ def initialize path, options = {}
extension = File.extname(options[:original_filename] || path).downcase
raise 'Not a valid file format.' unless (['.xlsx', '.xlsm'].include? extension)
end
if options[:remote]
zipfile = Tempfile.new("file")
zipfile.binmode
zipfile.write(HTTP.get(path).to_s)
zipfile.close
path = zipfile.path
end

@files = Zip::File.open(path)
@shared_strings = SharedStrings.new(self)
end
Expand Down