kindler 0.3.4 → 0.3.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Readme.md +2 -1
- data/conver.gif +0 -0
- data/lib/kindler/version.rb +1 -1
- data/lib/kindler.rb +8 -1
- data/lib/templates/book.opf.erb +1 -1
- data/spec/cases/generator_spec.rb +1 -1
- metadata +2 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 60d6fee5962ce242f6969ee0a723b6650a259980
|
4
|
+
data.tar.gz: d5e707ccd5da62e2a66d9d462390c7065c7c95fa
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4cdb75e81352a4bd899a14512b34253fd1a7a5980a34da8e82492fa718d671303209617c9d9ab29051117cd5a22a60e34cf0e9d08baa78aa79608ff79fb9aa7e
|
7
|
+
data.tar.gz: 5eddadea6a9b5da4a6efa45c5c4bfdea2b02a4b5f2d8bc8000f259ec86fc8f62199cd93fedff671a761000e65093554e64c303d72b58f3254eca82cf88429a56
|
data/Readme.md
CHANGED
data/conver.gif
ADDED
Binary file
|
data/lib/kindler/version.rb
CHANGED
data/lib/kindler.rb
CHANGED
@@ -203,8 +203,15 @@ module Kindler
|
|
203
203
|
File.expand_path (@output_dir == '' ? "#{TMP_DIR_PREFIX}#{title}" : @output_dir)
|
204
204
|
end
|
205
205
|
|
206
|
+
# 1. using imagemagick to crop a image to 600*800
|
207
|
+
# 2. set the image url to something
|
206
208
|
def prepare_conver_img
|
207
|
-
|
209
|
+
if @local_images.length > 0
|
210
|
+
image_file = @local_images.first
|
211
|
+
@cover_image = "#{File.dirname(image_file)}/cover-image.gif"
|
212
|
+
cmd = "convert #{image_file} -compose over -background white -flatten -resize '300x200>' -alpha off #{@cover_image}"
|
213
|
+
`#{cmd}` rescue ''
|
214
|
+
end
|
208
215
|
end
|
209
216
|
|
210
217
|
# create dirs of generated files
|
data/lib/templates/book.opf.erb
CHANGED
@@ -22,7 +22,7 @@
|
|
22
22
|
<% pages.each_with_index do |page,index|%>
|
23
23
|
<item href='<%= (index+1).to_s.rjust(3,'0') %>.html' media-type='application/xhtml+xml' id='<%= (index+1).to_s.rjust(3,'0') %>'/>
|
24
24
|
<% end %>
|
25
|
-
<item href="
|
25
|
+
<item href="cover-image.gif" id="cover-image" media-type="image/gif" />
|
26
26
|
<item href='contents.html' media-type='application/xhtml+xml' id='contents'/>
|
27
27
|
<item href='nav-contents.ncx' media-type='application/x-dtbncx+xml' id='nav-contents'/>
|
28
28
|
</manifest>
|
@@ -58,7 +58,7 @@ describe "Mobi book file generator" do
|
|
58
58
|
book = Kindler::Book.new :title=>title,:author=>'mike',:debug=>true
|
59
59
|
book.add_page :title=>'page1',:author=>'mike1',:content=>'this is the page 1',:wrap=>true
|
60
60
|
book.add_page :title=>'page2',:author=>'mike1',:content=>'this is the page 2',:wrap=>true
|
61
|
-
book.add_page :title=>'page3',:author=>'mike1',:content=>'<img src="http://
|
61
|
+
book.add_page :title=>'page3',:author=>'mike1',:content=>'<img src="http://images.fanpop.com/images/image_uploads/widescreen-season-4-wallpaper-lost-661159_1680_1050.jpg"/>this is the page 3',:wrap=>true
|
62
62
|
book.generate
|
63
63
|
book.should be_generated
|
64
64
|
File.should be_exist("./#{Kindler::Book::TMP_DIR_PREFIX}#{title}/1.jpg")
|
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.3.
|
4
|
+
version: 0.3.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- dongbin.li
|
@@ -36,6 +36,7 @@ files:
|
|
36
36
|
- Guardfile
|
37
37
|
- Rakefile
|
38
38
|
- Readme.md
|
39
|
+
- conver.gif
|
39
40
|
- features/basic.feature
|
40
41
|
- features/dsl.feature
|
41
42
|
- features/step_definitions/basic_step.rb
|