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
17 changes: 17 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,23 @@ jobs:
./ir.sh smoke.rb
fi

# Samples/Notepad, a Windows Forms application, driven by its own test with nobody
# at the keyboard. A dialog that never closes would wait forever, hence the limit.
- name: Notepad sample
if: runner.os == 'Windows'
timeout-minutes: 5
working-directory: ironruby
run: NOTEPAD_SCREENSHOTS="$RUNNER_TEMP/notepad" cmd //c ir.cmd Samples/Notepad/test_notepad.rb

# What each window looked like, to look at a failure without a Windows machine.
- name: Keep the Notepad screenshots
if: always() && runner.os == 'Windows'
uses: actions/upload-artifact@v7
with:
name: notepad-screenshots-${{ matrix.tfm }}
path: ${{ runner.temp }}/notepad
if-no-files-found: ignore

# irubyc --single-file: one executable carrying IronRuby, libprism and the stdlib.
# Run from an empty directory, so it can only work if everything really is inside it.
- name: irubyc single file
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -374,6 +374,8 @@ readline are not implemented on Windows; `IO.console` is nil, so irb falls back
input path. Windows Forms and WPF (`require "System.Windows.Forms"`, `"PresentationFramework"`)
come from the Windows Desktop runtime, which `ir` references whenever it is built for Windows
(`-p:IronRubyWindowsDesktop=false` leaves it out); on Linux and macOS they do not exist.
[`Samples/Notepad`](Samples/Notepad/notepad.rb) is Windows Notepad written that way, in Ruby
(`Samples\Notepad\notepad.cmd`); its test drives it with nobody at the keyboard and runs in CI.
macOS is untested.

## Binary releases
Expand Down
16 changes: 16 additions & 0 deletions Samples/Notepad/notepad.cmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
@echo off
rem IronRuby Notepad. Double-click it, drop a file on it, or run: notepad.cmd file.txt
rem
rem ir.exe is a console program, so Windows gives it a console window. "start /b" leaves
rem that console to ir.exe alone once this batch file has ended, and notepad.rb then
rem lets go of it, which closes the window. To keep the console for Ruby's output, run
rem ..\..\ir.cmd notepad.rb instead. The build is chosen as ir.cmd chooses it.
setlocal
set "IR_ROOT=%~dp0..\.."
if "%IR_CONFIG%"=="" if not exist "%IR_ROOT%\Src\Console\bin\Debug\" if exist "%IR_ROOT%\Src\Console\bin\Release\" set "IR_CONFIG=Release"
if "%IR_CONFIG%"=="" set "IR_CONFIG=Debug"
if "%IR_TFM%"=="" set "IR_TFM=net8.0"
set "IR_BIN=%IR_ROOT%\Src\Console\bin\%IR_CONFIG%\%IR_TFM%\win-x64\ir.exe"
if not exist "%IR_BIN%" set "IR_BIN=%IR_ROOT%\Src\Console\bin\%IR_CONFIG%\%IR_TFM%\ir.exe"
set "S=%IR_ROOT%\Src\StdLib"
start "" /b "%IR_BIN%" -X:UsePrism "-X:StdLib=%S%\ironruby;%S%\ruby\4.0;%S%\ruby\1.9.1" "%~dp0notepad.rb" %*
Loading
Loading