модуль 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.