rabal 0.2.3 → 0.3.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (49) hide show
  1. data/{CHANGES → HISTORY} +23 -7
  2. data/README +96 -66
  3. data/bin/rabal +6 -7
  4. data/gemspec.rb +47 -0
  5. data/lib/rabal.rb +63 -19
  6. data/lib/rabal/application.rb +4 -4
  7. data/lib/rabal/plugin/foundation.rb +4 -3
  8. data/lib/rabal/version.rb +16 -14
  9. data/resources/trees/bin/rabal.project +7 -8
  10. data/resources/trees/core/HISTORY.erb +4 -0
  11. data/resources/trees/core/README.erb +6 -0
  12. data/resources/trees/core/Rakefile.erb +53 -7
  13. data/resources/trees/core/gemspec.rb.erb +48 -0
  14. data/resources/trees/core/lib/rabal.project.rb.erb +52 -20
  15. data/resources/trees/core/lib/rabal.project/version.rb.erb +21 -13
  16. data/resources/trees/core/tasks/announce.rake.erb +36 -54
  17. data/resources/trees/core/tasks/config.rb.erb +107 -0
  18. data/resources/trees/core/tasks/distribution.rake.erb +19 -13
  19. data/resources/trees/core/tasks/documentation.rake.erb +25 -19
  20. data/resources/trees/core/tasks/utils.rb.erb +80 -0
  21. data/resources/trees/ext/tasks/extension.rake.erb +42 -10
  22. data/resources/trees/rubyforge/tasks/rubyforge.rake.erb +48 -40
  23. data/resources/trees/spec/spec/rabal.project_spec.rb.erb +10 -10
  24. data/resources/trees/spec/tasks/rspec.rake.erb +23 -18
  25. data/resources/trees/test/tasks/testunit.rake.erb +14 -9
  26. data/resources/trees/test/test/rabal.project_test.rb.erb +6 -6
  27. data/resources/trees/website/tasks/site.rake.erb +5 -5
  28. data/spec/application_spec.rb +3 -3
  29. data/spec/bin_plugin_spec.rb +1 -1
  30. data/spec/core_plugin_spec.rb +1 -1
  31. data/spec/license_plugin_spec.rb +1 -1
  32. data/spec/plugin_tree_spec.rb +1 -1
  33. data/spec/spec_helper.rb +3 -6
  34. data/spec/spec_plugin_spec.rb +1 -1
  35. data/spec/test_plugin_spec.rb +1 -1
  36. data/tasks/announce.rake +40 -0
  37. data/tasks/config.rb +99 -0
  38. data/tasks/distribution.rake +45 -0
  39. data/tasks/documentation.rake +31 -0
  40. data/tasks/rspec.rake +29 -0
  41. data/tasks/rubyforge.rake +52 -0
  42. data/tasks/utils.rb +80 -0
  43. metadata +105 -59
  44. data/Rakefile +0 -12
  45. data/lib/rabal/specification.rb +0 -128
  46. data/resources/trees/core/CHANGES.erb +0 -4
  47. data/resources/trees/core/lib/rabal.project/gemspec.rb.erb +0 -51
  48. data/resources/trees/core/lib/rabal.project/specification.rb.erb +0 -128
  49. data/resources/trees/core/tasks/setup.rb.erb +0 -40
@@ -1,24 +1,29 @@
1
- require 'spec/rake/spectask'
2
1
 
3
- #-----------------------------------------------------------------------
4
- # Testing - this is either test or spec, include the appropriate one
5
- #-----------------------------------------------------------------------
6
- namespace :test do
2
+ require 'tasks/config'
7
3
 
8
- task :default => :spec
4
+ #--------------------------------------------------------------------------------
5
+ # configuration for running rspec. This shows up as the test:default task
6
+ #--------------------------------------------------------------------------------
7
+ if spec_config = Configuration.for_if_exist?("test") then
8
+ if spec_config.mode == "spec" then
9
+ namespace :test do
9
10
 
10
- Spec::Rake::SpecTask.new do |r|
11
- r.rcov = true
12
- r.rcov_dir = <%= project_name.camelize %>::SPEC.local_coverage_dir
13
- r.libs = <%= project_name.camelize %>::SPEC.require_paths
14
- r.spec_opts = %w(--format specdoc --color)
15
- end
11
+ task :default => :spec
12
+
13
+ require 'spec/rake/spectask'
14
+ Spec::Rake::SpecTask.new do |r|
15
+ r.ruby_opts = spec_config.ruby_opts
16
+ r.libs = [ <%= project_name.camelize %>.lib_path,
17
+ <%= project_name.camelize %>.root_dir ]
18
+ r.spec_files = spec_config.files
19
+ r.spec_opts = spec_config.options
16
20
 
17
- if HAVE_HEEL then
18
- desc "View the code coverage report locally"
19
- task :coverage => [:spec] do
20
- sh "heel --root #{<%= project_name.camelize %>::SPEC.local_coverage_dir}"
21
- end
21
+ if rcov_config = Configuration.for_if_exist?('rcov') then
22
+ r.rcov = true
23
+ r.rcov_dir = rcov_config.output_dir
24
+ r.rcov_opts = rcov_config.rcov_opts
25
+ end
26
+ end
22
27
  end
23
-
28
+ end
24
29
  end
@@ -1,14 +1,19 @@
1
- require 'rake/testtask'
2
- #-----------------------------------------------------------------------
3
- # Testing - this is either test or spec, include the appropriate one
4
- #-----------------------------------------------------------------------
5
- namespace :test do
1
+ require 'tasks/config'
2
+ #-------------------------------------------------------------------------------
3
+ # configuration for running unit tests. This shows up as the test:default task
4
+ #-------------------------------------------------------------------------------
6
5
 
7
- task :default => :test
6
+ if test_config = Configuration.for_if_exist?('test') then
7
+ if test_config.mode == "testunit" then
8
+ namespace :test do
8
9
 
9
- Rake::TestTask.new do |t|
10
- t.libs = <%= project_name.camelize %>::SPEC.require_paths
10
+ task :default => :test
11
+
12
+ require 'rake/testtask'
13
+ Rake::TestTask.new do |t|
14
+ t.libs = <%= project_name.camelize %>.lib_path
11
15
  t.test_files= FileList["test/**/*.rb"]
16
+ end
12
17
  end
13
-
18
+ end
14
19
  end
@@ -1,10 +1,10 @@
1
- require File.join(File.dirname(__FILE__),"test_helper.rb")
1
+ require File.expand_path(File.join(File.dirname(__FILE__),"test_helper.rb"))
2
2
 
3
3
  class Test<%= project_name.camelize %> < Test::Unit::TestCase
4
- def setup
5
- end
4
+ def setup
5
+ end
6
6
 
7
- def test_has_tests
8
- flunk("Oh Please test me!")
9
- end
7
+ def test_has_tests
8
+ flunk("Oh Please test me!")
9
+ end
10
10
  end
@@ -6,12 +6,12 @@ namespace :site do
6
6
 
7
7
  desc "Remove all the files from the local deployment of the site"
8
8
  task :clobber do
9
- rm_rf <%= project_name.camelize %>::SPEC.local_site_dir
9
+ rm_rf <%= project_name.camelize %>::GEM_SPEC.local_site_dir
10
10
  end
11
11
 
12
- desc "Update the website on #{<%= project_name.camelize %>::SPEC.remote_site_location}"
12
+ desc "Update the website on #{<%= project_name.camelize %>::GEM_SPEC.remote_site_location}"
13
13
  task :deploy => :build do
14
- sh "rsync -zav --delete #{<%= project_name.camelize %>::SPEC.local_site_dir}/ #{<%= project_name.camelize %>::SPEC.remote_site_location}"
14
+ sh "rsync -zav --delete #{<%= project_name.camelize %>::GEM_SPEC.local_site_dir}/ #{<%= project_name.camelize %>::GEM_SPEC.remote_site_location}"
15
15
  end
16
16
 
17
17
  if HAVE_WEBBY then
@@ -32,8 +32,8 @@ namespace :site do
32
32
  if HAVE_HEEL then
33
33
  desc "View the website locally"
34
34
  task :view => :build do
35
- sh "heel --root #{<%= project_name.camelize %>::SPEC.local_site_dir}"
35
+ sh "heel --root #{<%= project_name.camelize %>::GEM_SPEC.local_site_dir}"
36
36
  end
37
37
  end
38
38
 
39
- end
39
+ end
@@ -6,9 +6,9 @@ describe Rabal::Application do
6
6
  before(:each) do
7
7
  @working_dir = my_temp_dir
8
8
  @before = Dir.pwd
9
- @base_tree = Set.new(%w[README Rakefile CHANGES LICENSE
10
- lib lib/spec-proj lib/spec_proj.rb lib/spec-proj/version.rb lib/spec-proj/specification.rb lib/spec-proj/gemspec.rb
11
- tasks tasks/announce.rake tasks/distribution.rake tasks/documentation.rake tasks/setup.rb])
9
+ @base_tree = Set.new(%w[README Rakefile HISTORY LICENSE
10
+ lib lib/spec-proj lib/spec_proj.rb lib/spec-proj/version.rb gemspec.rb
11
+ tasks tasks/announce.rake tasks/distribution.rake tasks/documentation.rake tasks/config.rb tasks/utils.rb ])
12
12
  @stdin = StringIO.new
13
13
  @stdout = StringIO.new
14
14
  @stderr = StringIO.new
@@ -5,7 +5,7 @@ describe Rabal::Plugin::Bin do
5
5
  @working_dir = my_temp_dir
6
6
  @before = Dir.pwd
7
7
  @core = Rabal::Plugin::Core.new({:project => "new-spec-proj", :author => "Foo Bar", :email => "foobar@example.com"})
8
- @base_tree = Set.new(%w(README Rakefile CHANGES lib lib/new-spec-proj lib/new_spec_proj.rb lib/new-spec-proj/version.rb bin bin/new_spec_proj lib/new-spec-proj/specification.rb lib/new-spec-proj/gemspec.rb tasks tasks/setup.rb tasks/announce.rake tasks/distribution.rake tasks/documentation.rake))
8
+ @base_tree = Set.new(%w(README Rakefile HISTORY lib lib/new-spec-proj lib/new_spec_proj.rb lib/new-spec-proj/version.rb bin bin/new_spec_proj gemspec.rb tasks tasks/config.rb tasks/announce.rake tasks/distribution.rake tasks/documentation.rake tasks/utils.rb ))
9
9
  Dir.chdir(@working_dir)
10
10
  end
11
11
 
@@ -4,7 +4,7 @@ describe Rabal::Plugin::Core do
4
4
  @working_dir = my_temp_dir
5
5
  @before = Dir.pwd
6
6
  @core = Rabal::Plugin::Core.new({:project => "new-spec-proj", :author => "Foo Bar", :email => "foobar@example.com"})
7
- @base_tree = Set.new(%w(README Rakefile CHANGES lib lib/new-spec-proj lib/new_spec_proj.rb lib/new-spec-proj/version.rb lib/new-spec-proj/specification.rb lib/new-spec-proj/gemspec.rb tasks tasks/setup.rb tasks/announce.rake tasks/distribution.rake tasks/documentation.rake))
7
+ @base_tree = Set.new(%w(README Rakefile HISTORY lib lib/new-spec-proj lib/new_spec_proj.rb lib/new-spec-proj/version.rb gemspec.rb tasks tasks/config.rb tasks/announce.rake tasks/utils.rb tasks/distribution.rake tasks/documentation.rake))
8
8
  Dir.chdir(@working_dir)
9
9
  end
10
10
 
@@ -4,7 +4,7 @@ describe Rabal::Plugin::License do
4
4
  @working_dir = my_temp_dir
5
5
  @before = Dir.pwd
6
6
  @core = Rabal::Plugin::Core.new({:project => "new-spec-proj", :author => "Foo Bar", :email => "foobar@example.com"})
7
- @base_tree = Set.new(%w(README Rakefile CHANGES COPYING LICENSE lib lib/new-spec-proj lib/new_spec_proj.rb lib/new-spec-proj/version.rb lib/new-spec-proj/gemspec.rb lib/new-spec-proj/specification.rb tasks tasks/setup.rb tasks/announce.rake tasks/distribution.rake tasks/documentation.rake))
7
+ @base_tree = Set.new(%w(README Rakefile HISTORY COPYING LICENSE lib lib/new-spec-proj lib/new_spec_proj.rb lib/new-spec-proj/version.rb gemspec.rb tasks tasks/config.rb tasks/announce.rake tasks/distribution.rake tasks/documentation.rake tasks/utils.rb ))
8
8
  Dir.chdir(@working_dir)
9
9
  end
10
10
 
@@ -8,7 +8,7 @@ describe Rabal::PluginTree do
8
8
  @tree = ProjectTree.new('new-spec-proj', {:author => "Some Author", :email => "author@example.com"})
9
9
  @tree << PluginTree.new({:data1 => "some_data" },resource_handle("core"))
10
10
 
11
- @base_tree = Set.new(%w(README Rakefile CHANGES lib lib/new-spec-proj lib/new_spec_proj.rb lib/new-spec-proj/version.rb lib/new-spec-proj/gemspec.rb lib/new-spec-proj/specification.rb tasks tasks/announce.rake tasks/distribution.rake tasks/documentation.rake tasks/setup.rb))
11
+ @base_tree = Set.new(%w(README Rakefile HISTORY lib lib/new-spec-proj lib/new_spec_proj.rb lib/new-spec-proj/version.rb gemspec.rb tasks tasks/utils.rb tasks/announce.rake tasks/distribution.rake tasks/documentation.rake tasks/config.rb))
12
12
 
13
13
  @before = Dir.pwd
14
14
  Dir.chdir(@working_dir)
@@ -1,9 +1,6 @@
1
- begin
2
- require 'rabal'
3
- rescue LoadError
4
- $: << File.expand_path(File.join(File.dirname(__FILE__),"..","lib"))
5
- require 'rabal'
6
- end
1
+ $: << File.expand_path(File.join(File.dirname(__FILE__),"..","lib"))
2
+ require 'rabal'
3
+
7
4
  require 'set'
8
5
  require 'rubygems'
9
6
  require 'tmpdir'
@@ -5,7 +5,7 @@ describe Rabal::Plugin::Spec do
5
5
  @working_dir = my_temp_dir
6
6
  @before = Dir.pwd
7
7
  @core = Rabal::Plugin::Core.new({:project => "new-spec-proj", :author => "Foo Bar", :email => "foobar@example.com"})
8
- @base_tree = Set.new(%w(README Rakefile CHANGES lib lib/new-spec-proj lib/new_spec_proj.rb lib/new-spec-proj/version.rb spec spec/new_spec_proj_spec.rb spec/spec_helper.rb lib/new-spec-proj/specification.rb lib/new-spec-proj/gemspec.rb tasks tasks/rspec.rake tasks/announce.rake tasks/distribution.rake tasks/documentation.rake tasks/setup.rb))
8
+ @base_tree = Set.new(%w(README Rakefile HISTORY lib lib/new-spec-proj lib/new_spec_proj.rb lib/new-spec-proj/version.rb spec spec/new_spec_proj_spec.rb spec/spec_helper.rb gemspec.rb tasks tasks/utils.rb tasks/rspec.rake tasks/announce.rake tasks/distribution.rake tasks/documentation.rake tasks/config.rb))
9
9
  Dir.chdir(@working_dir)
10
10
  end
11
11
 
@@ -5,7 +5,7 @@ describe Rabal::Plugin::Test do
5
5
  @working_dir = my_temp_dir
6
6
  @before = Dir.pwd
7
7
  @core = Rabal::Plugin::Core.new({:project => "new-spec-proj", :author => "Foo Bar", :email => "foobar@example.com"})
8
- @base_tree = Set.new(%w(README Rakefile CHANGES lib lib/new-spec-proj lib/new_spec_proj.rb lib/new-spec-proj/version.rb test test/new_spec_proj_test.rb test/test_helper.rb lib/new-spec-proj/specification.rb lib/new-spec-proj/gemspec.rb tasks tasks/testunit.rake tasks/announce.rake tasks/distribution.rake tasks/documentation.rake tasks/setup.rb ))
8
+ @base_tree = Set.new(%w(README Rakefile HISTORY lib lib/new-spec-proj lib/new_spec_proj.rb lib/new-spec-proj/version.rb test test/new_spec_proj_test.rb test/test_helper.rb gemspec.rb tasks tasks/testunit.rake tasks/announce.rake tasks/distribution.rake tasks/documentation.rake tasks/config.rb tasks/utils.rb ))
9
9
  Dir.chdir(@working_dir)
10
10
  end
11
11
 
@@ -0,0 +1,40 @@
1
+ require 'tasks/config'
2
+ #-------------------------------------------------------------------------------
3
+ # announcement methods
4
+ #-------------------------------------------------------------------------------
5
+
6
+ proj_config = Configuration.for('project')
7
+ namespace :announce do
8
+ desc "create email for ruby-talk"
9
+ task :email do
10
+ info = Utils.announcement
11
+
12
+ File.open("email.txt", "w") do |mail|
13
+ mail.puts "From: #{proj_config.author} <#{proj_config.email}>"
14
+ mail.puts "To: ruby-talk@ruby-lang.org"
15
+ mail.puts "Date: #{Time.now.rfc2822}"
16
+ mail.puts "Subject: [ANN] #{info[:subject]}"
17
+ mail.puts
18
+ mail.puts info[:title]
19
+ mail.puts
20
+ mail.puts " gem install #{Rabal::GEM_SPEC.name}"
21
+ mail.puts
22
+ mail.puts info[:urls]
23
+ mail.puts
24
+ mail.puts info[:description]
25
+ mail.puts
26
+ mail.puts "{{ Release notes for Version #{Rabal::VERSION} }}"
27
+ mail.puts
28
+ mail.puts info[:release_notes]
29
+ mail.puts
30
+ mail.puts info[:urls]
31
+ end
32
+ puts "Created the following as email.txt:"
33
+ puts "-" * 72
34
+ puts File.read("email.txt")
35
+ puts "-" * 72
36
+ end
37
+
38
+ CLOBBER << "email.txt"
39
+ end
40
+
@@ -0,0 +1,99 @@
1
+ require 'configuration'
2
+
3
+ require 'rake'
4
+ require 'tasks/utils'
5
+
6
+ #-----------------------------------------------------------------------
7
+ # General project configuration
8
+ #-----------------------------------------------------------------------
9
+ Configuration.for('project') {
10
+ name "rabal"
11
+ version Rabal::Version.to_s
12
+ author "Jeremy Hinegardner"
13
+ email "jeremy at copiousfreetime dot org"
14
+ homepage "http://copiousfreetime.rubyforge.org/rabal/"
15
+ description Utils.section_of("README", "description")
16
+ summary description.split(".").first
17
+ history "HISTORY"
18
+ license FileList["LICENSE", "COPYING"]
19
+ readme FileList["README", "README.PLUGIN"]
20
+ }
21
+
22
+ #-----------------------------------------------------------------------
23
+ # Packaging
24
+ #-----------------------------------------------------------------------
25
+ Configuration.for('packaging') {
26
+ # files in the project
27
+ proj_conf = Configuration.for('project')
28
+ files {
29
+ bin FileList["bin/*"]
30
+ lib FileList["lib/**/*.rb"]
31
+ test FileList["spec/**/*.rb", "test/**/*.rb"]
32
+ data FileList["data/**/*", "resources/**/*"]
33
+ tasks FileList["tasks/**/*.r{ake,b}"]
34
+ rdoc FileList[proj_conf.readme, proj_conf.history,
35
+ proj_conf.license] + lib
36
+ all bin + lib + test + data + rdoc + tasks
37
+ }
38
+
39
+ # ways to package the results
40
+ formats {
41
+ tgz true
42
+ zip true
43
+ gem Configuration::Table.has_key?('gem')
44
+ }
45
+ }
46
+
47
+ #-----------------------------------------------------------------------
48
+ # Gem packaging
49
+ #-----------------------------------------------------------------------
50
+ Configuration.for("gem") {
51
+ spec "gemspec.rb"
52
+ Configuration.for('packaging').files.all << spec
53
+ }
54
+
55
+ #-----------------------------------------------------------------------
56
+ # Testing
57
+ # - change mode to 'testunit' to use unit testing
58
+ #-----------------------------------------------------------------------
59
+ Configuration.for('test') {
60
+ mode "spec"
61
+ files Configuration.for("packaging").files.test
62
+ options %w[ --format specdoc --color ]
63
+ ruby_opts %w[ ]
64
+ }
65
+
66
+ #-----------------------------------------------------------------------
67
+ # Rcov
68
+ #-----------------------------------------------------------------------
69
+ Configuration.for('rcov') {
70
+ output_dir "coverage"
71
+ libs %w[ lib ]
72
+ rcov_opts %w[ --html ]
73
+ ruby_opts %w[ ]
74
+ test_files Configuration.for('packaging').files.test
75
+ }
76
+
77
+ #-----------------------------------------------------------------------
78
+ # Rdoc
79
+ #-----------------------------------------------------------------------
80
+ Configuration.for('rdoc') {
81
+ files Configuration.for('packaging').files.rdoc
82
+ #puts "Files! : #{files.join("\n")}"
83
+ main_page files.first
84
+ title Configuration.for('project').name
85
+ options %w[ --line-numbers --inline-source ]
86
+ output_dir "doc"
87
+ }
88
+
89
+ #-----------------------------------------------------------------------
90
+ # Rubyforge
91
+ #-----------------------------------------------------------------------
92
+ Configuration.for('rubyforge') {
93
+ project "copiousfreetime"
94
+ user "jjh"
95
+ host "rubyforge.org"
96
+ rdoc_location "#{user}@#{host}:/var/www/gforge-projects/#{project}/rabal/"
97
+ }
98
+
99
+
@@ -0,0 +1,45 @@
1
+ require 'tasks/config'
2
+
3
+ #-------------------------------------------------------------------------------
4
+ # Distribution and Packaging
5
+ #-------------------------------------------------------------------------------
6
+ if pkg_config = Configuration.for_if_exist?("packaging") then
7
+
8
+ require 'gemspec'
9
+ require 'rake/gempackagetask'
10
+ require 'rake/contrib/sshpublisher'
11
+
12
+ namespace :dist do
13
+
14
+ Rake::GemPackageTask.new(Rabal::GEM_SPEC) do |pkg|
15
+ pkg.need_tar = pkg_config.formats.tgz
16
+ pkg.need_zip = pkg_config.formats.zip
17
+ end
18
+
19
+ desc "Install as a gem"
20
+ task :install => [:clobber, :package] do
21
+ sh "sudo gem install -y pkg/#{Rabal::GEM_SPEC.full_name}.gem"
22
+ end
23
+
24
+ desc "Uninstall gem"
25
+ task :uninstall do
26
+ sh "sudo gem uninstall -i #{Rabal::GEM_SPEC.name} -x"
27
+ end
28
+
29
+ desc "dump gemspec"
30
+ task :gemspec do
31
+ puts Rabal::GEM_SPEC.to_ruby
32
+ end
33
+
34
+ desc "reinstall gem"
35
+ task :reinstall => [:uninstall, :repackage, :install]
36
+
37
+ desc "distribute copiously"
38
+ task :copious => [:package] do
39
+ Rake::SshFilePublisher.new('jeremy@copiousfreetime.org',
40
+ '/var/www/vhosts/www.copiousfreetime.org/htdocs/gems/gems',
41
+ 'pkg',"#{Rabal::GEM_SPEC.full_name}.gem").upload
42
+ sh "ssh jeremy@copiousfreetime.org rake -f /var/www/vhosts/www.copiousfreetime.org/htdocs/gems/Rakefile"
43
+ end
44
+ end
45
+ end
@@ -0,0 +1,31 @@
1
+ require 'tasks/config'
2
+
3
+ #-----------------------------------------------------------------------
4
+ # Documentation
5
+ #-----------------------------------------------------------------------
6
+
7
+ if rdoc_config = Configuration.for_if_exist?('rdoc') then
8
+
9
+ namespace :doc do
10
+
11
+ require 'rake/rdoctask'
12
+
13
+ # generating documentation locally
14
+ Rake::RDocTask.new do |rdoc|
15
+ rdoc.rdoc_dir = rdoc_config.output_dir
16
+ rdoc.options = rdoc_config.options
17
+ rdoc.rdoc_files = rdoc_config.files
18
+ rdoc.title = rdoc_config.title
19
+ rdoc.main = rdoc_config.main_page
20
+ end
21
+
22
+ if rubyforge_config = Configuration.for_if_exist?('rubyforge') then
23
+ desc "Deploy the RDoc documentation to #{rubyforge_config.rdoc_location}"
24
+ task :deploy => :rerdoc do
25
+ sh "rsync -zav --delete #{rdoc_config.output_dir}/ #{rubyforge_config.rdoc_location}"
26
+ end
27
+ end
28
+
29
+ end
30
+ end
31
+
@@ -0,0 +1,29 @@
1
+
2
+ require 'tasks/config'
3
+
4
+ #--------------------------------------------------------------------------------
5
+ # configuration for running rspec. This shows up as the test:default task
6
+ #--------------------------------------------------------------------------------
7
+ if spec_config = Configuration.for_if_exist?("test") then
8
+ if spec_config.mode == "spec" then
9
+ namespace :test do
10
+
11
+ task :default => :spec
12
+
13
+ require 'spec/rake/spectask'
14
+ Spec::Rake::SpecTask.new do |r|
15
+ r.ruby_opts = spec_config.ruby_opts
16
+ r.libs = [ Rabal.lib_path,
17
+ Rabal.root_dir ]
18
+ r.spec_files = spec_config.files
19
+ r.spec_opts = spec_config.options
20
+
21
+ if rcov_config = Configuration.for_if_exist?('rcov') then
22
+ r.rcov = true
23
+ r.rcov_dir = rcov_config.output_dir
24
+ r.rcov_opts = rcov_config.rcov_opts
25
+ end
26
+ end
27
+ end
28
+ end
29
+ end