Test it with an instance variable.

Without the wrap=true the @doc "contaminates" the caller file's context.

On Tue, Sep 24, 2013 at 12:48 PM, Love U Ruby <lists / ruby-forum.com> wrote:
> I was trying to understand the difference between `Kernel#load` with the
> second parameter and without.
>
> I wrote the code :-
>
> so.rb
> =====
>
> require 'nokogiri'
>
> doc = Nokogiri::HTML.parse("<div>foo</div>")
> p doc.child
>
> test.rb
> =======
>
> load 'C:/Users/rakshiar/Documents/userdata/so.rb',true
>
>
> But I didn't notice any difference between `Kernel#load` call with the
> second parameter and without. Probably my example is not one which can
> answer the documentation-
> http://www.ruby-doc.org/core-2.0.0/Kernel.html#method-i-load
>
> I went thorough -
> http://ionrails.com/2009/09/19/ruby_require-vs-load-vs-include-vs-extend/
> and
> http://stackoverflow.com/questions/3170638/how-does-load-differ-from-require-in-ruby
> . But those doesn't answer my question.
>
> --
> Posted via http://www.ruby-forum.com/.