Browse files

Spring cleaning of Rakefiles

  • Loading branch information...
1 parent d120553 commit d262b8f1f8db9e7692bf5a4c41fea2b892dd5367 @obrie obrie committed Jun 22, 2008
Showing with 19 additions and 24 deletions.
  1. +19 −24 Rakefile
View
43 Rakefile
@@ -3,11 +3,6 @@ require 'rake/rdoctask'
require 'rake/gempackagetask'
require 'rake/contrib/sshpublisher'
-PKG_NAME = 'password_generator'
-PKG_VERSION = '0.0.2'
-PKG_FILE_NAME = "#{PKG_NAME}-#{PKG_VERSION}"
-RUBY_FORGE_PROJECT = 'pluginaweek'
-
desc 'Default: run unit tests.'
task :default => :test
@@ -29,20 +24,20 @@ Rake::RDocTask.new(:rdoc) do |rdoc|
end
spec = Gem::Specification.new do |s|
- s.name = PKG_NAME
- s.version = PKG_VERSION
- s.platform = Gem::Platform::RUBY
- s.summary = 'Generates memorable passwords that a human-being can easily remember'
+ s.name = 'password_generator'
+ s.version = '0.0.2'
+ s.platform = Gem::Platform::RUBY
+ s.summary = 'Generates memorable passwords that a human-being can easily remember'
- s.files = FileList['{lib,test}/**/*'].to_a + %w(CHANGELOG init.rb LICENSE Rakefile README)
- s.require_path = 'lib'
- s.autorequire = 'password_generator'
- s.has_rdoc = true
- s.test_files = Dir['test/**/*_test.rb']
+ s.files = FileList['{lib,test}/**/*'].to_a + %w(CHANGELOG init.rb LICENSE Rakefile README)
+ s.require_path = 'lib'
+ s.has_rdoc = true
+ s.test_files = Dir['test/**/*_test.rb']
- s.author = 'Aaron Pfeifer'
- s.email = 'aaron@pluginaweek.org'
- s.homepage = 'http://www.pluginaweek.org'
+ s.author = 'Aaron Pfeifer'
+ s.email = 'aaron@pluginaweek.org'
+ s.homepage = 'http://www.pluginaweek.org'
+ s.rubyforge_project = 'pluginaweek'
end
Rake::GemPackageTask.new(spec) do |p|
@@ -51,14 +46,14 @@ Rake::GemPackageTask.new(spec) do |p|
p.need_zip = true
end
-desc 'Publish the beta gem'
+desc 'Publish the beta gem.'
task :pgem => [:package] do
- Rake::SshFilePublisher.new('aaron@pluginaweek.org', '/home/aaron/gems.pluginaweek.org/public/gems', 'pkg', "#{PKG_FILE_NAME}.gem").upload
+ Rake::SshFilePublisher.new('aaron@pluginaweek.org', '/home/aaron/gems.pluginaweek.org/public/gems', 'pkg', "#{spec.name}-#{spec.version}.gem").upload
end
-desc 'Publish the API documentation'
+desc 'Publish the API documentation.'
task :pdoc => [:rdoc] do
- Rake::SshDirPublisher.new('aaron@pluginaweek.org', "/home/aaron/api.pluginaweek.org/public/#{PKG_NAME}", 'rdoc').upload
+ Rake::SshDirPublisher.new('aaron@pluginaweek.org', "/home/aaron/api.pluginaweek.org/public/#{spec.name}", 'rdoc').upload
end
desc 'Publish the API docs and gem'
@@ -71,10 +66,10 @@ task :release => [:gem, :package] do
ruby_forge = RubyForge.new.configure
ruby_forge.login
- %w( gem tgz zip ).each do |ext|
- file = "pkg/#{PKG_FILE_NAME}.#{ext}"
+ %w(gem tgz zip).each do |ext|
+ file = "pkg/#{spec.name}-#{spec.version}.#{ext}"
puts "Releasing #{File.basename(file)}..."
- ruby_forge.add_release(RUBY_FORGE_PROJECT, PKG_NAME, PKG_VERSION, file)
+ ruby_forge.add_release(spec.rubyforge_project, spec.name, spec.version, file)
end
end

0 comments on commit d262b8f

Please sign in to comment.