tasks/default.rake in heel-3.2.1 vs tasks/default.rake in heel-4.0.0
- old
+ new
@@ -34,15 +34,17 @@
#------------------------------------------------------------------------------
# Minitest - standard TestTask
#------------------------------------------------------------------------------
begin
- require 'rake/testtask'
- Rake::TestTask.new( :test ) do |t|
- t.ruby_opts = %w[ -w ]
- t.libs = %w[ lib spec test ]
- t.pattern = "{test,spec}/**/{test_*,*_spec}.rb"
+ require 'minitest/test_task'
+ Minitest::TestTask.create( :test) do |t|
+ t.libs << "lib"
+ t.libs << "spec"
+ t.libs << "test"
+ t.warning = true
+ t.test_globs = "{test,spec}/**/{test_*,*_spec}.rb"
end
task :test_requirements
task :test => :test_requirements
task :default => :test
@@ -141,38 +143,44 @@
def fixme_project_path( subtree )
fixme_project_root.join( subtree )
end
def local_fixme_files
- This.manifest.select { |p| p =~ %r|^tasks/| }
+ local_files = This.manifest.select { |p| p =~ %r|^tasks/| }
+ local_files << ".semaphore/semaphore.yml"
end
def outdated_fixme_files
local_fixme_files.select do |local|
upstream = fixme_project_path( local )
- upstream.exist? &&
- ( Digest::SHA256.file( local ) != Digest::SHA256.file( upstream ) )
+ if upstream.exist? then
+ if File.exist?( local ) then
+ ( Digest::SHA256.file( local ) != Digest::SHA256.file( upstream ) )
+ else
+ true
+ end
+ end
end
end
def fixme_up_to_date?
outdated_fixme_files.empty?
end
desc "See if the fixme tools are outdated"
- task :outdated => :release_check do
+ task :outdated do
if fixme_up_to_date? then
puts "Fixme files are up to date."
else
outdated_fixme_files.each do |f|
puts "#{f} is outdated"
end
end
end
desc "Update outdated fixme files"
- task :update => :release_check do
+ task :update do
if fixme_up_to_date? then
puts "Fixme files are already up to date."
else
puts "Updating fixme files:"
outdated_fixme_files.each do |local|
@@ -199,11 +207,11 @@
f.write This.platform_gemspec.to_ruby
end
end
# .rbc files from ruby 2.0
-CLOBBER << FileList["**/*.rbc"]
+CLOBBER << "**/*.rbc"
# The standard gem packaging task, everyone has it.
require 'rubygems/package_task'
::Gem::PackageTask.new( This.platform_gemspec ) do
# nothing
@@ -211,32 +219,32 @@
#------------------------------------------------------------------------------
# Release - the steps we go through to do a final release, this is pulled from
# a compbination of mojombo's rakegem, hoe and hoe-git
#
-# 1) make sure we are on the master branch
+# 1) make sure we are on the main branch
# 2) make sure there are no uncommitted items
# 3) check the manifest and make sure all looks good
# 4) build the gem
# 5) do an empty commit to have the commit message of the version
# 6) tag that commit as the version
-# 7) push master
+# 7) push main
# 8) push the tag
# 7) pus the gem
#------------------------------------------------------------------------------
task :release_check do
- unless `git branch` =~ /^\* master$/
- abort "You must be on the master branch to release!"
+ unless `git branch` =~ /^\* main/
+ abort "You must be on the main branch to release!"
end
unless `git status` =~ /^nothing to commit/m
abort "Nope, sorry, you have unfinished business"
end
end
desc "Create tag v#{This.version}, build and push #{This.platform_gemspec.full_name} to rubygems.org"
task :release => [ :release_check, 'manifest:check', :gem ] do
sh "git commit --allow-empty -a -m 'Release #{This.version}'"
sh "git tag -a -m 'v#{This.version}' v#{This.version}"
- sh "git push origin master"
+ sh "git push origin main"
sh "git push origin v#{This.version}"
sh "gem push pkg/#{This.platform_gemspec.full_name}.gem"
end