fakefs/Rakefile

60 lines
1.6 KiB
Ruby
Raw Permalink Normal View History

$LOAD_PATH.unshift File.join(File.dirname(__FILE__))
$LOAD_PATH.unshift File.join(File.dirname(__FILE__), 'test')
2009-09-30 02:55:23 +00:00
desc "Run tests"
task :test do
2009-09-30 02:54:17 +00:00
Dir['test/**/*_test.rb'].each { |file| require file }
2009-07-19 21:16:37 +00:00
end
2009-09-11 06:48:50 +00:00
task :default => [:test, :spec]
2009-09-30 02:55:23 +00:00
2011-05-03 01:36:07 +00:00
require 'rspec/core/rake_task'
desc "Run specs"
RSpec::Core::RakeTask.new
2009-09-11 06:48:50 +00:00
begin
require 'jeweler'
$LOAD_PATH.unshift File.dirname(__FILE__) + '/lib'
require 'fakefs/version'
Jeweler::Tasks.new do |gemspec|
2009-12-02 07:21:48 +00:00
gemspec.name = "fakefs"
gemspec.summary = "A fake filesystem. Use it in your tests."
gemspec.email = "chris@ozmm.org"
gemspec.homepage = "http://github.com/defunkt/fakefs"
2009-09-11 06:48:50 +00:00
gemspec.description = "A fake filesystem. Use it in your tests."
2010-12-16 04:15:21 +00:00
gemspec.authors = ["Chris Wanstrath", "Scott Taylor", "Jeff Hodges", "Pat Nakajima"]
2009-12-02 07:21:48 +00:00
gemspec.has_rdoc = false
gemspec.version = FakeFS::Version.to_s
2009-09-11 06:48:50 +00:00
end
rescue LoadError
puts "Jeweler not available."
2009-10-07 04:15:18 +00:00
puts "Install it with: gem install jeweler"
2009-09-11 06:48:50 +00:00
end
2009-10-07 04:32:54 +00:00
begin
require 'sdoc_helpers'
rescue LoadError
puts "sdoc support not enabled. Please gem install sdoc-helpers."
end
2009-10-30 16:55:57 +00:00
desc "Build a gem"
task :gem => [ :gemspec, :build ]
desc "Push a new version to Gemcutter"
2009-10-30 17:02:41 +00:00
task :publish => [ :gemspec, :build ] do
abort("Tests failed!") unless system("rake test")
2009-10-30 16:55:57 +00:00
system "git tag v#{FakeFS::Version}"
system "git push origin v#{FakeFS::Version}"
system "git push origin master"
system "gem push pkg/fakefs-#{FakeFS::Version}.gem"
system "git clean -fd"
exec "rake pages"
end
2010-12-27 18:25:06 +00:00
desc "Update contributors"
task :update_contributors do
sh "git-rank-contributors > CONTRIBUTORS"
end