Module: SuperAwesomePrint

Defined in:
lib/super_awesome_print.rb,
lib/super_awesome_print/version.rb

Constant Summary collapse

VERSION =
'0.2.6'.freeze

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.configurationObject



65
66
67
# File 'lib/super_awesome_print.rb', line 65

def self.configuration
  @configuration ||= Configuration.new
end

Class Method Details

.blank_lines_bottomObject



57
58
59
# File 'lib/super_awesome_print.rb', line 57

def self.blank_lines_bottom
  config.blank_lines_bottom.times { puts }
end

.blank_lines_topObject



50
51
52
53
54
55
# File 'lib/super_awesome_print.rb', line 50

def self.blank_lines_top
  # The first puts has no visible effect
  # So we want to puts once regardless of config
  puts
  config.blank_lines_top.times { puts }
end

.configObject



61
62
63
# File 'lib/super_awesome_print.rb', line 61

def self.config
  SuperAwesomePrint.configuration
end

.configure {|configuration| ... } ⇒ Object

Yields:



69
70
71
# File 'lib/super_awesome_print.rb', line 69

def self.configure
  yield configuration
end


42
43
44
45
46
47
48
# File 'lib/super_awesome_print.rb', line 42

def self.print_caller_lines(caller_array)
  number_of_lines = config.caller_lines
  lines = caller_array[0...number_of_lines].map do |line|
    line.gsub(config.root_path + '/', '')
  end
  lines.each { |line| ap line, :color => { :string => :purpleish } }
end