kindler 0.0.4 → 0.0.5

Sign up to get free protection for your applications and to get access to all the features.
data/Readme.md CHANGED
@@ -1,6 +1,7 @@
1
1
  ### Todo
2
2
  support magzine like format
3
3
 
4
+
4
5
  ### Installation
5
6
  ```ruby
6
7
  gem 'kindler'
@@ -1,3 +1,3 @@
1
1
  module Kindler
2
- VERSION = "0.0.4"
2
+ VERSION = "0.0.5"
3
3
  end
data/lib/kindler.rb CHANGED
@@ -199,8 +199,8 @@ module Kindler
199
199
  # download images
200
200
  debug "begin fetch image #{image_remote_address}"
201
201
  debug "save to #{image_local_address}"
202
- File.open(image_local_address,'w') do |f|
203
- f.puts open(image_remote_address).read
202
+ File.open(image_local_address,'wb') do |f|
203
+ f.write open(image_remote_address).read
204
204
  end
205
205
  debug 'Image saved'
206
206
  # replace local url address
@@ -260,14 +260,14 @@ module Kindler
260
260
  end
261
261
 
262
262
  def write_to_disk
263
- File.open("#{tmp_dir}/nav-contents.ncx",'w') { |f| f.puts @ncx }
264
- File.open(file_path('contents'),'w') {|f| f.puts @toc }
265
- File.open("#{tmp_dir}/#{@title}.opf",'w') {|f| f.puts @opf}
263
+ File.open("#{tmp_dir}/nav-contents.ncx",'wb') { |f| f.write @ncx }
264
+ File.open(file_path('contents'),'wb') {|f| f.write @toc }
265
+ File.open("#{tmp_dir}/#{@title}.opf",'wb') {|f| f.write @opf}
266
266
  # make html files
267
267
  files_count = 1
268
268
  @doc_infos.each do |url,infos|
269
- File.open(file_path(files_count.to_s.rjust(3,'0')),'w') do |f|
270
- f.puts infos[:content]
269
+ File.open(file_path(files_count.to_s.rjust(3,'0')),'wb') do |f|
270
+ f.write infos[:content]
271
271
  end
272
272
  files_count += 1
273
273
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kindler
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -13,7 +13,7 @@ date: 2012-02-03 00:00:00.000000000Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: mini_magick
16
- requirement: &2155686500 !ruby/object:Gem::Requirement
16
+ requirement: &2154414840 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: '0'
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *2155686500
24
+ version_requirements: *2154414840
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: ruby-readability
27
- requirement: &2155686080 !ruby/object:Gem::Requirement
27
+ requirement: &2154414400 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ! '>='
@@ -32,7 +32,7 @@ dependencies:
32
32
  version: '0'
33
33
  type: :runtime
34
34
  prerelease: false
35
- version_requirements: *2155686080
35
+ version_requirements: *2154414400
36
36
  description: kindler is a rubygem allow you to generate kindle mobi book from urls
37
37
  very easily
38
38
  email: