Sha256: a6404abb8cbba8636dc2f437b9418e45aa623f42755299ee7ba1b62065681194

Contents?: true

Size: 606 Bytes

Versions: 17

Compression:

Stored size: 606 Bytes

Contents

require 'pp'

module Spruz
  module P
    private

    # Raise a runtime error with the inspected objects +objs+ (obtained by
    # calling the #inspect method) as their message text. This is useful for
    # quick debugging.
    def p!(*objs)
      raise((objs.size < 2 ? objs.first : objs).inspect)
    end

    # Raise a runtime error with the inspected objects +objs+ (obtained by
    # calling the #pretty_inspect method) as their message text. This is useful
    # for quick debugging.
    def pp!(*objs)
      raise("\n" + (objs.size < 2 ? objs.first : objs).pretty_inspect.chomp)
    end
  end
end

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
spruz-0.2.13 lib/spruz/p.rb
spruz-0.2.12 lib/spruz/p.rb
spruz-0.2.11 lib/spruz/p.rb
spruz-0.2.10 lib/spruz/p.rb
spruz-0.2.9 lib/spruz/p.rb
spruz-0.2.8 lib/spruz/p.rb
spruz-0.2.7 lib/spruz/p.rb
spruz-0.2.6 lib/spruz/p.rb
spruz-0.2.5 lib/spruz/p.rb
spruz-0.2.2 lib/spruz/p.rb
spruz-0.2.1 lib/spruz/p.rb
spruz-0.2.0 lib/spruz/p.rb
spruz-0.1.5 lib/spruz/p.rb
spruz-0.1.3 lib/spruz/p.rb
spruz-0.1.2 lib/spruz/p.rb
spruz-0.1.1 lib/spruz/p.rb
spruz-0.1.0 lib/spruz/p.rb