модуль Bundler::Molinillo::UI
Предоставляет пользователю информацию о процессе разрешения.
Открытые методы экземпляра
# File lib/bundler/vendor/molinillo/lib/molinillo/modules/ui.rb, line 40 def after_resolution output.puts end
Вызывается после завершения разрешения (успешного или с ошибкой). По умолчанию печатает новую строку.
@return [void]
# File lib/bundler/vendor/molinillo/lib/molinillo/modules/ui.rb, line 32 def before_resolution output.print 'Resolving dependencies...' end
Вызывается перед началом разрешения.
@return [void]
# File lib/bundler/vendor/molinillo/lib/molinillo/modules/ui.rb, line 48
def debug(depth = 0)
if debug?
debug_info = yield
debug_info = debug_info.inspect unless debug_info.is_a?(String)
debug_info = debug_info.split("\n").map { |s| ":#{depth.to_s.rjust 4}: #{s}" }
output.puts debug_info
end
end Предоставляет пользователю отладочную информацию.
@param [Integer] depth текущая глубина процесса разрешения. @return [void]
# File lib/bundler/vendor/molinillo/lib/molinillo/modules/ui.rb, line 62 def debug? return @debug_mode if defined?(@debug_mode) @debug_mode = ENV['MOLINILLO_DEBUG'] end
Указывает, следует ли выводить отладочные сообщения. По умолчанию, в зависимости от того, установлена ли переменная среды `MOLINILLO_DEBUG`.
@return [Boolean]
# File lib/bundler/vendor/molinillo/lib/molinillo/modules/ui.rb, line 17 def indicate_progress output.print '.' unless debug? end
Вызывается примерно каждые {#progress_rate}, этот метод должен отображать прогресс пользователю.
@return [void]
# File lib/bundler/vendor/molinillo/lib/molinillo/modules/ui.rb, line 9 def output STDOUT end
Объект {IO}, который должен использоваться для вывода. По умолчанию `STDOUT`.
@return [IO]
# File lib/bundler/vendor/molinillo/lib/molinillo/modules/ui.rb, line 25 def progress_rate 0.33 end
Как часто прогресс должен отображаться пользователю через {#indicate_progress}, в секундах. По умолчанию одна треть секунды.
@return [Float]
Ruby Core © 1993–2017 Yukihiro Matsumoto
Licensed under the Ruby License.
Ruby Standard Library © contributors
Licensed under their own licenses.