```ruby
#run.rb
#TODO: test on Windows

`g++ #{ARGF.filename}`
```

Add more compiler options Build executable in temporary directory Run executable if compile is successful
user
```ruby
#run.rb  #TODO: test on Windows

require 'tmpdir'

src = ARGF.filename
puts "about to compile and run #{src}"
Dir.mktmpdir do |tmp|
	exe = "#{tmp}/#{src}.exe"
	opts = '-W -Wall -Werror -pedantic'
	system("g++ #{opts} -o #{exe} #{src}") && system(exe)
end
```
assistant