Project

General

Profile

Bug #1982 ยป helloworld.rb

johan556 (Johan Holmberg), 08/23/2009 05:32 AM

 
#
# Demonstrates scope problem in Ruby 1.9.
# Can be run like this:
#
# $ ruby1.8 -e 'load "helloworld.rb", true' # OK
# $ ruby1.9 -e 'load "helloworld.rb", true' # gives error
#

class Hello
def say ; puts "Hello" ; end
end

class HelloWorld
def say
Hello.new.say ; puts "World"
end
end

HelloWorld.new.say


    (1-1/1)