Skip to content

Instantly share code, notes, and snippets.

@chris-skud
Last active August 29, 2015 14:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save chris-skud/653abd769c7082eb4b74 to your computer and use it in GitHub Desktop.
Save chris-skud/653abd769c7082eb4b74 to your computer and use it in GitHub Desktop.
trick to exec ruby file from shell or rails
#!/usr/bin/env ruby
$:.unshift File.dirname(__FILE__)
require ‘<the_module>’
#run if command line, do not if required (called from rspec)
if $0 == __FILE__
require File.join(File.expand_path("..", Dir.pwd), 'path/to/other/rubies')
<TheClass>.provider_pull
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment