class Thor::LineEditor::Readline::PathCompletion
Attributes
Public Class Methods
Source
# File lib/thor/line_editor/readline.rb, line 54 def initialize(text) @text = text end
Public Instance Methods
Private Instance Methods
Source
# File lib/thor/line_editor/readline.rb, line 68 def absolute_matches Dir[glob_pattern].map do |path| if File.directory?(path) "#{path}/" else path end end end
Source
# File lib/thor/line_editor/readline.rb, line 82 def base_path "#{Dir.pwd}/" end
Source
# File lib/thor/line_editor/readline.rb, line 78 def glob_pattern "#{base_path}#{text}*" end
Source
# File lib/thor/line_editor/readline.rb, line 64 def relative_matches absolute_matches.map { |path| path.sub(base_path, "") } end