Module: SuperAwesomePrint

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

Constant Summary collapse

VERSION =
'0.2.4'.freeze

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.configurationObject


63
64
65
# File 'lib/super_awesome_print.rb', line 63

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

Class Method Details

.blank_lines_bottomObject


55
56
57
# File 'lib/super_awesome_print.rb', line 55

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

.blank_lines_topObject


48
49
50
51
52
53
# File 'lib/super_awesome_print.rb', line 48

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


59
60
61
# File 'lib/super_awesome_print.rb', line 59

def self.config
  SuperAwesomePrint.configuration
end

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

Yields:


67
68
69
# File 'lib/super_awesome_print.rb', line 67

def self.configure
  yield configuration
end

40
41
42
43
44
45
46
# File 'lib/super_awesome_print.rb', line 40

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