Skip to content

Instantly share code, notes, and snippets.

@gmcquillan
Created March 1, 2012 21:46
Show Gist options
  • Save gmcquillan/1953453 to your computer and use it in GitHub Desktop.
Save gmcquillan/1953453 to your computer and use it in GitHub Desktop.
crazy ruby
#!/usr/bin/env ruby
#
print "default = {:hbaseregion => {:handler_count => 25}}\n\n"
default = {:hbaseregion => {:handler_count => 25}}
print "testing defined?(default[:hbaseregion][:handler_count])\n"
if (defined?(default[:hbaseregion][:handler_count]))
print "yes\n\n"
else
print "no\n\n"
end
print "testing defined?(default[:hbaseregion][:buh])\n"
if (defined?(default[:hbaseregion][:buh]))
print "yes\n\n"
else
print "no\n\n"
end
print "testing defined?(default[:hbaseregion][:buh]).nil?\n"
if (defined?(default[:hbaseregion][:buh]).nil?)
print "yes\n\n"
else
print "no\n\n"
end
print "testing defined?(default[:hbaseregion][:handler_count]).nil?\n"
if (defined?(default[:hbaseregion][:handler_count]).nil?)
print "yes\n\n"
else
print "no\n\n"
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment