Skip to content

Commit

Permalink
Prepare 2.0.0 release
Browse files Browse the repository at this point in the history
  • Loading branch information
felixbuenemann committed Oct 31, 2017
1 parent e3e1583 commit cbd2cf2
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 1 deletion.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Changelog

## 2.0.0 (2017-10-31)

- Replace RubyZip with ZipTricks as default compressor (#16)
- Drop support for Ruby < 2.1.0 (required for zip\_tricks gem)
- Deprecate :io\_wrapper option, you can now pass wrapper instances (#20)

## 1.3.2 (2017-10-30)

- Fix circular require in workbook
Expand Down
36 changes: 36 additions & 0 deletions lib/xlsxtream/io/zip_tricks_fibers.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
require "zip_tricks"

module Xlsxtream
module IO
class ZipTricksFibers
def initialize(body)
@streamer = ::ZipTricks::Streamer.new(body)
@wf = nil
end

def <<(data)
@wf.resume(data)
self
end

def add_file(path)
@wf.resume(:__close__) if @wf

@wf = Fiber.new do | bytes_or_close_sym |
@streamer.write_deflated_file(path) do |write_sink|
loop do
break if bytes_or_close_sym == :__close__
write_sink << bytes_or_close_sym
bytes_or_close_sym = Fiber.yield
end
end
end
end

def close
@wf.resume(:__close__) if @wf
@streamer.close
end
end
end
end
2 changes: 1 addition & 1 deletion lib/xlsxtream/version.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module Xlsxtream
VERSION = '1.3.2'.freeze
VERSION = '2.0.0'.freeze
end

0 comments on commit cbd2cf2

Please sign in to comment.