Sha256: 18683148f6e74fe2e419758b597d04f9fb56b384bc04843677770eb71d5e5af5

Contents?: true

Size: 949 Bytes

Versions: 7

Compression:

Stored size: 949 Bytes

Contents

##############################################################################
#                         Awesome Print Plugin
##############################################################################

begin
  require 'awesome_print'

  module Kernel
    def sap(msg)
      puts
      puts
      ap "************************** #{Time.now} **************************", :color => { :string => :white }
      puts
      ap(msg.class, :color => { :class => :yellowish }) if msg.respond_to?(:class)
      puts
      root_path = defined?(Rails) ? Rails.root.to_s : ''

      lines = caller[0...3].map do |line|
        line.gsub(root_path + '/', '')
      end

      lines.each { |line| ap line, :color => { :string => :purpleish } }
      puts
      ap msg
      puts
      ap '************************************* END **************************************', :color => { :string => :white }
      puts
      puts
    end
  end
rescue LoadError
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
rspeckled-0.0.9 lib/rspeckled/plugins/awesome_print.rb
rspeckled-0.0.8 lib/rspeckled/plugins/awesome_print.rb
rspeckled-0.0.7 lib/rspeckled/plugins/awesome_print.rb
rspeckled-0.0.6 lib/rspeckled/plugins/awesome_print.rb
rspeckled-0.0.5 lib/rspeckled/plugins/awesome_print.rb
rspeckled-0.0.4 lib/rspeckled/plugins/awesome_print.rb
rspeckled-0.0.3 lib/rspeckled/plugins/awesome_print.rb