]> git.donarmstrong.com Git - dsa-puppet.git/blob - 3rdparty/modules/aviator/feature/aviator/compatibility.rb
add aimonb/aviator to 3rdparty
[dsa-puppet.git] / 3rdparty / modules / aviator / feature / aviator / compatibility.rb
1 module Aviator
2
3   module Compatibility
4     RUBY_1_8_MODE = (not (RUBY_VERSION =~ /1\.8\.\d*/).nil?)
5   end
6
7 end
8
9 if Aviator::Compatibility::RUBY_1_8_MODE
10
11   class Module
12
13     alias_method :old_const_defined?, :const_defined?
14
15     def const_defined?(sym, ignore=nil)
16       old_const_defined?(sym)
17     end
18
19
20     alias_method :old_const_get, :const_get
21
22     def const_get(sym, ignore=nil)
23       old_const_get(sym)
24     end
25
26     alias_method :old_instance_methods, :instance_methods
27
28     def instance_methods(include_super=true)
29       old_instance_methods(include_super).map(&:to_sym)
30     end
31
32   end
33
34 end