diff options
| author | nagai <nagai@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2005-04-01 07:42:37 +0000 |
|---|---|---|
| committer | nagai <nagai@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2005-04-01 07:42:37 +0000 |
| commit | be2a22f54f3ffb652a505d36498e30557c515eec (patch) | |
| tree | 87e0dad95434e2b1528afe2faa8e836ea0e1796a /ext/tk/sample | |
| parent | 0d1a7767ab6c03c227aed0568765b85c1b51e285 (diff) | |
| download | ruby-be2a22f54f3ffb652a505d36498e30557c515eec.tar.gz ruby-be2a22f54f3ffb652a505d36498e30557c515eec.tar.xz ruby-be2a22f54f3ffb652a505d36498e30557c515eec.zip | |
* 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: http://svn.ruby-lang.org/repos/ruby/trunk@8236 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/tk/sample')
| -rw-r--r-- | ext/tk/sample/tkextlib/treectrl/demo.rb | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/ext/tk/sample/tkextlib/treectrl/demo.rb b/ext/tk/sample/tkextlib/treectrl/demo.rb index 892b5a62c..aaa6b2612 100644 --- a/ext/tk/sample/tkextlib/treectrl/demo.rb +++ b/ext/tk/sample/tkextlib/treectrl/demo.rb @@ -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 |
