Skip to content
Browse files

Merge pull request #8 from plukevdh/master

I will test it later
  • Loading branch information...
2 parents 4b84183 + 7d044de commit 034b880d679bb1e50d3d690c035194d27fb146d5 @jugyo committed May 10, 2011
Showing with 12 additions and 8 deletions.
  1. +6 −6 eeepub.gemspec
  2. +5 −1 lib/eeepub/ocf.rb
  3. +1 −1 spec/eeepub/ocf_spec.rb
View
12 eeepub.gemspec
@@ -15,10 +15,10 @@ Gem::Specification.new do |s|
s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
s.require_paths = ["lib"]
- s.add_runtime_dependency(%q<zipruby>, ["~> 0.3"])
- s.add_runtime_dependency(%q<builder>, ["~> 3.0"])
- s.add_development_dependency(%q<rspec>, ["~> 2.0"])
- s.add_development_dependency(%q<rr>, ["~> 1.0"])
- s.add_development_dependency(%q<simplecov>, ["~> 0.4"])
- s.add_development_dependency(%q<nokogiri>, ["~> 1.4"])
+ s.add_dependency "builder"
+ s.add_dependency "zipruby"
+ s.add_development_dependency "rspec"
+ s.add_development_dependency "nokogiri"
+ s.add_development_dependency "rr"
+ s.add_development_dependency "simplecov"
end
View
6 lib/eeepub/ocf.rb
@@ -111,7 +111,11 @@ def render
create_epub do
buffer = Zip::Archive.open_buffer(Zip::CREATE) do |zip|
Dir.glob('**/*').each do |path|
- zip.add_buffer(path, path)
+ if File.directory?(path)
+ zip.add_buffer(path, path)
+ else
+ zip.add_buffer(path, File.read(path))
+ end
end
end
View
2 spec/eeepub/ocf_spec.rb
@@ -43,7 +43,7 @@
it 'should stream epub' do
output = @ocf.render
- output.size.should == 370
+ output.size.should == 523
output.is_binary_data?.should be_true
end
end

0 comments on commit 034b880

Please sign in to comment.
Something went wrong with that request. Please try again.