Skip to content

Instantly share code, notes, and snippets.

@lisa
Created May 10, 2018 18:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lisa/d6679511c7882b3e6a16dcdc5f694a03 to your computer and use it in GitHub Desktop.
Save lisa/d6679511c7882b3e6a16dcdc5f694a03 to your computer and use it in GitHub Desktop.
qoobaa/s3 issue with version 0.3.26
lisas@lisas ~ $ for v in ruby-1.8.7-p374 ruby-2.1.7 ruby-2.4.0 ruby-2.5.0; do rvm use $v; ruby tester.rb ; done
Using /Users/lisas/.rvm/gems/ruby-1.8.7-p374
Ruby version: 1.8.7
@ivar is defined
@notvar is not defined
Using /Users/lisas/.rvm/gems/ruby-2.1.7
Ruby version: 2.1.7
@ivar is defined
@notvar is not defined
Using /Users/lisas/.rvm/gems/ruby-2.4.0
Ruby version: 2.4.0
@ivar is defined
@notvar is not defined
Using /Users/lisas/.rvm/gems/ruby-2.5.0
Ruby version: 2.5.0
@ivar is defined
@notvar is not defined
## tester.rb
class Test
def initialize
@ivar = nil
end
def isdef
if defined?(@ivar)
puts "@ivar is defined"
else
puts "@ivar is not defined"
end
if defined?(@notvar)
puts "@notvar is defined"
else
puts "@notvar is not defined"
end
end
end
puts "Ruby version: #{RUBY_VERSION}"
tester = Test.new
tester.isdef
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment