Skip to content

Instantly share code, notes, and snippets.

@alexhanh
Last active August 29, 2015 14:08
Show Gist options
  • Select an option

  • Save alexhanh/07f6dde37d1d3046d636 to your computer and use it in GitHub Desktop.

Select an option

Save alexhanh/07f6dde37d1d3046d636 to your computer and use it in GitHub Desktop.
File.open('foo.rb', 'w') do |file|
file.write(%{
class Foo
def initialize
end
def bar
1
end
end
})
end
require './foo'
f = Foo.new
p f.bar
File.open('foo.rb', 'w') do |file|
file.write(%{
class Foo
def initialize
end
def bar
2
end
end
})
end
require './foo'
p 'After require: '
p f.bar
p Foo.new.bar
load 'foo.rb'
p 'After load: '
p f.bar
p Foo.new.bar
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment