Skip to content
This repository has been archived by the owner on Dec 28, 2017. It is now read-only.

Commit

Permalink
renamed CheckEpub class and methods
Browse files Browse the repository at this point in the history
  • Loading branch information
Mike Cook committed Nov 17, 2011
1 parent ebe54ba commit 4ac7798
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 19 deletions.
5 changes: 3 additions & 2 deletions lib/epub_validator.rb
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
Dir["#{File.dirname(__FILE__)}/epub_validator/**/*"].each {|file| require(file)}

require 'epub_validator/epub_check'
require 'epub_validator/process_epub'

module EpubValidator
def self.check(filename)
EpubCheck.process(filename)
check = ProcessEpub.new
check.epubcheck(filename)
end
end

Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
module EpubValidator
class EpubCheck
def self.epubcheck(filename)
class ProcessEpub
def epubcheck(filename)
epubcheck_jar = File.expand_path(File.dirname(__FILE__) + '/../epubcheck-1-2/epubcheck-1.2.jar')
`java -jar #{epubcheck_jar} "#{epubfile}" 2>&1`
`java -jar #{epubcheck_jar} "#{filename}" 2>&1`
end
end
end
14 changes: 0 additions & 14 deletions spec/epub_validator/epub_check_spec.rb

This file was deleted.

14 changes: 14 additions & 0 deletions spec/epub_validator/process_epub_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
require 'spec_helper'

module EpubValidator
describe ProcessEpub do
context "when it processes a file" do
it "should return a message" do
message = "Epubcheck Version 1.2\n\nERROR: rspec-test.epub: resource OEBPS/stylesheets/handbookish.css is missing\n\nCheck finished with warnings or errors!"
ec = ProcessEpub.new
ec.stub(:epubcheck).and_return(message)
ec.epubcheck("test.epub").should eq(message)
end
end
end
end

0 comments on commit 4ac7798

Please sign in to comment.