prophecy 0.0.1 → 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,95 @@
1
+ Zip 3.0
2
+
3
+ We have posted Zip 3.0, July 5th 2008. This is a major upgrade
4
+ from Zip 2.32, the current Zip 2.x release. A quick summary of
5
+ features is below, but see the file WhatsNew for the detailed list
6
+ of major features and upgrades as well as what's on the list for
7
+ Zip 3.1. Send in your feature suggestions and bug reports.
8
+
9
+ Quick list of major changes in Zip 3.0:
10
+
11
+ - Large files. Support for files and archives greater than 2 GB using
12
+ large file I/O and the Zip64 extensions. Also can now have more
13
+ than 64K entries in an archive.
14
+
15
+ - Split archives. Zip now supports split archives, zip archives
16
+ split into a set of files that can then be stored on removable media
17
+ for instance.
18
+
19
+ - Unicode. If Unicode support is enabled and supported on the system
20
+ Zip is run on, Zip now can read paths not in the current character
21
+ set and store those paths in portable UTF-8 format. These Unicode
22
+ paths can then be used to partially or fully recreate the paths on
23
+ other systems depending on the character set support provided by
24
+ the unzip on the receiving system. In particular, this allows
25
+ portability of paths between Windows and Unix. Unicode comments
26
+ are also supported on systems where UTF-8 is the current character
27
+ set. Unicode comment support for other systems is expected in
28
+ Zip 3.1.
29
+
30
+ - New command line parser. This new parser allows for command line
31
+ permuting, where options can appear almost anywhere on the command
32
+ line. This allows adding options to the end of the command line,
33
+ for instance. It also supports long options, allowing for
34
+ more readable command lines, and also allows lists for the -x
35
+ exclude and -i include options to appear not just at the end of
36
+ the command line. And some bugs in command line processing in
37
+ Zip 2.32 have been fixed.
38
+
39
+ - Unix 32-bit UIDs/GIDs. Now UIDs/GIDs larger than 16 bits are
40
+ supported, but UnZip 6.0 is needed to restore these larger
41
+ UIDs/GIDs. If Zip detects that the current system does not use
42
+ 16-bit UIDs/GIDs, the old 16-bit UID/GID storage is not used
43
+ as putting 32-bit UIDs/GIDs into 16-bit fields can cause
44
+ problems.
45
+
46
+ - New modes. Additional archive modes have been added, including a
47
+ difference mode for supporting incremental backups, a file sync
48
+ mode for synchronizing an existing archive with the current file
49
+ system (which can be much faster than creating a new archive), and
50
+ a copy mode that allows copying entries from one archive to another.
51
+
52
+ - Compression using bzip2. Now can add bzip2 compression as a
53
+ compression option in Zip. bzip2 compression can result in much
54
+ more compact entries in some cases, but the user should verify
55
+ that bzip2 is supported on the target unzip before using this new
56
+ compression choice.
57
+
58
+ - New Windows dll. The Windows dll has been updated to support the
59
+ new Zip64 large file and larger number of entries limits. This
60
+ new dll is not backward compatible with the Zip 2.32 dll, as the
61
+ arguments to the dll have been updated to support the added
62
+ capabilities, but modifying existing programs to use the new dll
63
+ should be simple. See the included Visual Basic example project
64
+ for details.
65
+
66
+ - Better streaming and piping. Zip now has better support of
67
+ streaming and piping and handles Unix FIFOs (named pipes) better.
68
+
69
+ - Gobs of new progress information. Zip can now output progress
70
+ information, such as how many entries processed and to go, how
71
+ many bytes processed and to go, and adjustable size progress
72
+ dots. If the initial file scan takes longer than about 5
73
+ seconds, Zip now outputs dots during the scan to avoid a long
74
+ period of quiet. Zip can also now generate log files.
75
+
76
+ - Updated archive fixing. The archive fixing capability is
77
+ slightly improved, and now can fix split archives.
78
+
79
+ - Windows Archive bit support. The Windows archive bit is now
80
+ supported, though the new difference mode is probably more
81
+ reliable than relying on the Windows archive bit for creating
82
+ incremental backups.
83
+
84
+ - File lists. Zip can list the files that would be added to an
85
+ archive as well as the files in an existing archive.
86
+
87
+ - Extended help. A new extended help option lists a very terse
88
+ summary of the major features of Zip and how to use them.
89
+
90
+ - Many bug fixes.
91
+
92
+ As always, see the Zip manual page for details on what Zip has and
93
+ how to use all features.
94
+
95
+ Enjoy!
Binary file
Binary file
Binary file
data/lib/prophecy/cli.rb CHANGED
@@ -28,10 +28,30 @@ module Prophecy
28
28
  @book.generate_build
