Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

irb-power_assert

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

irb-power_assert

  • 0.3.1
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source

irb-power_assert

Build Status Gem Version

Use power_assert inspection in irb

Usage

Tested only in ruby-head and the last 2 stable versions
So require Ruby 3.2 or higher

$ gem install irb-power_assert
...installed
$ irb -r irb-power_assert
# enabled this gem

Or specify in your ~/.irbrc as below

require 'irb/power_assert'
$ irb
irb(main):004> help pa
Print PowerAssert inspection for the given expression.

Then you can use pa as an IRB command.

irb(main):001:0> pa "0".class == "3".to_i.times.map {|i| i + 1 }.class
"0".class == "3".to_i.times.map {|i| i + 1 }.class
    |     |      |    |     |                |
    |     |      |    |     |                Array
    |     |      |    |     [1, 2, 3]
    |     |      |    #<Enumerator: ...>
    |     |      3
    |     false
    String

=> false

No hack is needed in your irbrc

Thanks!

ruby/power_assert is a recent my favorites.
(the author is @k-tsj, thank you!)

It is super helpful in complex testing.

Don't say ruby/irb is old-fashioned.

I just would get irb version of yui-knk/pry-power_assert.

Latest IRB is much helpful to create own command

Honor should be bestowed upon them.

References

FAQs

Package last updated on 02 May 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc