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