Class: Bundler::Thor::LineEditor::Readline
Relationships & Source Files | |
Namespace Children | |
Classes:
| |
Super Chains via Extension / Inclusion / Inheritance | |
Class Chain:
self,
Basic
|
|
Instance Chain:
self,
Basic
|
|
Inherits: |
Bundler::Thor::LineEditor::Basic
|
Defined in: | lib/bundler/vendor/thor/lib/thor/line_editor/readline.rb |
Class Attribute Summary
Class Method Summary
Instance Attribute Summary
- #add_to_history? ⇒ Boolean readonly private
- #use_path_completion? ⇒ Boolean readonly private
Basic
- Inherited
Instance Method Summary
- #readline
- #completion_options private
- #completion_proc private
Basic
- Inherited
Constructor Details
This class inherits a constructor from Bundler::Thor::LineEditor::Basic
Class Attribute Details
.available? ⇒ Boolean
(readonly)
[ GitHub ]
# File 'lib/bundler/vendor/thor/lib/thor/line_editor/readline.rb', line 9
def self.available? Object.const_defined?(:Readline) end
Instance Attribute Details
#add_to_history? ⇒ Boolean
(readonly, private)
[ GitHub ]
# File 'lib/bundler/vendor/thor/lib/thor/line_editor/readline.rb', line 28
def add_to_history? .fetch(:add_to_history, true) end
#use_path_completion? ⇒ Boolean
(readonly, private)
[ GitHub ]
# File 'lib/bundler/vendor/thor/lib/thor/line_editor/readline.rb', line 46
def use_path_completion? .fetch(:path, false) end
Instance Method Details
#completion_options (private)
[ GitHub ]# File 'lib/bundler/vendor/thor/lib/thor/line_editor/readline.rb', line 42
def .fetch(:limited_to, []) end
#completion_proc (private)
[ GitHub ]# File 'lib/bundler/vendor/thor/lib/thor/line_editor/readline.rb', line 32
def completion_proc if use_path_completion? proc { |text| PathCompletion.new(text).matches } elsif .any? proc do |text| .select { |option| option.start_with?(text) } end end end
#readline
[ GitHub ]# File 'lib/bundler/vendor/thor/lib/thor/line_editor/readline.rb', line 13
def readline if echo? ::Readline.completion_append_character = nil # Ruby 1.8.7 does not allow Readline.completion_proc= to receive nil. if complete = completion_proc ::Readline.completion_proc = complete end ::Readline.readline(prompt, add_to_history?) else super end end