This commit is contained in:
Loic Nageleisen 2014-12-10 18:33:15 +01:00
commit 32b99b62bf
20 changed files with 644 additions and 0 deletions

38
test2.rb Normal file
View file

@ -0,0 +1,38 @@
require 'pp'
#require 'pry'
require 'binding_of_caller'
def cards
ace = 'of hearts'
queen = 'of diamonds'
binding
end
c = cards
pp c.eval('ace')
pp c.eval('ace = "of spades"')
pp c.eval('ace')
pp c.eval('foo = 42')
pp c.eval('foo')
def set_baz(b)
b.eval('baz = 44')
pp b.eval('baz')
pp binding.callers
end
def meh
foo = 42
bar = 43
#baz = nil
set_baz binding
binding
end
m = meh
pp m.eval('foo')
pp m.eval('bar')
pp m.eval('baz')