Skip to content

Commit

Permalink
First step towards supporting Rails3. Modernize, fix test for 1.9
Browse files Browse the repository at this point in the history
  • Loading branch information
Bruce Williams committed Apr 16, 2010
1 parent a694e0a commit 2aff9ea
Show file tree
Hide file tree
Showing 8 changed files with 87 additions and 33 deletions.
5 changes: 5 additions & 0 deletions .document
@@ -0,0 +1,5 @@
README.rdoc
lib/**/*.rb
bin/*
features/**/*.feature
LICENSE
21 changes: 21 additions & 0 deletions .gitignore
@@ -0,0 +1,21 @@
## MAC OS
.DS_Store

## TEXTMATE
*.tmproj
tmtags

## EMACS
*~
\#*
.\#*

## VIM
*.swp

## PROJECT::GENERAL
coverage
rdoc
pkg

## PROJECT::SPECIFIC
63 changes: 47 additions & 16 deletions Rakefile
@@ -1,22 +1,53 @@
require 'rubygems'
require 'echoe'
require 'rake'

require File.dirname(__FILE__) << "/lib/rtex/version"
begin
require 'jeweler'
Jeweler::Tasks.new do |gem|
gem.name = "rtex"
gem.summary = "Build PDFs from Ruby with LaTeX"
gem.description = "Build PDFs from Ruby with LaTeX (with commandline and Rack support)"
gem.email = "bruce@codefluency.com"
gem.homepage = "http://github.com/bruce/rtex"
gem.authors = ['Bruce Williams', 'Wiebe Cazemier']
gem.add_development_dependency "shoulda"
gem.add_development_dependency "flexmock"
end
Jeweler::GemcutterTasks.new
rescue LoadError
puts "Jeweler (or a dependency) not available. Install it with: gem install jeweler"
end

require 'rake/testtask'
Rake::TestTask.new(:test) do |test|
test.libs << 'lib' << 'test'
test.pattern = 'test/**/test_*.rb'
test.verbose = true
end

Echoe.new 'rtex' do |p|
p.version = RTeX::Version::STRING
p.author = ['Bruce Williams', 'Wiebe Cazemier']
p.email = 'bruce@codefluency.com'
p.project = 'rtex'
p.summary = "LaTeX preprocessor for PDF generation; Rails plugin"
p.url = "http://rtex.rubyforge.org"
p.include_rakefile = true
p.development_dependencies = %w(Shoulda echoe)
p.rcov_options = '--exclude gems --exclude version.rb --sort coverage --text-summary --html -o coverage'
p.ignore_pattern = /^(pkg|doc|site)|\.svn|CVS|\.bzr|\.DS|\.git/
p.rubygems_version = nil
begin
require 'rcov/rcovtask'
Rcov::RcovTask.new do |test|
test.libs << 'test'
test.pattern = 'test/**/test_*.rb'
test.verbose = true
end
rescue LoadError
task :rcov do
abort "RCov is not available. In order to run rcov, you must: sudo gem install spicycode-rcov"
end
end

task :coverage do
system "open coverage/index.html" if PLATFORM['darwin']
task :test => :check_dependencies

task :default => :test

require 'rake/rdoctask'
Rake::RDocTask.new do |rdoc|
version = File.exist?('VERSION') ? File.read('VERSION') : ""

rdoc.rdoc_dir = 'rdoc'
rdoc.title = "rtex #{version}"
rdoc.rdoc_files.include('README*')
rdoc.rdoc_files.include('lib/**/*.rb')
end
1 change: 1 addition & 0 deletions VERSION
@@ -0,0 +1 @@
3.0.0
13 changes: 4 additions & 9 deletions test/test_helper.rb → test/helper.rb
@@ -1,14 +1,9 @@
require 'test/unit'

require 'rubygems'
begin
require 'shoulda'
require 'flexmock/test_unit'
rescue LoadError
abort "the `Shoulda' and `flexmock' gems are required for testing"
end
require 'shoulda'
require 'flexmock/test_unit'

require File.dirname(__FILE__) << '/../lib/rtex'
require 'rtex'

class Test::Unit::TestCase

Expand All @@ -23,4 +18,4 @@ def document(name, options={})
end

end


4 changes: 2 additions & 2 deletions test/document_test.rb → test/test_document.rb
@@ -1,4 +1,4 @@
require File.dirname(__FILE__) << '/test_helper'
require 'helper'

class DocumentTest < Test::Unit::TestCase

Expand Down Expand Up @@ -83,4 +83,4 @@ def @obj.to_s

end

end
end
4 changes: 2 additions & 2 deletions test/filter_test.rb → test/test_filter.rb
@@ -1,4 +1,4 @@
require File.dirname(__FILE__) << '/test_helper'
require 'helper'

class FilterTest < Test::Unit::TestCase

Expand All @@ -21,4 +21,4 @@ class FilterTest < Test::Unit::TestCase

end

end
end
9 changes: 5 additions & 4 deletions test/tempdir_test.rb → test/test_tempdir.rb
@@ -1,4 +1,4 @@
require File.dirname(__FILE__) << '/test_helper'
require 'helper'

class TempdirTest < Test::Unit::TestCase

Expand Down Expand Up @@ -42,11 +42,12 @@ class TempdirTest < Test::Unit::TestCase
end

should "return the result of the last statment if not automatically removing the directory" do
tempdir = nil # to capture value
td = nil # to capture value
result = RTeX::Tempdir.open do |tempdir|
td = tempdir
:last
end
tempdir.remove!
td.remove!
assert_equal :last, :last
end

Expand All @@ -64,4 +65,4 @@ class TempdirTest < Test::Unit::TestCase

end

end
end

0 comments on commit 2aff9ea

Please sign in to comment.