Spec-Zone.ru › Ruby 2.7

класс Bundler::Thor::LineEditor::Readline::PathCompletion

Родитель:
Объект

Атрибуты

text[R]

Открытые методы класса

new(text) Показать исходный код
# File lib/bundler/vendor/thor/lib/thor/line_editor/readline.rb, line 54
def initialize(text)
  @text = text
end

Открытые методы экземпляра

matches() Показать исходный код
# File lib/bundler/vendor/thor/lib/thor/line_editor/readline.rb, line 58
def matches
  relative_matches
end

Приватные методы экземпляра

absolute_matches() Показать исходный код
# 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() Показать исходный код
# File lib/bundler/vendor/thor/lib/thor/line_editor/readline.rb, line 82
def base_path
  "#{Dir.pwd}/"
end
glob_pattern() Показать исходный код
# File lib/bundler/vendor/thor/lib/thor/line_editor/readline.rb, line 78
def glob_pattern
  "#{base_path}#{text}*"
end
relative_matches() Показать исходный код
# 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

Ruby Core © 1993–2017 Yukihiro Matsumoto
Licensed under the Ruby License.
Ruby Standard Library © contributors
Licensed under their own licenses.

Spec-Zone.ru

Настройки Оффлайн Что нового Помощь О нас
Spec-Zone .ru
спецификации, руководства, описания, API