29
29
 
30
30
  # Compile Epub with Zip
31
+ print "Compiling Epub with Zip... "
31
32
  path = File.expand_path("./publish/epub/#{@book.compile_name}.epub")
32
- system "cd #{@book.build_dir} && zip -X #{path} mimetype"
33
- system "cd #{@book.build_dir} && zip -rg #{path} META-INF"
34
- system "cd #{@book.build_dir} && zip -rg #{path} OEBPS"
33
+
34
+ if RUBY_PLATFORM =~ /linux|darwin|cygwin/
35
+ binpath = "zip"
36
+ elsif RUBY_PLATFORM =~ /mingw|mswin32/
37
+ binpath = File.expand_path(File.join(__FILE__, '..', '..', '..', 'bin/zip.exe'))
38
+ end
39
+
40
+ cmd = "{ cd #{@book.build_dir}"
41
+ cmd += " && #{binpath} -X \"#{path}\" mimetype"
42
+ cmd += " && #{binpath} -rg \"#{path}\" META-INF"
43
+ cmd += " && #{binpath} -rg \"#{path}\" OEBPS; } > zip.log 2>&1"
44
+
45
+ if system(cmd)
46
+ puts "OK"
47
+ puts "Find the Epub file in ./publish/epub"
48
+ else
49
+ puts "Error. See zip.log"
50
+ exit 2
51
+ end
52
+
53
+ #puts "Validating with epubcheck"
54
+ #cmd = system("epubcheck builds/epub/book.epub")
35
55
  end
36
56
 
37
57
  desc "mobi", "generate MOBI with Kindlegen"
@@ -44,16 +64,57 @@ module Prophecy
44
64
  @book.generate_build
45
65
 
46
66
  # Compile Epub with Zip for conversion with kindlegen
67
+ print "Compiling Epub (for Mobi) with Zip... "
47
68
  path = File.expand_path("./#{@book.compile_name}.epub")
48
- system "cd #{@book.build_dir} && zip -X #{path} mimetype"
49
- system "cd #{@book.build_dir} && zip -rg #{path} META-INF"
50
- system "cd #{@book.build_dir} && zip -rg #{path} OEBPS"
69
+
70
+ if RUBY_PLATFORM =~ /linux|darwin|cygwin/
71
+ binpath = "zip"
72
+ elsif RUBY_PLATFORM =~ /mingw|mswin32/
73
+ binpath = File.expand_path(File.join(__FILE__, '..', '..', '..', 'bin/zip.exe'))
74
+ end
75
+
76
+ cmd = "{ cd #{@book.build_dir}"
77
+ cmd += " && #{binpath} -X \"#{path}\" mimetype"
78
+ cmd += " && #{binpath} -rg \"#{path}\" META-INF"
79
+ cmd += " && #{binpath} -rg \"#{path}\" OEBPS; } > zip.log 2>&1"
80
+
81
+ if system(cmd)
82
+ puts "OK"
83
+ else
84
+ puts "Error. See zip.log"
85
+ exit 2
86
+ end
51
87
 
52
88
  # Kindlegen
89
+ print "Converting Epub with Kindlegen... "
90
+
53
91
  binpath = File.expand_path(File.join(__FILE__, '..', '..', '..', 'bin/kindlegen'))
