You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@buildr.apache.org by do...@apache.org on 2012/10/07 07:48:01 UTC
svn commit: r1395216 - in /buildr/trunk/rakelib: all-in-one.rake checks.rake
doc.rake metrics.rake package.rake release.rake rspec.rake stage.rake
Author: donaldp
Date: Sun Oct 7 05:48:00 2012
New Revision: 1395216
URL: http://svn.apache.org/viewvc?rev=1395216&view=rev
Log:
Convert to using single quoted strings where possible
Modified:
buildr/trunk/rakelib/all-in-one.rake
buildr/trunk/rakelib/checks.rake
buildr/trunk/rakelib/doc.rake
buildr/trunk/rakelib/metrics.rake
buildr/trunk/rakelib/package.rake
buildr/trunk/rakelib/release.rake
buildr/trunk/rakelib/rspec.rake
buildr/trunk/rakelib/stage.rake
Modified: buildr/trunk/rakelib/all-in-one.rake
URL: http://svn.apache.org/viewvc/buildr/trunk/rakelib/all-in-one.rake?rev=1395216&r1=1395215&r2=1395216&view=diff
==============================================================================
--- buildr/trunk/rakelib/all-in-one.rake (original)
+++ buildr/trunk/rakelib/all-in-one.rake Sun Oct 7 05:48:00 2012
@@ -17,10 +17,10 @@ def workspace_dir
"#{File.expand_path(File.join(File.dirname(__FILE__), ".."))}"
end
-desc "Create JRuby all-in-one distribution"
-task "all-in-one" => 'all-in-one:all-in-one'
+desc 'Create JRuby all-in-one distribution'
+task 'all-in-one' => 'all-in-one:all-in-one'
-namespace :'all-in-one' do
+namespace 'all-in-one' do
version = "1.6.7"
jruby_distro = "jruby-bin-#{version}.tar.gz"
@@ -59,24 +59,24 @@ namespace :'all-in-one' do
saved_file.write(read_file.read)
end
end
- puts "[X] Downloaded JRuby"
+ puts '[X] Downloaded JRuby'
end
rm_rf dir if File.exist? dir
puts "Extracting JRuby to #{dir} ..."
sh 'tar', 'xzf', jruby_distro
- puts "[X] Extracted JRuby"
+ puts '[X] Extracted JRuby'
cd dir
end
desc 'Cleanup JRuby distribution'
- task :clean_dist do
+ task 'clean_dist' do
puts 'Cleaning...'
rm_rf 'docs'
mkpath 'jruby-docs'
- mv Dir["COPYING*"], 'jruby-docs'
- mv Dir["LICENSE*"], 'jruby-docs'
+ mv Dir['COPYING*'], 'jruby-docs'
+ mv Dir['LICENSE*'], 'jruby-docs'
mv 'README', 'jruby-docs'
rm_rf 'lib/ruby/1.9'
rm_rf 'lib/ruby/gems/1.8/doc'
@@ -85,24 +85,24 @@ namespace :'all-in-one' do
end
desc 'Install Buildr gem and dependencies'
- task :install_dependencies do
- puts "Install ffi-ncurses"
- sh "bin/jruby -S gem install -b ffi-ncurses --version 0.4.0"
+ task 'install_dependencies' do
+ puts 'Install ffi-ncurses'
+ sh 'bin/jruby -S gem install -b ffi-ncurses --version 0.4.0'
- puts "Install rubygems-update"
- sh "bin/jruby -S gem install -b rubygems-update"
+ puts 'Install rubygems-update'
+ sh 'bin/jruby -S gem install -b rubygems-update'
- puts "Upgrade Rubygems"
- sh "bin/jruby -S gem update --system"
+ puts 'Upgrade Rubygems'
+ sh 'bin/jruby -S gem update --system'
- puts "Install Buildr gem ..."
- sh "bin/jruby", '-S', 'gem', 'install', FileList['../../pkg/*-java.gem'].first,
+ puts 'Install Buildr gem ...'
+ sh 'bin/jruby', '-S', 'gem', 'install', FileList['../../pkg/*-java.gem'].first,
'--no-rdoc', '--no-ri'
- puts "[X] Install Buildr gem"
+ puts '[X] Install Buildr gem'
end
desc 'Add Buildr executables/scripts'
- task :add_execs do
+ task 'add_execs' do
cp 'bin/jruby.exe', 'bin/_buildr.exe'
cp "#{workspace_dir}/all-in-one/buildr", 'bin/buildr'
cp "#{workspace_dir}/all-in-one/_buildr", 'bin/_buildr'
@@ -111,27 +111,27 @@ namespace :'all-in-one' do
end
desc 'Package distribution'
- task :package do
+ task 'package' do
pkg_dir = "#{workspace_dir}/pkg"
mkpath pkg_dir
- puts "Zipping distribution ..."
+ puts 'Zipping distribution ...'
cd '..'
new_dir = "#{spec.name}-all-in-one-#{spec.version}"
mv dir, new_dir
zip = "#{pkg_dir}/#{new_dir}.zip"
rm zip if File.exist? zip
sh 'zip', '-q', '-r', zip, new_dir
- puts "[X] Zipped distribution"
+ puts '[X] Zipped distribution'
- puts "Tarring distribution ..."
+ puts 'Tarring distribution ...'
tar = "#{pkg_dir}/#{new_dir}.tar.gz"
rm tar if File.exist? tar
sh 'tar', 'czf', tar, new_dir
- puts "[X] Tarred distribution"
+ puts '[X] Tarred distribution'
rm_rf new_dir
end
end
-task(:clobber) { rm_rf '_all-in-one' }
+task('clobber') { rm_rf '_all-in-one' }
Modified: buildr/trunk/rakelib/checks.rake
URL: http://svn.apache.org/viewvc/buildr/trunk/rakelib/checks.rake?rev=1395216&r1=1395215&r2=1395216&view=diff
==============================================================================
--- buildr/trunk/rakelib/checks.rake (original)
+++ buildr/trunk/rakelib/checks.rake Sun Oct 7 05:48:00 2012
@@ -14,9 +14,9 @@
# the License.
-desc "Check that source files contain the Apache license"
-task :license=>FileList["**/*.{rb,rake,java,gemspec,buildfile}", 'Rakefile'] do |task|
- puts "Checking that files contain the Apache license ... "
+desc 'Check that source files contain the Apache license'
+task 'license' => FileList['**/*.{rb,rake,java,gemspec,buildfile}', 'Rakefile'] do |task|
+ puts 'Checking that files contain the Apache license ... '
required = task.prerequisites.select { |fn| File.file?(fn) }
missing = required.reject { |fn|
comments = File.read(fn).scan(/(\/\*(.*?)\*\/)|^#\s+(.*?)$|^-#\s+(.*?)$|<!--(.*?)-->/m).
@@ -24,5 +24,5 @@ task :license=>FileList["**/*.{rb,rake,j
comments =~ /Licensed to the Apache Software Foundation/ && comments =~ /http:\/\/www.apache.org\/licenses\/LICENSE-2.0/
}
fail "#{missing.join(', ')} missing Apache License, please add it before making a release!" unless missing.empty?
- puts "[x] Source files contain the Apache license"
+ puts '[x] Source files contain the Apache license'
end
Modified: buildr/trunk/rakelib/doc.rake
URL: http://svn.apache.org/viewvc/buildr/trunk/rakelib/doc.rake?rev=1395216&r1=1395215&r2=1395216&view=diff
==============================================================================
--- buildr/trunk/rakelib/doc.rake (original)
+++ buildr/trunk/rakelib/doc.rake Sun Oct 7 05:48:00 2012
@@ -14,18 +14,18 @@
# the License.
if (RUBY_PLATFORM[/java/] and JRUBY_VERSION < '1.6.6')
- puts "Running jekyll under jruby < 1.6.6 would never complete!"
+ puts 'Running jekyll under jruby < 1.6.6 would never complete!'
else
gem 'rdoc'
require 'rdoc/task'
- desc "Creates a symlink to rake's lib directory to support combined rdoc generation"
- file "rake/lib" do
- rake_path = $LOAD_PATH.find { |p| File.exist? File.join(p, "rake.rb") }
- mkdir_p "rake"
- File.symlink(rake_path, "rake/lib")
+ desc 'Creates a symlink to rake''s lib directory to support combined rdoc generation'
+ file 'rake/lib' do
+ rake_path = $LOAD_PATH.find { |p| File.exist? File.join(p, 'rake.rb') }
+ mkdir_p 'rake'
+ File.symlink(rake_path, 'rake/lib')
end
- desc "Generate RDoc documentation in rdoc/"
+ desc 'Generate RDoc documentation in rdoc/'
RDoc::Task.new :rdoc do |rdoc|
rdoc.rdoc_dir = 'rdoc'
rdoc.title = spec.name
@@ -36,7 +36,7 @@ else
# include rake source for better inheritance rdoc
rdoc.rdoc_files.include('rake/lib/**.rb')
end
- task :rdoc => ["rake/lib"]
+ task :rdoc => %w(rake/lib)
begin
require 'jekylltask'
@@ -58,21 +58,21 @@ else
end
Liquid::Template.register_filter(TocFilter)
- desc "Generate Buildr documentation in _site/"
+ desc 'Generate Buildr documentation in _site/'
JekyllTask.new :jekyll do |task|
task.source = 'doc'
task.target = '_site'
end
rescue LoadError
- puts "Buildr uses the jekyll gem to generate the Web site. You can install it by running bundler"
+ puts 'Buildr uses the jekyll gem to generate the Web site. You can install it by running bundler'
end
- if 0 == system("pygmentize -V > /dev/null 2> /dev/null")
- puts "Buildr uses the Pygments python library. You can install it by running 'sudo easy_install Pygments' or 'sudo apt-get install python-pygments'"
+ if 0 == system('pygmentize -V > /dev/null 2> /dev/null')
+ puts 'Buildr uses the Pygments python library. You can install it by running ''sudo easy_install Pygments'' or ''sudo apt-get install python-pygments'''
end
- desc "Generate Buildr documentation as buildr.pdf"
+ desc 'Generate Buildr documentation as buildr.pdf'
file 'buildr.pdf'=>'_site' do |task|
pages = File.read('_site/preface.html').scan(/<li><a href=['"]([^'"]+)/).flatten.map { |f| "_site/#{f}" }
sh 'prince', '--input=html', '--no-network', '--log=prince_errors.log', "--output=#{task.name}", '_site/preface.html', *pages
@@ -108,7 +108,7 @@ ForceType 'text/plain; charset=UTF-8'
end
# Update HTML + PDF documentation (but not entire site; no specs, coverage, etc.)
- task 'publish-doc' => ['buildr.pdf', '_site'] do
+ task 'publish-doc' => %w(buildr.pdf _site) do
cp 'buildr.pdf', '_site'
target = "people.apache.org:/www/#{spec.name}.apache.org/"
puts "Uploading new site to #{target} ..."
@@ -117,7 +117,7 @@ ForceType 'text/plain; charset=UTF-8'
puts "Done"
end
- task :clobber do
+ task 'clobber' do
rm_rf '_site'
rm_f 'buildr.pdf'
rm_f 'prince_errors.log'
Modified: buildr/trunk/rakelib/metrics.rake
URL: http://svn.apache.org/viewvc/buildr/trunk/rakelib/metrics.rake?rev=1395216&r1=1395215&r2=1395216&view=diff
==============================================================================
--- buildr/trunk/rakelib/metrics.rake (original)
+++ buildr/trunk/rakelib/metrics.rake Sun Oct 7 05:48:00 2012
@@ -13,15 +13,15 @@
# License for the specific language governing permissions and limitations under
# the License.
-namespace :metrics do
+namespace 'metrics' do
desc 'run Saikuro reports'
- task :saikuro do
+ task 'saikuro' do
gem 'atoulme-Saikuro'
require 'saikuro'
- output_dir = File.expand_path(File.join(File.dirname(__FILE__), "..", "_reports", "saikuro"))
- base_dir = Pathname.new(File.expand_path(File.join(File.dirname(__FILE__), "..")))
- rb_files = ["lib", "addon"].collect { |folder|
- FileList[File.expand_path(File.join(File.dirname(__FILE__), "..", folder, "**", "*.rb"))]
+ output_dir = File.expand_path(File.join(File.dirname(__FILE__), '..', '_reports', 'saikuro'))
+ base_dir = Pathname.new(File.expand_path(File.join(File.dirname(__FILE__), '..')))
+ rb_files = %w(lib addon).collect { |folder|
+ FileList[File.expand_path(File.join(File.dirname(__FILE__), '..', folder, '**', '*.rb'))]
}.flatten.collect {|path|
Pathname.new(path).relative_path_from(base_dir).to_s
}
@@ -29,11 +29,11 @@ namespace :metrics do
end
desc 'generate ccn treemap'
- task :ccn_treemap do
+ task 'ccn_treemap' do
require 'saikuro_treemap'
- SaikuroTreemap.generate_treemap :code_dirs => ['lib', 'addon'], :output_file => "_reports/saikuro_treemap.html"
+ SaikuroTreemap.generate_treemap :code_dirs => %w(lib addon), :output_file => '_reports/saikuro_treemap.html'
end
end
desc 'Run all metrics tools'
-task :metrics => ["metrics:saikuro", "metrics:ccn_treemap"]
\ No newline at end of file
+task 'metrics' => %w(metrics:saikuro metrics:ccn_treemap)
\ No newline at end of file
Modified: buildr/trunk/rakelib/package.rake
URL: http://svn.apache.org/viewvc/buildr/trunk/rakelib/package.rake?rev=1395216&r1=1395215&r2=1395216&view=diff
==============================================================================
--- buildr/trunk/rakelib/package.rake (original)
+++ buildr/trunk/rakelib/package.rake Sun Oct 7 05:48:00 2012
@@ -20,15 +20,15 @@ package = Gem::PackageTask.new(spec) do
pkg.need_zip = true
end
-desc "Compile Java libraries used by Buildr"
-task :compile do
- puts "Compiling Java libraries ..."
+desc 'Compile Java libraries used by Buildr'
+task 'compile' do
+ puts 'Compiling Java libraries ...'
args = RbConfig::CONFIG['ruby_install_name'], File.expand_path(RUBY_PLATFORM[/java/] ? '_jbuildr' : '_buildr'), '--buildfile', 'buildr.buildfile', 'compile'
args << '--trace' if Rake.application.options.trace
sh *args
end
-file Gem::PackageTask.new(spec).package_dir => :compile
-file Gem::PackageTask.new(spec).package_dir_path => :compile
+file Gem::PackageTask.new(spec).package_dir => 'compile'
+file Gem::PackageTask.new(spec).package_dir_path => 'compile'
# We also need the other packages (JRuby if building on Ruby, and vice versa)
# Must call new with block, even if block does nothing, otherwise bad things happen.
@@ -36,16 +36,17 @@ file Gem::PackageTask.new(spec).package_
Gem::PackageTask.new(s) { |task| }
end
-desc "Upload snapshot packages over to people.apache.org"
-task :snapshot=>[:package] do
+desc 'Upload snapshot packages over to people.apache.org'
+task 'snapshot' => %w(package) do
rm_rf '_snapshot' # Always start with empty directory
- puts "Copying existing gems from Apache"
+ puts 'Copying existing gems from Apache'
sh 'rsync', '--progress', '--recursive', 'people.apache.org:public_html/buildr/snapshot/', '_snapshot/'
- puts "Copying new gems over"
+ puts 'Copying new gems over'
cp FileList['pkg/{*.gem,*.tgz,*.zip}'], '_snapshot/gems'
- puts "Generating gem index ..."
+ puts 'Generating gem index ...'
sh 'gem', 'generate_index', '--directory', '_snapshot'
- puts "Copying gem and index back to Apache"
+ puts 'Copying gem and index back to Apache'
sh 'rsync', '--progress', '--recursive', '_snapshot/', 'people.apache.org:public_html/buildr/snapshot/'
end
-task(:clobber) { rm_rf '_snapshot' }
+task('clobber') { rm_rf 'target' }
+task('clobber') { rm_rf '_snapshot' }
Modified: buildr/trunk/rakelib/release.rake
URL: http://svn.apache.org/viewvc/buildr/trunk/rakelib/release.rake?rev=1395216&r1=1395215&r2=1395216&view=diff
==============================================================================
--- buildr/trunk/rakelib/release.rake (original)
+++ buildr/trunk/rakelib/release.rake Sun Oct 7 05:48:00 2012
@@ -21,19 +21,19 @@ task :release do
url = "people.apache.org:~/public_html/#{spec.name}/#{spec.version}"
puts "Populating _release directory from #{url} ..."
sh 'rsync', '--progress', '--recursive', url, '_release'
- puts "[X] Staged files are now in _release"
+ puts '[X] Staged files are now in _release'
end.call
# Upload binary and source packages and new Web site
lambda do
target = "people.apache.org:/www/www.apache.org/dist/#{spec.name}/#{spec.version}"
- puts "Uploading packages to www.apache.org/dist ..."
+ puts 'Uploading packages to www.apache.org/dist ...'
host, remote_dir = target.split(':')
sh 'ssh', host, 'rm', '-rf', remote_dir rescue nil
sh 'ssh', host, 'mkdir', remote_dir
sh 'rsync', '--progress', '--recursive', "_release/#{spec.version}/dist/", target
- puts "[X] Uploaded packages to www.apache.org/dist"
+ puts '[X] Uploaded packages to www.apache.org/dist'
target = "people.apache.org:/www/#{spec.name}.apache.org/"
puts "Uploading new site to #{spec.name}.apache.org ..."
@@ -54,7 +54,7 @@ task :release do
rubyforge.userconfig.merge!('release_changes'=>"_release/#{spec.version}/CHANGES", 'preformatted' => true)
rubyforge.add_release spec.rubyforge_project.downcase, spec.name.downcase, spec.version.to_s, *files
- puts "Posting news to RubyForge ... "
+ puts 'Posting news to RubyForge ...'
changes = File.read("_release/#{spec.version}/CHANGES")[/.*?\n(.*)/m, 1]
rubyforge.post_news spec.rubyforge_project.downcase, "Buildr #{spec.version} released",
"#{spec.description}\n\nNew in Buildr #{spec.version}:\n#{changes.gsub(/^/, ' ')}\n"
@@ -68,7 +68,7 @@ task :release do
puts "Push gem #{f} to RubyForge.org / Gemcutter ... "
`gem push #{f}`
end
- puts "[X] Pushed gems to Rubyforge.org / Gemcutter"
+ puts '[X] Pushed gems to Rubyforge.org / Gemcutter'
end.call
# Create an SVN tag for this release.
@@ -81,7 +81,7 @@ task :release do
if ok
puts "[X] Tagged this release as tags/#{spec.version} ... "
else
- puts "Could not create tag, please do it yourself!"
+ puts 'Could not create tag, please do it yourself!'
puts %{ svn copy #{url} #{new_url} -m "Release #{spec.version}"}
end
end
@@ -150,11 +150,11 @@ The Apache Buildr Team
File.open 'announce-email.txt', 'w' do |file|
file.write email
end
- puts "[X] Created release announce email template in 'announce-email.txt'"
+ puts '[X] Created release announce email template in ''announce-email.txt'''
puts email
end
end
-task(:clobber) { rm_rf '_release' }
+task('clobber') { rm_rf '_release' }
Modified: buildr/trunk/rakelib/rspec.rake
URL: http://svn.apache.org/viewvc/buildr/trunk/rakelib/rspec.rake?rev=1395216&r1=1395215&r2=1395216&view=diff
==============================================================================
--- buildr/trunk/rakelib/rspec.rake (original)
+++ buildr/trunk/rakelib/rspec.rake Sun Oct 7 05:48:00 2012
@@ -32,7 +32,7 @@ begin
end
end
- desc "Run all specs"
+ desc 'Run all specs'
RSpec::Core::RakeTask.new :spec=>['_reports', :compile] do |task|
ENV['USE_FSC'] = 'no'
task.rspec_files = FileList['spec/**/*_spec.rb']
@@ -59,11 +59,11 @@ begin
# CI_Reporter does not quote the path to rspec_loader which causes problems when ruby is installed in C:/Program Files.
# However, newer versions of rspec don't like double quotes escaping as well, so removing them for now.
ci_rep_path = Gem.loaded_specs['ci_reporter'].full_gem_path
- ENV["SPEC_OPTS"] = [ENV["SPEC_OPTS"], default_spec_opts, "--require", "#{ci_rep_path}/lib/ci/reporter/rake/rspec_loader.rb", "--format", "CI::Reporter::RSpec"].join(" ")
+ ENV['SPEC_OPTS'] = [ENV['SPEC_OPTS'], default_spec_opts, '--require', "#{ci_rep_path}/lib/ci/reporter/rake/rspec_loader.rb", '--format', 'CI::Reporter::RSpec'].join(" ")
end
desc 'Run all specs with CI reporter'
- task :ci=>[:clobber, :load_ci_reporter, :spec]
+ task 'ci' => ['clobber', 'load_ci_reporter', 'spec']
def rvm_run_in(version, command)
if !(Config::CONFIG['host_os'] =~ /mswin|win32|dos/i)
@@ -75,34 +75,34 @@ begin
end
# Useful for testing with JRuby when using Ruby and vice versa.
- namespace :spec do
- desc "Run all specs specifically with Ruby 1.9"
- task :ruby_1_9 do
- puts "Running test suite using Ruby ..."
- rvm_run_in("ruby-1.9.2-p320@buildr", "rake spec")
+ namespace 'spec' do
+ desc 'Run all specs specifically with Ruby 1.9'
+ task 'ruby_1_9' do
+ puts 'Running test suite using Ruby ...'
+ rvm_run_in('ruby-1.9.2-p320@buildr', 'rake spec')
end
- desc "Run all specs specifically with Ruby 1.8"
- task :ruby_1_8 do
- puts "Running test suite using Ruby ..."
- rvm_run_in("ruby-1.8.7-p358@buildr", "rake spec")
+ desc 'Run all specs specifically with Ruby 1.8'
+ task 'ruby_1_8' do
+ puts 'Running test suite using Ruby ...'
+ rvm_run_in('ruby-1.8.7-p358@buildr', 'rake spec')
end
- desc "Run all specs specifically with JRuby"
- task :jruby do
- puts "Running test suite using JRuby ..."
- rvm_run_in("jruby-1.6.7@buildr", "rake spec")
+ desc 'Run all specs specifically with JRuby'
+ task 'jruby' do
+ puts 'Running test suite using JRuby ...'
+ rvm_run_in('jruby-1.6.7@buildr', 'rake spec')
end
- desc "Run all specs across various rubies"
- task :all => [:jruby, :ruby_1_8, :ruby_1_9]
+ desc 'Run all specs across various rubies'
+ task 'all' => ['jruby', 'ruby_1_8', 'ruby_1_9']
end
- task :clobber do
+ task 'clobber' do
rm_f 'failed'
rm_rf '_reports'
end
rescue LoadError => e
- puts "Buildr uses RSpec. You can install it by running bundler"
+ puts 'Buildr uses RSpec. You can install it by running bundler'
end
Modified: buildr/trunk/rakelib/stage.rake
URL: http://svn.apache.org/viewvc/buildr/trunk/rakelib/stage.rake?rev=1395216&r1=1395215&r2=1395216&view=diff
==============================================================================
--- buildr/trunk/rakelib/stage.rake (original)
+++ buildr/trunk/rakelib/stage.rake Sun Oct 7 05:48:00 2012
@@ -19,31 +19,31 @@ require 'digest/sha1'
gpg_cmd = 'gpg2'
-task :prepare do |task, args|
+task 'prepare' do |task, args|
gpg_arg = args.gpg || ENV['gpg']
# Make sure we're doing a release from checked code.
lambda do
- puts "Checking there are no local changes ... "
+ puts 'Checking there are no local changes ... '
svn = `svn status`
fail "Cannot release unless all local changes are in SVN:\n#{svn}" unless svn.empty?
git = `git status -s`
fail "Cannot release unless all local changes are in Git:\n#{git}" if git[/^ M/] && ENV["IGNORE_GIT"].nil?
- puts "[X] There are no local changes, everything is in source control"
+ puts '[X] There are no local changes, everything is in source control'
end.call
# Make sure we have a valid CHANGELOG entry for this release.
lambda do
- puts "Checking that CHANGELOG indicates most recent version and today's date ... "
+ puts 'Checking that CHANGELOG indicates most recent version and today''s date ... '
expecting = "#{spec.version} (#{Time.now.strftime('%Y-%m-%d')})"
header = File.readlines('CHANGELOG').first.chomp
fail "Expecting CHANGELOG to start with #{expecting}, but found #{header} instead" unless expecting == header
- puts "[x] CHANGELOG indicates most recent version and today's date"
+ puts '[x] CHANGELOG indicates most recent version and today''s date'
end.call
# Need GPG to sign the packages.
lambda do
- gpg_arg or fail "Please run with gpg=<argument for gpg --local-user>"
+ gpg_arg or fail 'Please run with gpg=<argument for gpg --local-user>'
gpg_ok = `gpg2 --list-keys #{gpg_arg}` rescue nil
if !$?.success?
gpg_ok = `gpg --list-keys #{gpg_arg}`
@@ -52,27 +52,27 @@ task :prepare do |task, args|
fail "No GPG user #{gpg_arg}" if gpg_ok.empty?
end.call
- task(:license).invoke
+ task('license').invoke
# Need JRuby, Scala and Groovy installed to run all the specs.
lambda do
- puts "Checking that we have Scala and Groovy available ... "
+ puts 'Checking that we have Scala and Groovy available ... '
`scala -version`
- $?.exitstatus == 1 or fail "Scala is not installed"
+ $?.exitstatus == 1 or fail 'Scala is not installed'
sh 'groovy -version'
- puts "[X] We have Scala and Groovy"
+ puts '[X] We have Scala and Groovy'
end.call
# Need Prince to generate PDF
lambda do
- puts "Checking that we have prince available ... "
+ puts 'Checking that we have prince available ... '
sh 'prince --version'
- puts "[X] We have prince available"
+ puts '[X] We have prince available'
end.call
# Need RubyForge to upload new release files.
lambda do
- puts "[!] Make sure you have admin privileges to make a release on RubyForge"
+ puts '[!] Make sure you have admin privileges to make a release on RubyForge'
rubyforge = RubyForge.new.configure
rubyforge.login
rubyforge.scrape_project(spec.name)
@@ -84,13 +84,13 @@ task :prepare do |task, args|
task('spec:jruby').invoke unless RUBY_PLATFORM[/java/]
end
-task :stage=>[:clobber, :prepare] do |task, args|
+task 'stage' => %w(clobber prepare) do |task, args|
gpg_arg = args.gpg || ENV['gpg']
mkpath '_staged'
# Start by figuring out what has changed.
lambda do
- puts "Looking for changes between this release and previous one ..."
+ puts 'Looking for changes between this release and previous one ...'
pattern = /(^(\d+\.\d+(?:\.\d+)?)\s+\(\d{4}-\d{2}-\d{2}\)\s*((:?^[^\n]+\n)*))/
changes = File.read('CHANGELOG').scan(pattern).inject({}) { |hash, set| hash[set[1]] = set[2] ; hash }
current = changes[spec.version.to_s]
@@ -99,14 +99,14 @@ task :stage=>[:clobber, :prepare] do |ta
file.write "#{spec.version} (#{Time.now.strftime('%Y-%m-%d')})\n"
file.write current
end
- puts "[X] Listed most recent changed in _staged/CHANGES"
+ puts '[X] Listed most recent changed in _staged/CHANGES'
end.call
# Create the packages (gem, tarball) and sign them. This requires user
# intervention so the earlier we do it the better.
lambda do
- puts "Creating and signing release packages ..."
- task(:package).invoke
+ puts 'Creating and signing release packages ...'
+ task('package').invoke
mkpath '_staged/dist'
FileList['pkg/*.{gem,zip,tgz}'].each do |source|
pkg = source.pathmap('_staged/dist/%n%x')
@@ -117,13 +117,13 @@ task :stage=>[:clobber, :prepare] do |ta
sh gpg_cmd, '--local-user', gpg_arg, '--armor', '--output', pkg + '.asc', '--detach-sig', pkg, :verbose=>true
end
cp 'etc/KEYS', '_staged/dist'
- puts "[X] Created and signed release packages in _staged/dist"
+ puts '[X] Created and signed release packages in _staged/dist'
end.call
# The download page should link to the new binaries/sources, and we
# want to do that before generating the site/documentation.
lambda do
- puts "Updating download page with links to release packages ... "
+ puts 'Updating download page with links to release packages ... '
mirror = "http://www.apache.org/dyn/closer.cgi/#{spec.name}/#{spec.version}"
official = "http://www.apache.org/dist/#{spec.name}/#{spec.version}"
rows = FileList['_staged/dist/*.{gem,tgz,zip}'].map { |pkg|
@@ -151,10 +151,10 @@ p>. ("Release signing keys":#{official}/
# Now we can create the Web site, this includes running specs, coverage report, etc.
# This will take a while, so we want to do it as last step before upload.
lambda do
- puts "Creating new Web site"
+ puts 'Creating new Web site'
task(:site).invoke
cp_r '_site', '_staged/site'
- puts "[X] Created new Web site in _staged/site"
+ puts '[X] Created new Web site in _staged/site'
end.call
@@ -207,11 +207,11 @@ The following changes were made since #{
File.open 'vote-email.txt', 'w' do |file|
file.write email
end
- puts "[X] Created release vote email template in 'vote-email.txt'"
+ puts '[X] Created release vote email template in ''vote-email.txt'''
puts email
end.call
end
-task(:clobber) { rm_rf '_staged' }
+task('clobber') { rm_rf '_staged' }