Permalink
Browse files

Doing some more work on getting the Rakefile doing as it should

  • Loading branch information...
Phill@Work Phill@Work
Phill@Work authored and Phill@Work committed Nov 3, 2008
1 parent 4932062 commit 2542d29b1c041dc1b85610c7794cc74b75e8e9e7
Showing with 31 additions and 38 deletions.
  1. +28 −38 Rakefile
  2. +3 −0 lib/gedcom.rb
View
@@ -14,76 +14,66 @@ require 'gedcom'
full_name = "GEDCOM-Ruby"
short_name = full_name.downcase
+#
# Many of these tasks came from the ruby-hl7 project rakefile
+#
-desc 'Default: run unit tests.'
-task :default => :test
+desc 'Default: Run RSpec Tests'
+task :default => :spec
# Gem Specification
spec = Gem::Specification.new do |s|
s.name = short_name
- s.full_name
- s.version = HL7::VERSION
- s.author = "Mark Guzman"
- s.email = "segfault@hasno.info"
+ s.version = GEDCOM::VERSION
+ s.author = "Phillip Davies"
+ s.email = "fcdradio@gmail.com"
+ # Need to get the RubyForge project set up !!! PCD
s.homepage = "http://rubyforge.org/ruby-hl7"
s.platform = Gem::Platform::RUBY
- s.summary = "Ruby HL7 Library"
+ s.summary = "Ruby GEDCOM Parser Library"
s.rubyforge_project = short_name
- s.description = "A simple library to parse and generate HL7 2.x messages"
- s.files = FileList["{bin,lib,test_data}/**/*"].to_a
+ s.description = "A simple library to enable the parsing of GEDCOM data files"
+ s.files = FileList["{lib,ext,samples,tests}/**/*"].to_a
s.require_path = "lib"
s.autorequire = short_name
- s.test_files = FileList["{test}/**/test*.rb"].to_a
- s.has_rdoc = true
- s.extra_rdoc_files = %w[README LICENSE]
+ s.test_files = FileList["{tests}/**/*_spec.rb"].to_a
+ s.has_rdoc = false
+ s.extra_rdoc_files = %w[README COPYING]
s.add_dependency("rake", ">= #{RAKEVERSION}")
s.add_dependency("rubyforge", ">= #{::RubyForge::VERSION}")
end
# Gem Task
Rake::GemPackageTask.new(spec) do |pkg|
pkg.need_tar = true
+ pkg.package_dir_path = "pkg/"
end
-# Test Task
-Rake::TestTask.new do |t|
- t.test_files = FileList[ 'test/test*.rb', 'test/*test.rb' ]
- t.verbose = true
+# RSpec Test Task
+desc 'Run all RSpec tests'
+Spec::Rake::SpecTask.new do |t|
+ t.spec_files = FileList['tests/*_spec.rb']
end
-namespace :test do
- desc 'Measures test coverage'
- task :coverage do
- rm_f "coverage"
- rm_f "coverage.data"
- rcov = "rcov --aggregate coverage.data --text-summary -Ilib"
- system("#{rcov} --html test/test*.rb")
- system("open coverage/index.html") if PLATFORM['darwin']
+namespace :spec do
+ desc 'Run all RSpec tests with RCov to measure coverage'
+ Spec::Rake::SpecTask.new('spec_with_rcov') do |t|
+ t.warning = true
+ t.spec_files = FileList['tests/*_spec.rb']
+ t.rcov = true
end
desc 'Heckle the tests'
task :heckle do
- system("spec tests/* --heckle GEDCOM::DatePart")
- system("spec tests/* --heckle GEDCOM::Date")
- end
-
- desc 'Show which test files fail when run alone.'
- task :deps do
- tests = Dir["test/**/test_*.rb"] + Dir["test/**/*_test.rb"]
-
- tests.each do |test|
- if not system "ruby -Ibin:lib:test #{test} &> /dev/null" then
- puts "Dependency Issues: #{test}"
- end
- end
+ system("spec tests/*_spec.rb --heckle GEDCOM::DatePart")
+ system("spec tests/*_spec.rb --heckle GEDCOM::Date")
end
end
# Clean up Task
desc 'Clean up all the extras'
-task :clean => [ :clobber_rdoc, :clobber_package ] do
+task :clean => [ :clobber_package ] do
%w[*.gem ri coverage*].each do |pattern|
files = Dir[pattern]
rm_rf files unless files.empty?
View
3 lib/gedcom.rb 100644 → 100755
@@ -22,6 +22,9 @@
module GEDCOM
+ # Possibly a better way to do this?
+ VERSION = "0.0.1"
+
class Parser
def defaultHandler( data, cookie, parm )
end

0 comments on commit 2542d29

Please sign in to comment.