Skip to content

Commit

Permalink
Restore some sense of sanity to this project
Browse files Browse the repository at this point in the history
* add bundler
* remove turn, leftright gems since they caused nothing but trouble on 1.9
* get tests passing, thanks to @eee-c not-handbookish branch
  • Loading branch information
nickrivadeneira committed Sep 16, 2011
1 parent 6641024 commit cb9428c
Show file tree
Hide file tree
Showing 8 changed files with 42 additions and 17 deletions.
2 changes: 2 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
source :rubygems
gemspec
22 changes: 22 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
PATH
remote: .
specs:
git-scribe (0.0.9)
liquid
nokogiri

GEM
remote: http://rubygems.org/
specs:
liquid (2.2.2)
nokogiri (1.5.0)
rake (0.9.2)
test-unit (2.3.2)

PLATFORMS
ruby

DEPENDENCIES
git-scribe!
rake
test-unit
9 changes: 5 additions & 4 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,13 @@ end

task :default => :test

desc "Run the test suite"
task :test do
sh('turn test/**/*_test.rb')
require 'rake/testtask'
Rake::TestTask.new do |t|
t.libs << "test"
t.test_files = FileList['test/*_test.rb']
t.verbose = true
end


#
# Publishing
#
Expand Down
2 changes: 2 additions & 0 deletions git-scribe.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ Gem::Specification.new do |s|

s.add_dependency('nokogiri')
s.add_dependency('liquid')
s.add_development_dependency("rake")
s.add_development_dependency("test-unit")

s.executables = %w( git-scribe )

Expand Down
4 changes: 2 additions & 2 deletions lib/git-scribe/generate.rb
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ def a2x(type)
end

def a2x_wss(type)
a2x(type) + " --stylesheet=stylesheets/handbookish.css"
a2x(type) + " --stylesheet=stylesheets/scribe.css"
end

def do_docbook
Expand Down Expand Up @@ -109,7 +109,7 @@ def do_site
# TODO: check if html was already done
ex("asciidoc -b docbook #{BOOK_FILE}")
xsldir = base('docbook-xsl/xhtml')
ex("xsltproc --stringparam html.stylesheet stylesheets/handbookish.css --nonet #{xsldir}/chunk.xsl book.xml")
ex("xsltproc --stringparam html.stylesheet stylesheets/scribe.css --nonet #{xsldir}/chunk.xsl book.xml")

source = File.read('index.html')
html = Nokogiri::HTML.parse(source, nil, 'utf-8')
Expand Down
4 changes: 2 additions & 2 deletions test/check_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@
assert_equal status.size, 6
end

# there no option '-version' for apache fop cli
# there no option '-failboat' for apache fop cli
# it accepts only '-v' option but doesn't exit immediately.
# it should be additional no-op flag provided (like '-out list')
#
# see http://svn.apache.org/repos/asf/xmlgraphics/fop/trunk/src/java/org/apache/fop/cli/CommandLineOptions.java
test "scribe should correctly check fop availability" do
assert_equal @scribe.check_can_run('fop -v -out list'), true
assert_equal @scribe.check_can_run('fop -v'), false
assert_equal @scribe.check_can_run('fop -version'), false
assert_equal @scribe.check_can_run('fop -failboat'), false
end
end
6 changes: 3 additions & 3 deletions test/gen_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
out = Dir.glob('output/**/*')
assert out.include? 'output/book.html'
assert out.include? 'output/image'
assert out.include? 'output/stylesheets/handbookish.css'
assert out.include? 'output/stylesheets/scribe.css'
end
end
end
Expand All @@ -35,7 +35,7 @@
assert out.include? 'output/the_first_chapter.html'
assert out.include? 'output/the_second_chapter.html'
assert out.include? 'output/image'
assert out.include? 'output/stylesheets/handbookish.css'
assert out.include? 'output/stylesheets/scribe.css'
end
end
end
Expand All @@ -57,7 +57,7 @@
@scribe.init('t')
Dir.chdir('t') do
data = @scribe.gen('epub')
assert_equal data, 'book.epub'
assert_equal 'book.epub', data
out = Dir.glob('output/**/*')
assert out.include? 'output/book.epub'
end
Expand Down
10 changes: 4 additions & 6 deletions test/test_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,15 @@
$LOAD_PATH.unshift dir + '/../lib'
$TESTING = true

require 'test/unit'
# Necessary to override stdlib: http://www.ruby-forum.com/topic/212974
require 'rubygems'
gem 'test-unit'
require 'test/unit'

require 'git-scribe'
require 'pp'
require 'tempfile'

begin
require 'leftright'
rescue LoadError
end

##
# test/spec/mini 3
# http://gist.github.com/25455
Expand Down

0 comments on commit cb9428c

Please sign in to comment.