{"id":25040655,"url":"https://github.com/joeldrapper/pretty_please","last_synced_at":"2026-02-14T20:36:14.066Z","repository":{"id":275145569,"uuid":"925236116","full_name":"joeldrapper/pretty_please","owner":"joeldrapper","description":"Print Ruby objects as Ruby","archived":false,"fork":false,"pushed_at":"2025-04-20T15:52:39.000Z","size":60,"stargazers_count":30,"open_issues_count":2,"forks_count":2,"subscribers_count":2,"default_branch":"main","last_synced_at":"2026-01-18T01:39:57.310Z","etag":null,"topics":["pretty-print","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/joeldrapper.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2025-01-31T13:50:40.000Z","updated_at":"2025-12-10T23:59:31.000Z","dependencies_parsed_at":"2025-02-04T15:21:38.729Z","dependency_job_id":null,"html_url":"https://github.com/joeldrapper/pretty_please","commit_stats":null,"previous_names":["joeldrapper/sumi","joeldrapper/pretty_please"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/joeldrapper/pretty_please","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joeldrapper%2Fpretty_please","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joeldrapper%2Fpretty_please/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joeldrapper%2Fpretty_please/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joeldrapper%2Fpretty_please/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/joeldrapper","download_url":"https://codeload.github.com/joeldrapper/pretty_please/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joeldrapper%2Fpretty_please/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29455360,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-14T15:52:44.973Z","status":"ssl_error","status_checked_at":"2026-02-14T15:52:11.208Z","response_time":53,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["pretty-print","ruby"],"created_at":"2025-02-06T03:03:37.060Z","updated_at":"2026-02-14T20:36:14.050Z","avatar_url":"https://github.com/joeldrapper.png","language":"Ruby","readme":"## PrettyPlease - Pretty Print Ruby objects as Ruby\n\nPrettyPlease is a pretty-printing library for Ruby that formats objects in a readable and structured way.\n\nPrettyPlease ensures the output is **valid Ruby code**, making it human, machine, and [diff](https://github.com/joeldrapper/difftastic-ruby)-friendly.\n\n\u003e [!NOTE]\n\u003e PrettyPlease is used and was extracted from [`difftastic-ruby`](https://github.com/joeldrapper/difftastic-ruby).\n\n### Installation\n\nInstall the gem and add it to the application's `Gemfile` by executing:\n\n```shell\nbundle add pretty_please\n```\n\nIf bundler is not being used to manage dependencies, install the gem by executing:\n\n```shell\ngem install pretty_please\n```\n\n### Usage\n\n`PrettyPlease.print(object)` prints the object with ANSI highlighting.\n\nThe `PrettyPlease.prettify` method provides a structured and human-readable representation of Ruby objects by outputting valid Ruby code.\n\nIt handles a variety of data types including Hashes, Arrays, Sets, Modules, and user-defined objects.\n\n#### Basic Usage\n\n```ruby\nrequire \"pretty_please\"\n\nputs PrettyPlease.prettify({ a: 1, b: [2, 3], c: { d: 4 } })\n```\n\n**Output:**\n\n```ruby\n{\n  a: 1,\n  b: [2, 3],\n  c: { d: 4 },\n}\n```\n\n**Options:**\n\n- `object`: (required) – The object to prettify and format.\n- `tab_width`: 2 (Integer) – The number of spaces (or tabs) per indentation level.\n- `max_width`: 60 (Integer) – The maximum width before elements are split into multiple lines.\n- `max_depth`: 5 (Integer) – The maximum depth of nested structures before truncation.\n- `max_items`: 10 (Integer) – The maximum number of instance variables to display for objects.\n\n### Development\n\nAfter checking out the repo, run `bin/setup` to install dependencies. Then, run `rake test` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.\n\nTo install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and the created tag, and push the `.gem` file to [rubygems.org](https://rubygems.org).\n\n### Contributing\n\n\u003e [!WARNING]\n\u003e Object diffs in `assert_equal` test output are self-hosted. That means if you mess up the output, the tests might not tell you since they are driven by the output. Most of the tests use `assert_equal_ruby`, which is not driven by PrettyPlease.\n\nBug reports and pull requests are welcome on GitHub at https://github.com/joeldrapper/pretty_please. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [code of conduct](https://github.com/joeldrapper/pretty_please/blob/main/CODE_OF_CONDUCT.md).\n\n### Code of Conduct\n\nEveryone interacting in the `PrettyPlease` project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/joeldrapper/pretty_please/blob/main/CODE_OF_CONDUCT.md).\n","funding_links":[],"categories":["Ruby"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjoeldrapper%2Fpretty_please","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjoeldrapper%2Fpretty_please","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjoeldrapper%2Fpretty_please/lists"}