Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 31 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: CI

on:
push:
pull_request:

jobs:
test:
runs-on: ${{ matrix.os }}

strategy:
fail-fast: false
matrix:
os:
- ubuntu-latest
- macos-latest
ruby-version:
- '3.0'
- '3.1'
- '3.2'
- '3.3'
- '3.4'

steps:
- uses: actions/checkout@v6
- run: ./bin/setup-deps
- uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby-version }}
bundler-cache: true
- run: bundle exec rake spec
8 changes: 0 additions & 8 deletions .travis.yml

This file was deleted.

6 changes: 2 additions & 4 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,8 @@ end

group :test do
gem 'rspec', ">=3.0"
gem 'wrong', path: "../wrong"
gem 'files', path: "../files"
# gem 'wrong', github: "alexch/wrong"
# gem 'files', github: "alexch/files"
gem 'wrong', path: "tmp/wrong"
gem 'files', path: "tmp/files"
end

gem 'wdm', '>= 0.1.0' if Gem.win_platform?
6 changes: 5 additions & 1 deletion bin/rerun
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,8 @@ end

exit if options.nil? or options[:cmd].nil? or options[:cmd].empty?

Rerun::Runner.keep_running(options[:cmd], options)
begin
Rerun::Runner.keep_running(options[:cmd], options)
rescue Rerun::ExitException
exit 0
end
27 changes: 27 additions & 0 deletions bin/setup-deps
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#!/bin/bash
set -e

cd "$(dirname "$0")/.."

mkdir -p tmp

echo "at=info msg=\"checking out test dependencies\""

if [ -d "tmp/wrong" ]; then
echo "at=info msg=\"wrong already exists, pulling latest\""
git -C tmp/wrong pull
else
echo "at=info msg=\"cloning wrong\""
git clone https://github.com/alexch/wrong.git tmp/wrong
rm -f tmp/wrong/wrong-java.gemspec
fi

if [ -d "tmp/files" ]; then
echo "at=info msg=\"files already exists, pulling latest\""
git -C tmp/files pull
else
echo "at=info msg=\"cloning files\""
git clone https://github.com/alexch/files.git tmp/files
fi

echo "at=info msg=\"dependencies ready\""
4 changes: 0 additions & 4 deletions geminstaller.yml

This file was deleted.

4 changes: 3 additions & 1 deletion lib/rerun.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
require "rerun/glob"

module Rerun

# Raised when the runner wants to exit cleanly.
# This allows tests to catch the exit instead of terminating the process.
class ExitException < StandardError; end
end

4 changes: 2 additions & 2 deletions lib/rerun/runner.rb
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ def start
say "Rerun (#{$PID}) running #{app_name} (#{@pid})"
rescue => e
puts "#{e.class}: #{e.message}"
exit
raise ExitException
end

status_thread = Process.detach(@pid) # so if the child exits, it dies
Expand Down Expand Up @@ -235,7 +235,7 @@ def change_message(changes)
def die
#stop_keypress_thread # don't do this since we're probably *in* the keypress thread
stop # stop the child process if it exists
exit 0 # todo: status code param
raise ExitException # todo: status code param
end

def join
Expand Down