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



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

def after_resolution
  puts ""
end

#before_resolutionObject



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

def before_resolution
  STDOUT.print "Resolving dependencies..."
  STDOUT.flush
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



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

def indicate_progress
  STDOUT.print "."
  STDOUT.flush
end