Skip to content

Instantly share code, notes, and snippets.

@npocmaka
Last active January 29, 2016 08:43
Show Gist options
  • Save npocmaka/2c0ee4d2a0b763940f61 to your computer and use it in GitHub Desktop.
Save npocmaka/2c0ee4d2a0b763940f61 to your computer and use it in GitHub Desktop.
Ruby Batch polyglot script
@break #^
=begin
:: the first line will define break as ruby instance variable and will end it with a comment
:: the second line will start ruby multiline comment
:: Batch will execute @break [@rem also can be used] command silently wich will do nothing no matter of passed arguments
:: the carret [^] at the end will escape the EOF character and batch will take the first two lines as one
:: http://dostips.com/forum/viewtopic.php?f=3&t=6931&p=45080#p45080
@echo off
echo batch part
ruby "%~f0" %*
exit /b 0
=end
puts 'ruby part'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment