Skip to content

Commit 2542d29

Browse files
Phill@WorkPhill@Work
authored andcommitted
Doing some more work on getting the Rakefile doing as it should
1 parent 4932062 commit 2542d29

File tree

2 files changed

+31
-38
lines changed

2 files changed

+31
-38
lines changed

Rakefile

Lines changed: 28 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -14,76 +14,66 @@ require 'gedcom'
1414
full_name = "GEDCOM-Ruby"
1515
short_name = full_name.downcase
1616

17+
#
1718
# Many of these tasks came from the ruby-hl7 project rakefile
19+
#
1820

19-
desc 'Default: run unit tests.'
20-
task :default => :test
21+
desc 'Default: Run RSpec Tests'
22+
task :default => :spec
2123

2224
# Gem Specification
2325
spec = Gem::Specification.new do |s|
2426
s.name = short_name
25-
s.full_name
26-
s.version = HL7::VERSION
27-
s.author = "Mark Guzman"
28-
s.email = "segfault@hasno.info"
27+
s.version = GEDCOM::VERSION
28+
s.author = "Phillip Davies"
29+
s.email = "fcdradio@gmail.com"
30+
# Need to get the RubyForge project set up !!! PCD
2931
s.homepage = "http://rubyforge.org/ruby-hl7"
3032
s.platform = Gem::Platform::RUBY
31-
s.summary = "Ruby HL7 Library"
33+
s.summary = "Ruby GEDCOM Parser Library"
3234
s.rubyforge_project = short_name
33-
s.description = "A simple library to parse and generate HL7 2.x messages"
34-
s.files = FileList["{bin,lib,test_data}/**/*"].to_a
35+
s.description = "A simple library to enable the parsing of GEDCOM data files"
36+
s.files = FileList["{lib,ext,samples,tests}/**/*"].to_a
3537
s.require_path = "lib"
3638
s.autorequire = short_name
37-
s.test_files = FileList["{test}/**/test*.rb"].to_a
38-
s.has_rdoc = true
39-
s.extra_rdoc_files = %w[README LICENSE]
39+
s.test_files = FileList["{tests}/**/*_spec.rb"].to_a
40+
s.has_rdoc = false
41+
s.extra_rdoc_files = %w[README COPYING]
4042
s.add_dependency("rake", ">= #{RAKEVERSION}")
4143
s.add_dependency("rubyforge", ">= #{::RubyForge::VERSION}")
4244
end
4345

4446
# Gem Task
4547
Rake::GemPackageTask.new(spec) do |pkg|
4648
pkg.need_tar = true
49+
pkg.package_dir_path = "pkg/"
4750
end
4851

49-
# Test Task
50-
Rake::TestTask.new do |t|
51-
t.test_files = FileList[ 'test/test*.rb', 'test/*test.rb' ]
52-
t.verbose = true
52+
# RSpec Test Task
53+
desc 'Run all RSpec tests'
54+
Spec::Rake::SpecTask.new do |t|
55+
t.spec_files = FileList['tests/*_spec.rb']
5356
end
5457

55-
namespace :test do
56-
desc 'Measures test coverage'
57-
task :coverage do
58-
rm_f "coverage"
59-
rm_f "coverage.data"
60-
rcov = "rcov --aggregate coverage.data --text-summary -Ilib"
61-
system("#{rcov} --html test/test*.rb")
62-
system("open coverage/index.html") if PLATFORM['darwin']
58+
namespace :spec do
59+
desc 'Run all RSpec tests with RCov to measure coverage'
60+
Spec::Rake::SpecTask.new('spec_with_rcov') do |t|
61+
t.warning = true
62+
t.spec_files = FileList['tests/*_spec.rb']
63+
t.rcov = true
6364
end
6465

6566
desc 'Heckle the tests'
6667
task :heckle do
67-
system("spec tests/* --heckle GEDCOM::DatePart")
68-
system("spec tests/* --heckle GEDCOM::Date")
69-
end
70-
71-
desc 'Show which test files fail when run alone.'
72-
task :deps do
73-
tests = Dir["test/**/test_*.rb"] + Dir["test/**/*_test.rb"]
74-
75-
tests.each do |test|
76-
if not system "ruby -Ibin:lib:test #{test} &> /dev/null" then
77-
puts "Dependency Issues: #{test}"
78-
end
79-
end
68+
system("spec tests/*_spec.rb --heckle GEDCOM::DatePart")
69+
system("spec tests/*_spec.rb --heckle GEDCOM::Date")
8070
end
8171
end
8272

8373

8474
# Clean up Task
8575
desc 'Clean up all the extras'
86-
task :clean => [ :clobber_rdoc, :clobber_package ] do
76+
task :clean => [ :clobber_package ] do
8777
%w[*.gem ri coverage*].each do |pattern|
8878
files = Dir[pattern]
8979
rm_rf files unless files.empty?

lib/gedcom.rb

100644100755
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@
2222

2323
module GEDCOM
2424

25+
# Possibly a better way to do this?
26+
VERSION = "0.0.1"
27+
2528
class Parser
2629
def defaultHandler( data, cookie, parm )
2730
end

0 commit comments

Comments
 (0)