Created

Embed URL

HTTPS clone URL

SSH clone URL

You can clone with HTTPS or SSH.

Download Gist

`self.inspect == 'main'` is no substitute for `__FILE__ == $0`

View main-tester-caller.rb
1 2 3 4 5
if self.inspect == 'main'
puts "I'm main"
else
puts "I'm a library"
end
View main-tester-caller.rb
1 2 3 4 5
$ ruby main-tester.rb
I'm main
$ ruby main-tester-caller.rb
I'm main
done in caller
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.