-
Notifications
You must be signed in to change notification settings - Fork 0
/
Rakefile
45 lines (34 loc) · 1015 Bytes
/
Rakefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
# frozen_string_literal: true
require "bundler/gem_tasks"
require "rspec/core/rake_task"
RSpec::Core::RakeTask.new(:spec)
require "standard/rake"
task default: %i[spec standard]
# Adds renaming of Rake tasks, from https://blog.ladslezak.cz/2009/06/03/renaming-rake-task/
module Rake
class Application
def rename_task(task, oldname, newname)
@tasks = {} if @tasks.nil?
@tasks[newname.to_s] = task
@tasks.delete(oldname) if @tasks.has_key?(oldname)
end
end
end
# add new rename method to Rake::Task class
# to rename a task
class Rake::Task
def rename(new_name)
if !new_name.nil?
old_name = @name
return if old_name == new_name
@name = new_name.to_s
application.rename_task(self, old_name, new_name)
end
end
end
Rake::Task[:release].rename(:"release:gem")
desc "Release to RubyGems, but don't create a version tag (for use in release GitHub Action workflow)"
task :"workflow:release:gem" do
`gem install gem-release`
`gem release`
end