54
- system "#{binpath} '#{@book.compile_name}.epub'"
55
- system "mv '#{@book.compile_name}.mobi' ./publish/mobi/"
56
- system "rm '#{@book.compile_name}.epub'"
92
+ cmd = "{ #{binpath} \"#{@book.compile_name}.epub\""
93
+ cmd += " && mv \"#{@book.compile_name}.mobi\" ./publish/mobi/"
94
+ cmd += " && rm \"#{@book.compile_name}.epub\"; } > kindlegen.log 2>&1"
95
+
96
+ if system(cmd)
97
+ puts "OK"
98
+ else
99
+ puts "Error. See kindlegen.log"
100
+ exit 2
101
+ end
102
+
103
+ # Stripping extra source
104
+ print "Stripping the SRCS record (source files) from the Mobi with Kindlestrip... "
105
+
106
+ binpath = File.expand_path(File.join(__FILE__, '..', '..', '..', 'bin/kindlestrip.py'))
107
+ cmd = "{ #{binpath} \"./publish/mobi/#{@book.compile_name}.mobi\" \"./publish/mobi/#{@book.compile_name}.stripped.mobi\""
108
+ cmd += " && mv \"./publish/mobi/#{@book.compile_name}.stripped.mobi\" \"./publish/mobi/#{@book.compile_name}.mobi\"; } > kindlestrip.log 2>&1"
109
+
110
+ if system(cmd)
111
+ puts "OK"
112
+ puts "Find the Mobi file in ./publish/mobi"
113
+ else
114
+ puts "Error. See kindlestrip.log"
115
+ exit 2
116
+ end
117
+
57
118
  end
58
119
 
59
120
  desc "pdf", "generate PDF with LaTeX"
@@ -1,3 +1,3 @@
1
1
  module Prophecy
2
- VERSION = "0.0.1"
2
+ VERSION = "0.1.2"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: prophecy
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gambhiro
@@ -196,11 +196,14 @@ description: Book boilerplate for generating PDF, EPUB and MOBI
196
196
  email:
197
197
  - gambhiro@ratanagiri.org.uk
198
198
  executables:
199
+ - epubcheck
199
200
  - kindlegen
200
201
  - kindlegen.exe
201
202
  - kindlegen_linux
202
203
  - kindlegen_mac
204
+ - kindlestrip.py
203
205
  - prophecy
206
+ - zip.exe
204
207
  extensions: []
205
208
  extra_rdoc_files: []
206
209
  files:
@@ -210,16 +213,33 @@ files:
210
213
  - Overview.md
211
214
  - README.md
212
215
  - Rakefile
216
+ - bin/epubcheck
213
217
  - bin/kindlegen
214
218
  - bin/kindlegen.exe
215
219
  - bin/kindlegen_linux
216
220
  - bin/kindlegen_mac
221
+ - bin/kindlestrip.py
217
222
  - bin/prophecy
223
+ - bin/zip.exe
224
+ - docs/licenses/epubcheck/COPYING.txt
225
+ - docs/licenses/epubcheck/README.txt
226
+ - docs/licenses/epubcheck/jing_license.txt
218
227
  - docs/licenses/kindlegen/.empty_directory
219
228
  - docs/licenses/kindlegen/EULA.txt
220
229
  - docs/licenses/kindlegen/KindleGen Legal Notices 2009-11-10 Linux.txt
221
230
  - docs/licenses/kindlegen/KindleGen Legal Notices 2009-11-10 Mac.txt
222
231
  - docs/licenses/kindlegen/KindleGen OSS Notices 2009-07-29-Windows.txt
232
+ - docs/licenses/zip/Contents
233
+ - docs/licenses/zip/LICENSE
234
+ - docs/licenses/zip/README
235
+ - docs/licenses/zip/README.CR
236
+ - docs/licenses/zip/WHATSNEW
237
+ - docs/licenses/zip/WHERE
238
+ - docs/licenses/zip/zip.txt
239
+ - docs/licenses/zip/zip30.ann
240
+ - epubcheck_dir/epubcheck.jar
241
+ - epubcheck_dir/lib/jing.jar
242
+ - epubcheck_dir/lib/saxon.jar
223
243
  - features/assets.feature
224
244
  - features/book.feature
225
245
  - features/generator.feature