Module: Pod::UserInterface

Defined in:
lib/cocoapods-thumbs/user_interface.rb

Class Method Summary collapse

Class Method Details

.indented_block(relative_indentation = 2) ⇒ Object

Changes the indentation level and yields to the given block. Useful to call succesive UI methods and have their content be indented.



8
9
10
11
12
13
14
# File 'lib/cocoapods-thumbs/user_interface.rb', line 8

def indented_block(relative_indentation = 2)
  self.indentation_level += relative_indentation
  
  yield if block_given?
  
  self.indentation_level -= relative_indentation
end

.marked_labeled(marker, label, value, justification = 12) ⇒ Object

Prints a message with a label and a given marker, instead of the standard hyphen.



18
19
20
21
22
23
# File 'lib/cocoapods-thumbs/user_interface.rb', line 18

def marked_labeled(marker, label, value, justification = 12)
  if value
    title = "#{marker} #{label}: "
    puts wrap_string(title.ljust(justification) + "#{value}", self.indentation_level)
  end
end