Permalink
Browse files

Updated Rakefile

  • Loading branch information...
1 parent 74e3301 commit bded235ba52e44fb67a176733050f58062b2b2b3 @delano delano committed Apr 3, 2011
Showing with 75 additions and 16 deletions.
  1. +73 −16 Rakefile
  2. +2 −0 test/test_all.rb
View
@@ -1,28 +1,85 @@
+
+require 'rubygems'
+require 'rake/clean'
+require 'rake/gempackagetask'
+require 'fileutils'
+include FileUtils
+
begin
- require 'echoe'
+ require 'hanna/rdoctask'
rescue LoadError
- abort "You'll need to have `echoe' installed to use Net::SSH::Multi's Rakefile"
+ require 'rake/rdoctask'
end
-require './lib/net/ssh/multi/version'
-version = Net::SSH::Multi::Version::STRING.dup
-if ENV['SNAPSHOT'].to_i == 1
- version << "." << Time.now.utc.strftime("%Y%m%d%H%M%S")
+task :default => :package
+
+# CONFIG =============================================================
+
+# Change the following according to your needs
+README = "README.rdoc"
+CHANGES = "CHANGELOG.rdoc"
+THANKS = ''
+
+# 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-multi'
+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 :build => [ :package ]
+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
-Echoe.new('net-ssh-multi', version) do |p|
- p.changelog = "CHANGELOG.rdoc"
- p.author = "Jamis Buck"
- p.email = "jamis@jamisbuck.org"
- p.summary = "Control multiple Net::SSH connections via a single interface"
- p.url = "http://net-ssh.rubyforge.org/multi"
+# RUBYFORGE RELEASE / PUBLISH TASKS ==================================
+
+if @spec.rubyforge_project
+ desc 'Publish website to rubyforge'
+ task 'publish:rdoc' => 'doc/index.html' do
+ sh "scp -r doc/* rubyforge.org:/var/www/gforge-projects/#{name}/ssh/v2/api/"
+ 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
+
- p.dependencies = ["net-ssh >=1.99.2", "net-ssh-gateway >=0.99.0"]
- p.need_zip = true
- p.include_rakefile = true
+# RUBY DOCS TASK ==================================
- p.rdoc_pattern = /^(lib|README.rdoc|CHANGELOG.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('lib/**/*.rb')
end
View
@@ -1,3 +1,5 @@
+# $ ruby -Ilib -Itest -rrubygems test/test_all.rb
+# $ ruby -Ilib -Itest -rrubygems test/channel_test.rb
Dir["#{File.dirname(__FILE__)}/**/*_test.rb"].each do |file|
load(file)
end

0 comments on commit bded235

Please sign in to comment.