Class: Readline::Fcomp

Inherits:
Object
  • Object
show all
Defined in:
lib/readline.rb

Overview

The Fcomp class provided to encapsulate typical filename completion procedure. You will not typically use this directly, but will instead use the Readline::FILENAME_COMPLETION_PROC.

Class Method Summary collapse

Class Method Details

.call(str) ⇒ Object



442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
# File 'lib/readline.rb', line 442

def self.call(str)
   matches = RbReadline.rl_completion_matches(str,
   :rl_filename_completion_function)
   if (matches)
      result = []
      i = 0
      while(matches[i])
         result << matches[i].dup
         matches[i] = nil
         i += 1
      end
      matches = nil
      if (result.length >= 2)
         result.shift
      end
   else
      result = nil
   end
   return result
end