-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
36 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,41 @@ | ||
# frozen_string_literal: true | ||
|
||
require 'rake/testtask' | ||
require 'bump/tasks' | ||
|
||
Rake::TestTask.new do |t| | ||
t.libs << 'test' | ||
end | ||
|
||
desc 'Run tests' | ||
task default: :test | ||
|
||
desc 'Run the Windclutter executable' | ||
task :windclutter, [:args] do | ||
args = ARGV[1..] # Capture all arguments after the task name | ||
begin | ||
cmd = "ruby -Ilib ./bin/windclutter #{args.join(' ')}" | ||
sh cmd | ||
ensure | ||
exit 0 | ||
end | ||
end | ||
|
||
namespace :gem do | ||
desc 'Build the gem' | ||
task :build do | ||
sh 'gem build windclutter.gemspec' | ||
end | ||
|
||
desc 'Push the latest gem that was built.' | ||
task :push do | ||
gem_file = Dir.glob('*.gem').max_by { |f| File.mtime(f) } | ||
|
||
if gem_file.nil? | ||
puts 'No gem file found in the current directory.' | ||
else | ||
puts "Pushing gem: #{gem_file}" | ||
sh "gem push #{gem_file}" | ||
end | ||
end | ||
end |