Could you repeat the test using the code bellow?

My point is, without the wrap=true the modification of @doc instance
variable inside "so.rb"
propagates back to the test.br context.

so.rb
======
require 'nokogiri'

@doc = Nokogiri::HTML.parse("<div>foo</div>")
puts "Inside so.rb"
p @doc


test.rb
=======
@doc = "doc is Just a String as an 'original' value"
puts "Inside test.rb before load"
p @doc #=> It renders that String

load "./so.rb", true
puts "Inside test.rb after load with the wrap=true option"
p @doc #=> Still rendering a String

load "./so.rb"
puts "Inside test.rb after load"
p @doc #=> Now, without the wrap=true, your @doc points to a
Nokogiri::HTML::Document
# Because it was set this way "inside" called file "so.rb".

Abinoam Jr.

On Tue, Sep 24, 2013 at 3:04 PM, Love U Ruby <lists / ruby-forum.com> wrote:
> Abinoam Jr. wrote in post #1122283:
>> Test it with an instance variable.
>>
>> Without the wrap=true the @doc "contaminates" the caller file's context.
>
>
> I tested with an instance variable,the result is same. I didn't get your
> point.
>
> --
> Posted via http://www.ruby-forum.com/.