hub/Rakefile

75 строки
1.7 KiB
Ruby
Исходник Обычный вид История

2009-12-08 09:28:03 +03:00
require 'rake/testtask'
2009-12-06 01:15:59 +03:00
task :default => :test
2009-12-08 09:28:03 +03:00
Rake::TestTask.new do |t|
t.libs << 'lib'
t.pattern = 'test/**/*_test.rb'
t.verbose = false
end
2009-12-08 12:12:32 +03:00
module Standalone
PREAMBLE = <<-premable
#!/usr/bin/env ruby
#
# This file, hub, is generated code.
# Please DO NOT EDIT or send patches for it.
#
# Please take a look at the source from
# http://github.com/defunkt/hub
# and submit patches against the individual files
# that build hub.
#
premable
POSTAMBLE = "Hub::Runner.execute(*ARGV)"
end
desc "Build standalone script"
task :standalone => :test do
File.open('hub-standalone', 'w') do |f|
f.puts Standalone::PREAMBLE
Dir['lib/*/**'].each do |file|
f.puts File.read(file)
end
f.puts Standalone::POSTAMBLE
end
end
2009-12-08 09:28:03 +03:00
desc "Launch Kicker (like autotest)"
task :kicker do
puts "Kicking... (ctrl+c to cancel)"
exec "kicker -e rake test bin"
end
2009-12-08 11:26:59 +03:00
desc "Build a gem"
task :gem => [ :gemspec, :build ]
begin
require 'jeweler'
$LOAD_PATH.unshift 'lib'
2009-12-08 11:49:09 +03:00
require 'hub'
2009-12-08 11:26:59 +03:00
Jeweler::Tasks.new do |gemspec|
2009-12-08 11:53:46 +03:00
gemspec.name = "hub/version"
2009-12-08 11:26:59 +03:00
gemspec.summary = gemspec.description = "hub introduces git to GitHub"
gemspec.homepage = "http://github.com/defunkt/hub"
gemspec.version = Hub::Version
gemspec.authors = ["Chris Wanstrath"]
gemspec.email = "chris@ozmm.org"
end
rescue LoadError
puts "Jeweler not available."
puts "Install it with: gem install jeweler"
end
desc "Push a new version to Gemcutter"
task :publish => [ :test, :gemspec, :build ] do
system "git tag v#{Hub::Version}"
system "git push origin v#{Hub::Version}"
system "git push origin master"
system "gem push pkg/hub-#{Hub::Version}.gem"
system "git clean -fd"
2009-12-08 12:12:48 +03:00
puts :ok
2009-12-08 11:26:59 +03:00
end