Smart shebang for script/runner


/ Published in: Rails
Save to your folder(s)



Copy this code and paste it in your HTML
  1. #!/usr/bin/env ruby
  2. unless $0 =~ /runner/
  3. system("#{File.dirname(__FILE__)}/runner", __FILE__)
  4. exit 0
  5. end
  6.  
  7. puts 'your code goes here'

URL: http://bob.zoller.us/post/43855416/script-runner-script-that-doesnt-require-an-absolute

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.