commander-rb / commander

The complete solution for Ruby command-line executables
MIT License
823 stars 74 forks source link

deprecation warning about MissingSourceFile that is being thrown when commander v4.4.0 is used with ActiveSupport v5+ #36

Closed Navneets060 closed 7 years ago

Navneets060 commented 8 years ago

Commander gem shows DEPRECATION WARNING: MissingSourceFile is deprecated! Use LoadError instead. warning when we use commander v4.4.0 with ActiveSupport v5+.

warning is thrown from /lib/commander/user_interaction.rb while executing

 module AskForClass
      # 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
        Object.constants.map do |const|
          # Ignore constants that trigger deprecation warnings
          Object.const_get(const) unless [:Config, :TimeoutError].include?(const)
        end.select do |const|
          const.class == Class && const.respond_to?(:parse)
        end
      ).each do |klass|
        define_method "ask_for_#{klass.to_s.downcase}" do |prompt|
          $terminal.ask(prompt, klass)
        end
      end
    end

which defines the deprecation_message method for the ActiveSupport::Deprecation::Reporting module lib/active_support/deprecation/reporting.rb while executing

       def deprecation_message(callstack, message = nil)
          message ||= "You are using deprecated behavior which will be removed from the next major or minor release."
          "DEPRECATION WARNING: #{message} #{deprecation_caller_message(callstack)}"
        end

could you please fix this issue.