@@ -14,76 +14,66 @@ require 'gedcom'
14
14
full_name = "GEDCOM-Ruby"
15
15
short_name = full_name . downcase
16
16
17
+ #
17
18
# Many of these tasks came from the ruby-hl7 project rakefile
19
+ #
18
20
19
- desc 'Default: run unit tests.'
20
- task :default => :test
21
+ desc 'Default: Run RSpec Tests'
22
+ task :default => :spec
21
23
22
24
# Gem Specification
23
25
spec = Gem ::Specification . new do |s |
24
26
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
29
31
s . homepage = "http://rubyforge.org/ruby-hl7"
30
32
s . platform = Gem ::Platform ::RUBY
31
- s . summary = "Ruby HL7 Library"
33
+ s . summary = "Ruby GEDCOM Parser Library"
32
34
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
35
37
s . require_path = "lib"
36
38
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 ]
40
42
s . add_dependency ( "rake" , ">= #{ RAKEVERSION } " )
41
43
s . add_dependency ( "rubyforge" , ">= #{ ::RubyForge ::VERSION } " )
42
44
end
43
45
44
46
# Gem Task
45
47
Rake ::GemPackageTask . new ( spec ) do |pkg |
46
48
pkg . need_tar = true
49
+ pkg . package_dir_path = "pkg/"
47
50
end
48
51
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' ]
53
56
end
54
57
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
63
64
end
64
65
65
66
desc 'Heckle the tests'
66
67
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" )
80
70
end
81
71
end
82
72
83
73
84
74
# Clean up Task
85
75
desc 'Clean up all the extras'
86
- task :clean => [ :clobber_rdoc , : clobber_package ] do
76
+ task :clean => [ :clobber_package ] do
87
77
%w[ *.gem ri coverage* ] . each do |pattern |
88
78
files = Dir [ pattern ]
89
79
rm_rf files unless files . empty?
0 commit comments