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
- .blank_lines_bottom ⇒ Object
- .blank_lines_top ⇒ Object
- .config ⇒ Object
- .configure {|configuration| ... } ⇒ Object
- .print_caller_lines(caller_array) ⇒ Object
Class Attribute Details
.configuration ⇒ Object
65 66 67 |
# File 'lib/super_awesome_print.rb', line 65 def self.configuration @configuration ||= Configuration.new end |
Class Method Details
.blank_lines_bottom ⇒ Object
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_top ⇒ Object
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 |
.config ⇒ Object
61 62 63 |
# File 'lib/super_awesome_print.rb', line 61 def self.config SuperAwesomePrint.configuration end |
.configure {|configuration| ... } ⇒ Object
69 70 71 |
# File 'lib/super_awesome_print.rb', line 69 def self.configure yield configuration end |
.print_caller_lines(caller_array) ⇒ Object
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 |