summaryrefslogtreecommitdiff
path: root/Rakefile
diff options
context:
space:
mode:
authordelano <delano@solutious.com>2009-06-19 08:33:54 -0400
committerdelano <delano@solutious.com>2009-06-19 08:33:54 -0400
commitb6c9c79286f744113324135e7ab87cc4daff95fe (patch)
tree1feb19f38dca139375409b5c782226aeb6fb1f13 /Rakefile
parent588947682890a2c8559525f4c89d821b0ed730a3 (diff)
downloadnet-ssh-b6c9c79286f744113324135e7ab87cc4daff95fe.tar.gz
Added Rakefile and gemspecv2.0.12
Diffstat (limited to 'Rakefile')
-rw-r--r--Rakefile87
1 files changed, 70 insertions, 17 deletions
diff --git a/Rakefile b/Rakefile
index 054d49c..e329055 100644
--- a/Rakefile
+++ b/Rakefile
@@ -1,26 +1,79 @@
-require './lib/net/ssh/version'
+require 'rubygems'
+require 'rake/clean'
+require 'rake/gempackagetask'
+require 'hanna/rdoctask'
+require 'fileutils'
+include FileUtils
+
+task :default => :package
+
+# CONFIG =============================================================
-begin
- require 'echoe'
-rescue LoadError
- abort "You'll need to have `echoe' installed to use Net::SSH's Rakefile"
+# Change the following according to your needs
+README = "README.rdoc"
+CHANGES = "CHANGELOG.rdoc"
+THANKS = 'THANKS.rdoc'
+
+# Files and directories to be deleted when you run "rake clean"
+CLEAN.include [ 'pkg', '*.gem', '.config', 'doc']
+
+# Virginia assumes your project and gemspec have the same name
+name = 'net-ssh'
+load "#{name}.gemspec"
+version = @spec.version
+
+# That's it! The following defaults should allow you to get started
+# on other things.
+
+
+# TESTS/SPECS =========================================================
+
+
+
+# INSTALL =============================================================
+
+Rake::GemPackageTask.new(@spec) do |p|
+ p.need_tar = true if RUBY_PLATFORM !~ /mswin/
+end
+
+task :release => [ :rdoc, :package ]
+task :install => [ :rdoc, :package ] do
+ sh %{sudo gem install pkg/#{name}-#{version}.gem}
+end
+task :uninstall => [ :clean ] do
+ sh %{sudo gem uninstall #{name}}
end
-version = Net::SSH::Version::STRING.dup
-if ENV['SNAPSHOT'].to_i == 1
- version << "." << Time.now.utc.strftime("%Y%m%d%H%M%S")
+
+# RUBYFORGE RELEASE / PUBLISH TASKS ==================================
+
+if @spec.rubyforge_project
+ desc 'Publish website to rubyforge'
+ task 'publish:rdoc' => 'doc/index.html' do
+ sh "scp -rp doc/* rubyforge.org:/var/www/gforge-projects/#{name}/"
+ end
+
+ desc 'Public release to rubyforge'
+ task 'publish:gem' => [:package] do |t|
+ sh <<-end
+ rubyforge add_release -o Any -a #{CHANGES} -f -n #{README} #{name} #{name} #{@spec.version} pkg/#{name}-#{@spec.version}.gem &&
+ rubyforge add_file -o Any -a #{CHANGES} -f -n #{README} #{name} #{name} #{@spec.version} pkg/#{name}-#{@spec.version}.tgz
+ end
+ end
end
-Echoe.new('net-ssh', version) do |p|
- p.changelog = "CHANGELOG.rdoc"
- p.author = "Jamis Buck"
- p.email = "jamis@jamisbuck.org"
- p.summary = "a pure-Ruby implementation of the SSH2 client protocol"
- p.url = "http://net-ssh.rubyforge.org/ssh"
- p.need_zip = true
- p.include_rakefile = true
+# RUBY DOCS TASK ==================================
- p.rdoc_pattern = /^(lib|README.rdoc|CHANGELOG.rdoc|THANKS.rdoc)/
+Rake::RDocTask.new do |t|
+ t.rdoc_dir = 'doc'
+ t.title = @spec.summary
+ t.options << '--line-numbers' << '-A cattr_accessor=object'
+ t.options << '--charset' << 'utf-8'
+ t.rdoc_files.include(README)
+ t.rdoc_files.include(CHANGES)
+ t.rdoc_files.include(THANKS)
+ t.rdoc_files.include('lib/**/*.rb')
end
+