Permalink
Browse files

First step towards supporting Rails3. Modernize, fix test for 1.9

  • Loading branch information...
1 parent a694e0a commit 2aff9ead25e40964d2d81fb3967ed191690d8843 Bruce Williams committed Apr 16, 2010
View
@@ -0,0 +1,5 @@
+README.rdoc
+lib/**/*.rb
+bin/*
+features/**/*.feature
+LICENSE
View
@@ -0,0 +1,21 @@
+## MAC OS
+.DS_Store
+
+## TEXTMATE
+*.tmproj
+tmtags
+
+## EMACS
+*~
+\#*
+.\#*
+
+## VIM
+*.swp
+
+## PROJECT::GENERAL
+coverage
+rdoc
+pkg
+
+## PROJECT::SPECIFIC
View
@@ -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
View
@@ -0,0 +1 @@
+3.0.0
@@ -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
@@ -23,4 +18,4 @@ def document(name, options={})
end
end
-
+
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) << '/test_helper'
+require 'helper'
class DocumentTest < Test::Unit::TestCase
@@ -83,4 +83,4 @@ def @obj.to_s
end
-end
+end
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) << '/test_helper'
+require 'helper'
class FilterTest < Test::Unit::TestCase
@@ -21,4 +21,4 @@ class FilterTest < Test::Unit::TestCase
end
-end
+end
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) << '/test_helper'
+require 'helper'
class TempdirTest < Test::Unit::TestCase
@@ -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
@@ -64,4 +65,4 @@ class TempdirTest < Test::Unit::TestCase
end
-end
+end

0 comments on commit 2aff9ea

Please sign in to comment.