pubgen 0.2.0 → 0.2.1

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -74,7 +74,7 @@ metadata:
74
74
  # See http://idpf.org/epub/20/spec/OPF_2.0.1_draft.htm#Section2.6
75
75
  #
76
76
  # If you provide cover-image without cover-page, pubgen automatically
77
- # generate cover-page xhtml, and add it to manifest and spine.
77
+ # generates cover-page xhtml, and add it to manifest and spine.
78
78
  guide:
79
79
  toc-page:
80
80
  title-page:
@@ -87,7 +87,7 @@ guide:
87
87
  # See http://idpf.org/epub/20/spec/OPF_2.0.1_draft.htm#Section2.3
88
88
  #
89
89
  # All the file paths in manifest ought to be relative to yaml's path and in the
90
- # same or sub-directory of yaml. Say yaml's path is /book/a.yaml.
90
+ # same or sub-directory of yaml file. Say yaml's path is /book/a.yaml.
91
91
  # - a/b/c.html # good. in the sub-directory
92
92
  # - d.jpg # good. in the same directory
93
93
  # - ./e.jpg # good. in the same directory
data/Rakefile CHANGED
@@ -15,7 +15,7 @@ def sh_echo_off(cmd)
15
15
  raise "Failed: #{cmd}" unless $?.success?
16
16
  end
17
17
 
18
- def sh_echo_off_failure(cmd)
18
+ def sh_failure_echo_off(cmd)
19
19
  %x[#{cmd} > /dev/null 2>&1]
20
20
  raise "Not failed: #{cmd}" if $?.success?
21
21
  end
@@ -24,13 +24,13 @@ $tmpdir = '.rake_test'
24
24
 
25
25
  task :test_bad_options => :test_toc_2 do |t|
26
26
  $stdout << "# task: #{t} => "
27
- sh_echo_off_failure("bin/pubgen -t x.html -o a.epub")
28
- sh_echo_off_failure("bin/pubgen -t x.html -m")
29
- sh_echo_off_failure("bin/pubgen -o x.epub -m")
30
- sh_echo_off_failure("bin/pubgen")
31
- sh_echo_off_failure("bin/pubgen -t x.html")
32
- sh_echo_off_failure("bin/pubgen -o")
33
- sh_echo_off_failure("bin/pubgen -t")
27
+ sh_failure_echo_off("bin/pubgen -t x.html -o a.epub")
28
+ sh_failure_echo_off("bin/pubgen -t x.html -m")
29
+ sh_failure_echo_off("bin/pubgen -o x.epub -m")
30
+ sh_failure_echo_off("bin/pubgen")
31
+ sh_failure_echo_off("bin/pubgen -t x.html")
32
+ sh_failure_echo_off("bin/pubgen -o")
33
+ sh_failure_echo_off("bin/pubgen -t")
34
34
  puts "done!"
35
35
  end
36
36
 
data/lib/pubgen/opf.rb CHANGED
@@ -2,7 +2,7 @@ require 'cgi'
2
2
 
3
3
  module Pubgen
4
4
  module OPF
5
- # Returns opf file path.
5
+ # Returns the NCX file path.
6
6
  def self.ncx_path
7
7
  'toc.ncx'
8
8
  end
@@ -1,4 +1,4 @@
1
1
  module Pubgen
2
2
  # Version of pubgen
3
- VERSION = "0.2.0"
3
+ VERSION = "0.2.1"
4
4
  end
data/lib/pubgen/yaml.rb CHANGED
@@ -76,7 +76,7 @@ EOF
76
76
 
77
77
  # href is relative to index.html, so we need to change it relative to
78
78
  # epub_root
79
- abspath = File.absolute_path(File.join(File.dirname(toc_html), path))
79
+ abspath = File.expand_path(File.join(File.dirname(toc_html), path))
80
80
  rpath = subpath2basepath(abspath, epub_root)
81
81
  next if rpath == nil
82
82
  # toc paths should be sub-set of manifest
@@ -117,11 +117,11 @@ EOF
117
117
  return "#{manifest}\n#{spine}\n#{toc}"
118
118
  end
119
119
 
120
- # Returns relative path of input path to base_pase. It's a private method.
120
+ # Returns the relative path of input path to base_pase. It's private.
121
121
  def self.subpath2basepath(path, base_path)
122
- if File.absolute_path(path).include?(File.absolute_path(base_path))
123
- return File.absolute_path(path)[
124
- File.absolute_path(base_path).size + 1..-1]
122
+ if File.expand_path(path).include?(File.expand_path(base_path))
123
+ return File.expand_path(path)[
124
+ File.expand_path(base_path).size + 1..-1]
125
125
  else
126
126
  return nil
127
127
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pubgen
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-03-04 00:00:00.000000000Z
12
+ date: 2012-03-05 00:00:00.000000000Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: zipruby
16
- requirement: &7467220 !ruby/object:Gem::Requirement
16
+ requirement: &18025420 !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: *7467220
24
+ version_requirements: *18025420
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: hpricot
27
- requirement: &7466800 !ruby/object:Gem::Requirement
27
+ requirement: &18025000 !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: *7466800
35
+ version_requirements: *18025000
36
36
  description: Pubgen is a command-line based epub generator. Make an epub with YAML.
37
37
  email:
38
38
  - 9beach@gmail.com