Created
October 25, 2024 02:32
-
-
Save HarlemSquirrel/a6ed19c698ef70e3ecd87d57c36edb85 to your computer and use it in GitHub Desktop.
Single file code example with watcher
This file contains hidden or 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
## | |
# Single file starter with broken test using only the Ruby standard library. | |
# | |
def mymeth(a,b) | |
a + b | |
end | |
require "minitest/autorun" | |
class TheTest < Minitest::Test | |
def test_mymeth | |
assert_equal 3, mymeth(1,2) | |
end | |
end |
This file contains hidden or 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
## | |
# Watch for saves and run the code through the Ruby interpreter. | |
# Uses https://github.com/inotify-tools/inotify-tools/wiki | |
# | |
while inotifywait -e close_write something.rb; do clear; ruby something.rb; done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment