Rakefile 846 B

123456789101112131415161718192021222324252627282930313233343536
  1. require 'rake/clean'
  2. require 'rake/testtask'
  3. task :default => [:test]
  4. Rake::TestTask.new(:test) do |t|
  5. t.test_files = FileList['test/test_shotgun_*.rb']
  6. t.ruby_opts = ['-rubygems'] if defined? Gem
  7. end
  8. desc "build manual"
  9. task :man do
  10. ENV['RONN_ORGANIZATION'] = "Shotgun #{SPEC.version}"
  11. sh "ronn -5r -stoc man/*.ronn"
  12. end
  13. require 'rubygems'
  14. SPEC = eval(File.read('shotgun.gemspec'))
  15. PACK = "#{SPEC.name}-#{SPEC.version}"
  16. desc 'build packages'
  17. task :package => %W[pkg/#{PACK}.gem pkg/#{PACK}.tar.gz]
  18. directory 'pkg/'
  19. file "pkg/#{PACK}.gem" => %w[pkg/ shotgun.gemspec] + SPEC.files do |f|
  20. sh "gem build shotgun.gemspec"
  21. mv File.basename(f.name), f.name
  22. end
  23. file "pkg/#{PACK}.tar.gz" => %w[pkg/] + SPEC.files do |f|
  24. sh <<-SH
  25. git archive --prefix=shotgun-#{SPEC.version}/ --format=tar HEAD |
  26. gzip > '#{f.name}'
  27. SH
  28. end