Class: Bundler::Thor::LineEditor::Readline::PathCompletion
Relationships & Source Files | |
Inherits: | Object |
Defined in: | lib/bundler/vendor/thor/lib/thor/line_editor/readline.rb |
Class Method Summary
- .new(text) ⇒ PathCompletion constructor
Instance Attribute Summary
- #text readonly private
Instance Method Summary
- #matches
- #absolute_matches private
- #base_path private
- #glob_pattern private
- #relative_matches private
Constructor Details
.new(text) ⇒ PathCompletion
Instance Attribute Details
#text (readonly, private)
[ GitHub ]# File 'lib/bundler/vendor/thor/lib/thor/line_editor/readline.rb', line 51
attr_reader :text
Instance Method Details
#absolute_matches (private)
[ GitHub ]# File 'lib/bundler/vendor/thor/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
#base_path (private)
[ GitHub ]# File 'lib/bundler/vendor/thor/lib/thor/line_editor/readline.rb', line 82
def base_path "#{Dir.pwd}/" end
#glob_pattern (private)
[ GitHub ]#matches
[ GitHub ]# File 'lib/bundler/vendor/thor/lib/thor/line_editor/readline.rb', line 58
def matches relative_matches end
#relative_matches (private)
[ GitHub ]# File 'lib/bundler/vendor/thor/lib/thor/line_editor/readline.rb', line 64
def relative_matches absolute_matches.map { |path| path.sub(base_path, "") } end