Rakefile in cutep-0.0.2 vs Rakefile in cutep-0.0.3

- old
+ new

@@ -18,11 +18,11 @@ include FileUtils require File.join(File.dirname(__FILE__), 'lib', 'qp', 'version') AUTHOR = 'Kouichirou Eto' -EMAIL = "2007@eto.com.please.do.not.send.spam.example.com" +EMAIL = "eto@rubyforge.org.please.do.not.send.spam.example.com" DESCRIPTION = '"Cute p" provide more human readable "p" function.' GEM_NAME = 'cutep' @config_file = "~/.rubyforge/user-config.yml" @config = nil @@ -94,10 +94,15 @@ Dir['website/**/*.txt'].each do |txt| sh %{ ruby scripts/txt2html #{txt} > #{txt.gsub(/txt$/,'html')} } end end +# add chmod function. +task :website_generate do + sh %{ chmod -R go+rx website } +end + desc 'Upload website files to rubyforge' task :website_upload do host = "#{rubyforge_username}@rubyforge.org" remote_dir = "/var/www/gforge-projects/#{PATH}/" local_dir = 'website' @@ -135,25 +140,34 @@ t.spec_opts = ['--options', "spec/spec.opts"] t.spec_files = FileList['spec/*_spec.rb'] t.libs << "lib" end -Rake::RDocTask.new do |rdoc| - rdoc.rdoc_dir = 'html' - rdoc.options += RDOC_OPTS - rdoc.template = "#{ENV['template']}.rb" if ENV['template'] - if ENV['DOC_FILES'] - rdoc.rdoc_files.include(ENV['DOC_FILES'].split(/,\s*/)) - else - rdoc.rdoc_files.include('README.txt', 'ChangeLog') - rdoc.rdoc_files.include('lib/**/*.rb') +# add chmod function. +task :docs do + sh %{ chmod -R go+rx doc } +end + +# override clear current task +module Rake + class Task + def clear_actions + @actions.clear + end end end -desc "Publish to RubyForge" -task :publish_rubyforge => [:rdoc, :package] do - Rake::RubyForgePublisher.new(RUBYFORGE_PROJECT, RUBYFORGE_ACCOUNT).upload +# clear current install_gem task +t = Rake.application.lookup(:install_gem) +t.clear_actions if t + +# redefine install_gem task +task :install_gem => [:clean, :package] do + if /mswin32/ =~ RUBY_PLATFORM || /cygwin/ =~ RUBY_PLATFORM + sh "gem.cmd install pkg/*.gem" # for Cygwin + else + sh "sudo gem install pkg/*.gem" + end end desc "Default task is to run specs" task :default => :spec -