2009-12-02 07:21:19 +00:00
|
|
|
require 'spec/rake/spectask'
|
|
|
|
|
|
|
|
desc "Run specs"
|
|
|
|
Spec::Rake::SpecTask.new(:spec) do |t|
|
|
|
|
t.spec_files = FileList["spec/**/*.rb"]
|
|
|
|
end
|
|
|
|
|
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
|
|
|
|
2009-09-30 02:55:23 +00:00
|
|
|
task :default => :test
|
|
|
|
|
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|
|
|
|
|
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"
|
|
|
|
gemspec.description = "A fake filesystem. Use it in your tests."
|
|
|
|
gemspec.authors = ["Chris Wanstrath"]
|
|
|
|
gemspec.has_rdoc = false
|
2009-10-07 03:53:42 +00:00
|
|
|
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
|