Rakefile in cutep-0.0.1 vs Rakefile in cutep-0.0.2

- old
+ new

@@ -15,11 +15,11 @@ puts '$ sudo gem install rspec' exit end include FileUtils -require File.join(File.dirname(__FILE__), 'lib', 'qp') +require File.join(File.dirname(__FILE__), 'lib', 'qp', 'version') AUTHOR = 'Kouichirou Eto' EMAIL = "2007@eto.com.please.do.not.send.spam.example.com" DESCRIPTION = '"Cute p" provide more human readable "p" function.' GEM_NAME = 'cutep' @@ -34,26 +34,29 @@ puts <<-EOS ERROR: No rubyforge config file found: #{@config_file}" Run 'rubyforge setup' to prepare your env for access to Rubyforge - See http://newgem.rubyforge.org/rubyforge.html for more details EOS +# " exit end end @rubyforge_username ||= @config["username"] end RUBYFORGE_PROJECT = 'cutep' # The unix name for your project HOMEPATH = "http://#{RUBYFORGE_PROJECT}.rubyforge.org" DOWNLOAD_PATH = "http://rubyforge.org/projects/#{RUBYFORGE_PROJECT}" +RUBYFORGE_ACCOUNT = 'eto' NAME = "cutep" REV = nil # UNCOMMENT IF REQUIRED: # REV = `svn info`.each {|line| if line =~ /^Revision:/ then k,v = line.split(': '); break v.chomp; else next; end} rescue nil VERS = QP::VERSION::STRING + (REV ? ".#{REV}" : "") CLEAN.include ['**/.*.sw?', '*.gem', '.config', '**/.DS_Store'] +CLEAN.include ['*~'] RDOC_OPTS = ['--quiet', '--title', 'cutep documentation', "--opname", "index.html", "--line-numbers", "--main", "README", "--inline-source"] @@ -129,9 +132,27 @@ desc "Run the specs under spec/models" Spec::Rake::SpecTask.new do |t| 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') + end +end + +desc "Publish to RubyForge" +task :publish_rubyforge => [:rdoc, :package] do + Rake::RubyForgePublisher.new(RUBYFORGE_PROJECT, RUBYFORGE_ACCOUNT).upload end desc "Default task is to run specs" task :default => :spec