{"id":13878741,"url":"https://github.com/kachick/irb-power_assert","last_synced_at":"2025-04-30T22:42:07.762Z","repository":{"id":37829722,"uuid":"367821492","full_name":"kachick/irb-power_assert","owner":"kachick","description":"power_assert in irb","archived":false,"fork":false,"pushed_at":"2024-10-28T01:59:28.000Z","size":331,"stargazers_count":19,"open_issues_count":2,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2024-10-30T05:28:52.256Z","etag":null,"topics":["irb","power-assert","repl","ruby"],"latest_commit_sha":null,"homepage":"","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kachick.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2021-05-16T08:14:45.000Z","updated_at":"2024-10-28T01:59:31.000Z","dependencies_parsed_at":"2023-09-29T20:48:49.824Z","dependency_job_id":"3f7f25a8-7817-45db-8456-d0bb72148324","html_url":"https://github.com/kachick/irb-power_assert","commit_stats":{"total_commits":106,"total_committers":2,"mean_commits":53.0,"dds":"0.39622641509433965","last_synced_commit":"941f132dad4e06fa41a4619455bf6af056260ae2"},"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kachick%2Firb-power_assert","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kachick%2Firb-power_assert/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kachick%2Firb-power_assert/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kachick%2Firb-power_assert/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kachick","download_url":"https://codeload.github.com/kachick/irb-power_assert/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":222670770,"owners_count":17020515,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["irb","power-assert","repl","ruby"],"created_at":"2024-08-06T08:01:58.449Z","updated_at":"2025-03-31T17:31:38.321Z","avatar_url":"https://github.com/kachick.png","language":"Ruby","readme":"# irb-power_assert\n\n[![Build Status](https://github.com/kachick/irb-power_assert/actions/workflows/ci-ruby.yml/badge.svg?branch=main)](https://github.com/kachick/irb-power_assert/actions/workflows/ci-ruby.yml?query=branch%3Amain+)\n[![Gem Version](https://badge.fury.io/rb/irb-power_assert.svg)](http://badge.fury.io/rb/irb-power_assert)\n\nUse power_assert inspection in irb\n\n## Usage\n\nTested only in ruby-head and the last 2 stable versions\\\nSo require Ruby 3.3 or higher\n\n```console\n$ gem install irb-power_assert\n...installed\n```\n\n```console\n$ irb -r irb-power_assert\n# enabled this gem\n```\n\nOr specify in your `~/.irbrc` as below\n\n```ruby\nrequire 'irb/power_assert'\n```\n\n```console\n$ irb\nirb(main):004\u003e help pa\nPrint PowerAssert inspection for the given expression.\n```\n\nThen you can use `pa` as an IRB command.\n\n```ruby\nirb(main):001:0\u003e pa \"0\".class == \"3\".to_i.times.map {|i| i + 1 }.class\n\"0\".class == \"3\".to_i.times.map {|i| i + 1 }.class\n    |     |      |    |     |                |\n    |     |      |    |     |                Array\n    |     |      |    |     [1, 2, 3]\n    |     |      |    #\u003cEnumerator: ...\u003e\n    |     |      3\n    |     false\n    String\n\n=\u003e false\n```\n\nNo hack is needed in your irbrc\n\n## Thanks!\n\n[ruby/power_assert](https://github.com/ruby/power_assert) is a recent my favorites.\\\n(the author is [@k-tsj](https://github.com/k-tsj), thank you!)\n\nIt is super helpful in complex testing.\n\nI just would get irb version of\n[yui-knk/pry-power_assert](https://github.com/yui-knk/pry-power_assert).\n\nLatest IRB is much helpful to [create own command](https://github.com/ruby/irb/pull/886)\n\nHonor should be bestowed upon them.\n\n## References\n\n- [power-assert-js/power-assert](https://github.com/power-assert-js/power-assert)\n- [Power Assert in Ruby](https://speakerdeck.com/k_tsj/power-assert-in-ruby)\n- [pry-power_assert implementation](https://github.com/yui-knk/pry-power_assert/blob/2d10ee3df8efaf9c448f31d51bff8033a1792739/lib/pry-power_assert.rb#L26-L35)\n","funding_links":[],"categories":["Ruby"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkachick%2Firb-power_assert","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkachick%2Firb-power_assert","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkachick%2Firb-power_assert/lists"}