1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* ext/tk/ChangeLog.tkextlib: add log of the modification by

ocean <ocean@ruby-lang.org>.
* ext/tk/sample/tkextlib/treectrl/demo.rb: bridge the gap of
  Hash#index or Hash#key between ruby 1.8 and 1.9


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@8236 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nagai 2005-04-01 07:42:37 +00:00
parent ad755116ee
commit 011527f455
2 changed files with 22 additions and 2 deletions

View file

@ -7,8 +7,14 @@ $ScriptDir = File.dirname(File.expand_path(__FILE__))
$HasColumnCreate = Tk::TreeCtrl::HasColumnCreateCommand
class Hash
alias key index
if Hash.instance_methods.include?('key')
# probably ruby 1.9.x --> use Hash#key
# Because Hash#index show warning "Hash#index is deprecated; use Hash#key".
else
# probably ruby 1.8.x --> use Hash#index
class Hash
alias key index
end
end
class TkTreeCtrl_demo