Skip to content

Commit

Permalink
call parent.
Browse files Browse the repository at this point in the history
  • Loading branch information
kmuto committed Dec 19, 2010
1 parent 3993739 commit 9b66bfe
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
12 changes: 6 additions & 6 deletions lib/epubmaker/epubv2.rb
Expand Up @@ -348,20 +348,20 @@ def mytoc
# +basedir+ points the directory has contents.
# +tmpdir+ defines temporary directory.
def produce(epubfile, basedir, tmpdir)
File.open("#{tmpdir}/mimetype", "w") {|f| mimetype(f) }
File.open("#{tmpdir}/mimetype", "w") {|f| @producer.mimetype(f) }

Dir.mkdir("#{tmpdir}/META-INF") unless File.exist?("#{tmpdir}/META-INF")
File.open("#{tmpdir}/META-INF/container.xml", "w") {|f| container(f) }
File.open("#{tmpdir}/META-INF/container.xml", "w") {|f| @producer.container(f) }

Dir.mkdir("#{tmpdir}/OEBPS") unless File.exist?("#{tmpdir}/OEBPS")
File.open("#{tmpdir}/OEBPS/#{@producer.params["bookname"]}.opf", "w") {|f| opf(f) }
File.open("#{tmpdir}/OEBPS/#{@producer.params["bookname"]}.ncx", "w") {|f| ncx(f, @producer.params["ncxindent"]) }
File.open("#{tmpdir}/OEBPS/#{@producer.params["tocfile"]}", "w") {|f| mytoc(f) } unless @producer.params["mytoc"].nil?
File.open("#{tmpdir}/OEBPS/#{@producer.params["bookname"]}.opf", "w") {|f| @producer.opf(f) }
File.open("#{tmpdir}/OEBPS/#{@producer.params["bookname"]}.ncx", "w") {|f| @producer.ncx(f, @producer.params["ncxindent"]) }
File.open("#{tmpdir}/OEBPS/#{@producer.params["tocfile"]}", "w") {|f| @producer.mytoc(f) } unless @producer.params["mytoc"].nil?

if File.exist?("#{basedir}/#{@producer.params["cover"]}")
FileUtils.cp("#{basedir}/#{@producer.params["cover"]}", "#{tmpdir}/OEBPS")
else
File.open("#{tmpdir}/OEBPS/#{@producer.params["cover"]}", "w") {|f| cover(f) }
File.open("#{tmpdir}/OEBPS/#{@producer.params["cover"]}", "w") {|f| @producer.cover(f) }
end

# FIXME:colophon and titlepage should be included in @producer.contents.
Expand Down
2 changes: 1 addition & 1 deletion lib/epubmaker/producer.rb
Expand Up @@ -28,7 +28,7 @@ class Producer
attr_accessor :res

# Take YAML +file+ and return parameter hash.
def EPUBMaker.load(file)
def Producer.load(file)
raise "Can't open #{yamlfile}." if file.nil? || !File.exist?(file)
return YAML.load_file(file)
end
Expand Down

0 comments on commit 9b66bfe

Please sign in to comment.