Permalink
Browse files

Avoid triggering deprecation warning in ruby 1.8.7

- Use Object instead of Module for const_get, since that's where the
  list came from
  • Loading branch information...
JonathonMA committed Sep 8, 2011
1 parent 8c6f9ea commit 37afa90750a1cddad4a7fa36ebcca07615d9bca0
Showing with 4 additions and 3 deletions.
  1. +4 −3 lib/commander/user_interaction.rb
@@ -291,11 +291,12 @@ def progress arr, options = {}, &block
# Implements ask_for_CLASS methods.
module AskForClass
- # All special cases in HighLine::Question#convert
+ # All special cases in HighLine::Question#convert, except those that implement #parse
+ ([Float, Integer, String, Symbol, Regexp, Array, File, Pathname] +
# All Classes that respond to #parse
- ([Float, Integer, String, Symbol, Regexp, Array, File, Pathname] + # Date, DateTime
Object.constants.map do |const|
- Module.const_get(const)
+ # const_get(:Config) issues a deprecation warning on ruby 1.8.7
+ Object.const_get(const) unless const == :Config
end.select do |const|
const.is_a? Class and const.respond_to? :parse
end).each do |klass|

0 comments on commit 37afa90

Please sign in to comment.