buildr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From as...@apache.org
Subject svn commit: r608653 - /incubator/buildr/docter/trunk/Rakefile
Date Thu, 03 Jan 2008 22:02:45 GMT
Author: assaf
Date: Thu Jan  3 14:02:44 2008
New Revision: 608653

URL: http://svn.apache.org/viewvc?rev=608653&view=rev
Log:
Fixed to get release working again with RubyGems 1.0

Modified:
    incubator/buildr/docter/trunk/Rakefile

Modified: incubator/buildr/docter/trunk/Rakefile
URL: http://svn.apache.org/viewvc/incubator/buildr/docter/trunk/Rakefile?rev=608653&r1=608652&r2=608653&view=diff
==============================================================================
--- incubator/buildr/docter/trunk/Rakefile (original)
+++ incubator/buildr/docter/trunk/Rakefile Thu Jan  3 14:02:44 2008
@@ -1,48 +1,32 @@
-require "rubygems"
+require 'rubygems'
 Gem::manage_gems
-require "rake/gempackagetask"
-require "spec/rake/spectask"
-require "rake/rdoctask"
-require "lib/docter"
+require 'rake/gempackagetask'
+require 'rake/rdoctask'
+require 'rubyforge'
 
 
 # Gem specification comes first, other tasks rely on it.
 spec = Gem::Specification.new do |spec|
-  spec.name         = "docter"
-  spec.version      = File.read(__FILE__.pathmap("%d/lib/docter.rb")).scan(/VERSION\s*=\s*(['"])(.*)\1/)[0][1]
-  spec.author       = "Apache Buildr"
-  spec.email        = "buildr-user@incubator.apache.org"
-  spec.homepage     = "http://incubator.apache.org/buildr/"
-  spec.summary      = "We has docs"
-  spec.files        = FileList["lib/**/*", "CHANGELOG", "README", "LICENSE", "Rakefile",
"html/**/*"].collect
-  spec.require_path = "lib"
-  spec.autorequire  = "docter.rb"
+  spec.name         = 'docter'
+  spec.version      = File.read(__FILE__.pathmap('%d/lib/docter.rb')).scan(/VERSION\s*=\s*(['"])(.*)\1/)[0][1]
+  spec.author       = 'Apache Buildr'
+  spec.email        = 'buildr-user@incubator.apache.org'
+  spec.homepage     = 'http://incubator.apache.org/buildr/'
+  spec.summary      = 'We has docs'
+  spec.files        = FileList['lib/**/*', 'CHANGELOG', 'README', 'LICENSE', 'Rakefile',
'html/**/*'].collect
+  spec.require_path = 'lib'
   spec.has_rdoc     = true
-  spec.extra_rdoc_files = ["README", "CHANGELOG", "LICENSE"]
-  spec.rdoc_options << "--title" << "Docter -- #{spec.summary}" <<
-                       "--main" << "README" << "--line-numbers" << "-inline-source"
-  spec.rubyforge_project = "buildr"
+  spec.extra_rdoc_files = ['README', 'CHANGELOG', 'LICENSE']
+  spec.rdoc_options << '--title' << "Docter -- #{spec.summary}" <<
+                       '--main' << 'README' << '--line-numbers' << '--inline-source'
<< '-p' <<
+                       '--webcvs' << 'http://svn.apache.org/repos/asf/incubator/buildr/docter/trunk/'
+  spec.rubyforge_project = 'buildr'
 
   # Tested against these dependencies.
-  spec.add_dependency "facets",   "~> 1.8"
-  spec.add_dependency "RedCloth", "~> 3.0"
-  spec.add_dependency "haml",     "~> 1.7"
-  spec.add_dependency "mongrel",  "~> 1.0"
-end
-
-
-# Testing is everything.
-desc "Run test cases"
-Spec::Rake::SpecTask.new(:test) do |task|
-  task.spec_files = FileList["test/**/*.rb"]
-  task.spec_opts = [ "--format", "specdoc", "--color", "--diff" ]
-end
-
-desc "Run test cases with rcov"
-Spec::Rake::SpecTask.new(:rcov) do |task|
-  task.spec_files = FileList["test/**/*.rb"]
-  task.spec_opts = [ "--format", "specdoc", "--color", "--diff" ]
-  task.rcov = true
+  spec.add_dependency 'facets',   '~> 2.2'
+  spec.add_dependency 'RedCloth', '~> 3.0'
+  spec.add_dependency 'haml',     '~> 1.7'
+  spec.add_dependency 'mongrel',  '~> 1.1'
 end
 
 
@@ -52,27 +36,27 @@
   pkg.need_zip = true
 end
 
-desc "Install the package locally"
+desc 'Install the package locally'
 task :install=>:package do |task|
-  system "gem", "install", "pkg/#{spec.name}-#{spec.version}.gem"
+  system 'gem', 'install', "pkg/#{spec.name}-#{spec.version}.gem"
 end
 
-desc "Uninstall previously installed packaged"
+desc 'Uninstall previously installed packaged'
 task :uninstall do |task|
-  system "gem", "uninstall", spec.name, "-v", spec.version.to_s
+  system 'gem', 'uninstall', spec.name, '-v', spec.version.to_s
 end
 
 
-desc "Generate RDoc documentation"
+desc 'Generate RDoc documentation'
 rdoc = Rake::RDocTask.new(:rdoc) do |rdoc|
-  rdoc.rdoc_dir = "rdoc"
+  rdoc.rdoc_dir = 'rdoc'
   rdoc.title    = spec.name
   rdoc.options  = spec.rdoc_options
-  rdoc.rdoc_files.include("lib/**/*.rb")
+  rdoc.rdoc_files.include('lib/**/*.rb')
   rdoc.rdoc_files.include spec.extra_rdoc_files
 end
 
-task("clobber") { rm_rf [rdoc.rdoc_dir].map(&:to_s) }
+task('clobber') { rm_rf [rdoc.rdoc_dir.to_s] }
 
 
 # Commit to SVN, upload and do the release cycle.
@@ -85,35 +69,34 @@
   task :tag do |task|
     cur_url = `svn info`.scan(/URL: (.*)/)[0][0]
     new_url = cur_url.sub(/trunk$/, "tags/#{spec.version.to_s}")
-    system "svn", "remove", new_url, "-m", "Removing old copy" rescue nil
-    system "svn", "copy", cur_url, new_url, "-m", "Release #{spec.version.to_s}"
+    system 'svn', 'remove', new_url, '-m', 'Removing old copy' rescue nil
+    system 'svn', 'copy', cur_url, new_url, '-m', "Release #{spec.version.to_s}"
   end
 end
 
 namespace :upload do
-  task :packages=>["rake:package"] do |task|
+  task :packages=>['rake:package'] do |task|
     # Read the changes for this release.
     pattern = /(^(\d+\.\d+(?:\.\d+)?)\s+\(\d{4}-\d{2}-\d{2}\)\s*((:?^[^\n]+\n)*))/
-    changelog = File.read(__FILE__.pathmap("%d/CHANGELOG"))
+    changelog = File.read(__FILE__.pathmap('%d/CHANGELOG'))
     changes = changelog.scan(pattern).inject({}) { |hash, set| hash[set[1]] = set[2] ; hash
}
     current = changes[spec.version.to_s]
     if !current && spec.version.to_s =~ /\.0$/
-      current = changes[spec.version.to_s.split(".")[0..-2].join(".")] 
+      current = changes[spec.version.to_s.split('.')[0..-2].join('.')] 
     end
     fail "No changeset found for version #{spec.version}" unless current
 
     puts "Uploading #{spec.name} #{spec.version}"
-    puts "Uploading #{spec.name} #{spec.version}"
     files = %w( gem tgz zip ).map { |ext| "pkg/#{spec.name}-#{spec.version}.#{ext}" }
     rubyforge = RubyForge.new
     rubyforge.login    
-    File.open(".changes", 'w'){|f| f.write(current)}
-    rubyforge.userconfig.merge!("release_changes" => ".changes",  "preformatted" =>
true)
+    File.open('.changes', 'w'){|f| f.write(current)}
+    rubyforge.userconfig.merge!('release_changes' => '.changes',  'preformatted' =>
true)
     rubyforge.add_release spec.rubyforge_project.downcase, spec.name.downcase, spec.version,
*files
-    rm ".changes"
+    rm '.changes'
     puts "Release #{spec.version} uploaded"
   end
 end
 
-desc "Upload release to RubyForge including docs, tag SVN"
-task :release=>[ "clobber", "svn:clean?", "test", "upload:packages" ]
+desc 'Upload release to RubyForge including docs, tag SVN'
+task :release=>[ 'clobber', 'svn:clean?', 'upload:packages' ]



Mime
View raw message