Class: Richcss::RichUI

Inherits:
Object
  • Object
show all
Includes:
Molinillo::UI
Defined in:
lib/richcss/richcss_ui.rb

Instance Method Summary collapse

Instance Method Details

#after_resolutionObject



26
27
28
# File 'lib/richcss/richcss_ui.rb', line 26

def after_resolution
  Richcss.ui.info ""
end

#before_resolutionObject



22
23
24
# File 'lib/richcss/richcss_ui.rb', line 22

def before_resolution
  Richcss.ui.info "Resolving dependencies...", false
end

#debug(depth = 0) ⇒ void

This method returns an undefined value.

Conveys debug information to the user.

Parameters:

  • depth (Integer) (defaults to: 0)

    the current depth of the resolution process.



10
11
12
13
14
15
16
# File 'lib/richcss/richcss_ui.rb', line 10

def debug(depth = 0)
  if debug?
    debug_info = yield
    debug_info = debug_info.inspect unless debug_info.is_a?(String)
    STDERR.puts debug_info.split("\n").map {|s| "  " * depth + s }
  end
end

#debug?Boolean

Returns:

  • (Boolean)


18
19
20
# File 'lib/richcss/richcss_ui.rb', line 18

def debug?
  ENV["DEBUG_RESOLVER"] || ENV["DEBUG_RESOLVER_TREE"]
end

#indicate_progressObject



30
31
32
# File 'lib/richcss/richcss_ui.rb', line 30

def indicate_progress
  Richcss.ui.info ".", false
end