{"id":14969854,"url":"https://github.com/igorkasyanchuk/wrapped_print","last_synced_at":"2025-09-17T16:32:00.554Z","repository":{"id":56898593,"uuid":"377965045","full_name":"igorkasyanchuk/wrapped_print","owner":"igorkasyanchuk","description":"Easy print debug information to your console in Ruby/Rails app.","archived":false,"fork":false,"pushed_at":"2025-05-12T21:04:30.000Z","size":338,"stargazers_count":25,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-08-28T17:53:04.771Z","etag":null,"topics":["ruby","ruby-on-rails"],"latest_commit_sha":null,"homepage":"https://www.railsjazz.com/","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/igorkasyanchuk.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,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2021-06-17T21:30:25.000Z","updated_at":"2025-05-12T21:04:34.000Z","dependencies_parsed_at":"2024-04-12T12:25:18.846Z","dependency_job_id":"4466ae5f-4a1f-40e0-84a3-53388ea02c0b","html_url":"https://github.com/igorkasyanchuk/wrapped_print","commit_stats":{"total_commits":16,"total_committers":2,"mean_commits":8.0,"dds":0.125,"last_synced_commit":"a80f5f5659cb60c74af6abfa01813d58d821656a"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/igorkasyanchuk/wrapped_print","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/igorkasyanchuk%2Fwrapped_print","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/igorkasyanchuk%2Fwrapped_print/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/igorkasyanchuk%2Fwrapped_print/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/igorkasyanchuk%2Fwrapped_print/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/igorkasyanchuk","download_url":"https://codeload.github.com/igorkasyanchuk/wrapped_print/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/igorkasyanchuk%2Fwrapped_print/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":275623475,"owners_count":25498340,"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","status":"online","status_checked_at":"2025-09-17T02:00:09.119Z","response_time":84,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["ruby","ruby-on-rails"],"created_at":"2024-09-24T13:42:30.296Z","updated_at":"2025-09-17T16:32:00.548Z","avatar_url":"https://github.com/igorkasyanchuk.png","language":"Ruby","funding_links":["https://www.patreon.com/igorkasyanchuk","https://buymeacoffee.com/igorkasyanchuk"],"categories":["Ruby"],"sub_categories":[],"readme":"# WrappedPrint\n\n[![RailsJazz](https://github.com/igorkasyanchuk/rails_time_travel/blob/main/docs/my_other.svg?raw=true)](https://www.railsjazz.com)\n[![https://www.patreon.com/igorkasyanchuk](https://github.com/igorkasyanchuk/rails_time_travel/blob/main/docs/patron.svg?raw=true)](https://www.patreon.com/igorkasyanchuk)\n\n[![\"Buy Me A Coffee\"](https://github.com/igorkasyanchuk/get-smart/blob/main/docs/snapshot-bmc-button-small.png?raw=true)](https://buymeacoffee.com/igorkasyanchuk)\n\nHow usually you debug your code? Binding.pry, byebug, puts, ...\n\nHow ofter do you write a code something like:\n\n```ruby\nputs \"=\"*50\nputs current_user.full_name\nputs \"=\"*50\n```\n\nI do this at least few times per week, sometimes per day.\n\nThis is annoying. It's need to be automated. And this gem is a simple solution.\n\nJust add this gem and use a global method `.wp` to see in the console value of your object or wrap code in block with `wp { ... }`.\n\n```ruby\ndef index\n  # to get list of emails and print them in console\n  # .wp method prints in console and returns same object\n  @emails = User.pluck(:emails).wp\nend\n```\n\nSee screenshot below with examples of usage (gem can be used not only in specs, this is just an example).\n\n[\u003cimg src=\"https://raw.githubusercontent.com/igorkasyanchuk/wrapped_print/main/docs/demo_print.png\"\n/\u003e](https://raw.githubusercontent.com/igorkasyanchuk/wrapped_print/main/docs/demo_print.png)\n\n## Installation\n\nAdd this line to your application's Gemfile:\n\n```ruby\ngem 'wrapped_print'\n```\n\nAnd then execute:\n\n    $ bundle install\n\nOr install it yourself as:\n\n    $ gem install wrapped_print\n\nAnd then `require \"wrapped_print\"`\n\n## Usage\n\nYou can do a simple configuration to the gem (config/initializers/wrapped_print.rb):\n\n```ruby\nWrappedPrint.setup do |config|\n  # config.log_to = :console # simply puts\n  config.log_to = :logs # e.g. Rails.logger.info....\n  # config.log_to = ActiveSupport::Logger.new($stdout) # custom logger\n\n  # # applicable only for Logger (not console)\n  config.level = :debug\n  # config.level = :info\nend if defined?(WrappedPrint)\n```\n\nYou can print using `puts` or to `Rails.logger`.\n\nOutput could be customized with several options:\n\n```ruby\nwp(label = nil, pattern: \"-\", count: 80, prefix: nil, suffix: nil, color: nil)\n```\n\nFor example:\n\n```ruby\n\"Demo with color 3\".wp(\"COLORIZED: \", color: :pur, pattern: '*')\n```\n\nor\n\n```ruby\n#\n# see how .wp is called. This method `.wp` returning the original value, so you can use it as normal variable.\n#\nclass A\n  def calc\n    z = balance.wp # same as z = balance\n    100 + 200 + z\n  end\n\n  def balance\n    500\n  end\nend\n```\n\n## Development\n\nAfter checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` 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 tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).\n\n## Contributing\n\nBug reports and pull requests are welcome on GitHub at https://github.com/igorkasyanchuk/wrapped_print.\n\n\n## License\n\nThe gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).\n\n[\u003cimg src=\"https://github.com/igorkasyanchuk/rails_time_travel/blob/main/docs/more_gems.png?raw=true\"\n/\u003e](https://www.railsjazz.com/?utm_source=github\u0026utm_medium=bottom\u0026utm_campaign=wrapped_print)\n\n[![\"Buy Me A Coffee\"](https://github.com/igorkasyanchuk/get-smart/blob/main/docs/snapshot-bmc-button.png?raw=true)](https://buymeacoffee.com/igorkasyanchuk)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Figorkasyanchuk%2Fwrapped_print","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Figorkasyanchuk%2Fwrapped_print","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Figorkasyanchuk%2Fwrapped_print/lists"}