модуль Bundler::Thor::Shell
Константы
- SHELL_DELEGATED_METHODS
Атрибуты
shell[W]
Открытые методы класса
# File lib/bundler/vendor/thor/lib/thor/shell.rb, line 44
def initialize(args = [], options = {}, config = {})
super
self.shell = config[:shell]
shell.base ||= self if shell.respond_to?(:base)
end Добавить оболочку для инициализации значений конфигурации.
Конфигурация
- shell<Объект>
-
Экземпляр оболочки, который будет использоваться.
Примеры
class MyScript < Bundler::Thor
argument :first, :type => :numeric
end
MyScript.new [1.0], { :foo => :bar }, :shell => Bundler::Thor::Shell::Basic.new
Вызывает метод родительского класса
Открытые методы экземпляра
# File lib/bundler/vendor/thor/lib/thor/shell.rb, line 52 def shell @shell ||= Bundler::Thor::Base.shell.new end
Хранит оболочку для данного экземпляра Bundler::Thor. Если оболочка не задана, она получает стандартную оболочку из Bundler::Thor::Base.shell.
# File lib/bundler/vendor/thor/lib/thor/shell.rb, line 66 def with_padding shell.padding += 1 yield ensure shell.padding -= 1 end
Выполняет переданный блок с отступом.
Ruby Core © 1993–2017 Yukihiro Matsumoto
Licensed under the Ruby License.
Ruby Standard Library © contributors
Licensed under their own licenses.