{"id":26525241,"url":"https://github.com/ryz310/pr_comet","last_synced_at":"2025-03-21T14:55:18.142Z","repository":{"id":34541125,"uuid":"180146518","full_name":"ryz310/pr_comet","owner":"ryz310","description":"Create a lots of Pull Requests like comets :comet:","archived":false,"fork":false,"pushed_at":"2025-02-27T05:05:41.000Z","size":505,"stargazers_count":5,"open_issues_count":6,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-27T06:20:04.867Z","etag":null,"topics":["github","pull-request"],"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/ryz310.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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":"2019-04-08T12:41:48.000Z","updated_at":"2025-02-27T05:05:43.000Z","dependencies_parsed_at":"2024-02-05T09:44:45.033Z","dependency_job_id":"a543f53c-1f5b-4b97-9f58-5d28bb5254a6","html_url":"https://github.com/ryz310/pr_comet","commit_stats":{"total_commits":416,"total_committers":7,"mean_commits":59.42857142857143,"dds":"0.36778846153846156","last_synced_commit":"70aaf3cd2f2b61af8c381ff3510af11f95989116"},"previous_names":[],"tags_count":11,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ryz310%2Fpr_comet","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ryz310%2Fpr_comet/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ryz310%2Fpr_comet/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ryz310%2Fpr_comet/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ryz310","download_url":"https://codeload.github.com/ryz310/pr_comet/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244816616,"owners_count":20515127,"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":["github","pull-request"],"created_at":"2025-03-21T14:55:17.215Z","updated_at":"2025-03-21T14:55:18.137Z","avatar_url":"https://github.com/ryz310.png","language":"Ruby","readme":"# PrComet\n\n[![CircleCI](https://circleci.com/gh/ryz310/pr_comet.svg?style=svg)](https://circleci.com/gh/ryz310/pr_comet) [![Gem Version](https://badge.fury.io/rb/pr_comet.svg)](https://badge.fury.io/rb/pr_comet) [![Maintainability](https://api.codeclimate.com/v1/badges/962618c106a548ed762b/maintainability)](https://codeclimate.com/github/ryz310/pr_comet/maintainability) [![Test Coverage](https://api.codeclimate.com/v1/badges/962618c106a548ed762b/test_coverage)](https://codeclimate.com/github/ryz310/pr_comet/test_coverage)\n\nA helper library that makes it easy to create pull requests.\n\n## Installation\n\nAdd this line to your application's Gemfile:\n\n```ruby\ngem 'pr_comet'\n```\n\nAnd then execute:\n\n    $ bundle\n\nOr install it yourself as:\n\n    $ gem install pr_comet\n\n## Usage\n\n```ruby\n# Initialize.\npr_comet = PrComet.new(base: 'master', branch: '{branch name}')\n\n# Modify arbitrary files and commit into the block.\npr_comet.commit '{commit message}' do\n  file = File.read('path/to/file')\n  file.sub!('hoge', 'fuga')\n  File.write('path/to/file', file)\nend\n\n# You can also change files outer the block.\n`bundle update`\npr_comet.commit '$ bundle update'\n\n# Create a new pull request.\npr_comet.create!(\n  title: 'New pull request',\n  body: '{New pull request body}',\n  labels: ['label 1', 'label 2'] # optional\n)\n```\n\n## Rspec\n\n### Testing\n\nYou can stub `PrComet` class for testing.\nAdd the following code to `spec/spec_helper`:\n\n```ruby\nrequire 'pr_comet/rspec'\n```\n\nThen you can use `#stub_pr_comet!`.\nIt makes `PrComet` class to stubbing and `PrComet.new` will return stubbed `PrComet` instance.\nThe stubbed `PrComet#commit` does not execute `$ git commit`, but it executes given block code.\n\n```ruby\ndef create_pr\n  pr_comet = PrComet.new(base: 'master', branch: 'any-branch') # stubbed.\n  pr_comet.commit 'Hello world.' do # stubbed.\n    File.write('path/to/file.txt', 'Hello world.') # not stubbed.\n  end\n  pr_comet.create!(title: 'New pull request') # stubbed.\nend\n\nstub_pr_comet!\nallow(File).to receive(:write)\ncreate_pr\nexpect(File).to have_received(:write).with('path/to/file.txt', 'Hello world.')\n```\n\nIf you want to test about `PrComet`, you can use `#stub_pr_comet!` return value.\nIt returns any instance of `PrComet`.\n\n```ruby\ndef create_pr\n  pr_comet = PrComet.new(base: 'master', branch: 'any-branch')\n  pr_comet.commit 'commit message' do\n    # ...\n  end\n  pr_comet.create!(title: 'New pull request')\nend\n\npr_comet = stub_pr_comet!\ncreate_pr\nexpect(PrComet).to have_received(:new).with(base: 'master', branch: 'any-branch')\nexpect(pr_comet).to have_received(:commit).with('commit message')\nexpect(pr_comet).to have_received(:create!).with(title: 'New pull request')\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/[USERNAME]/pr_comet. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.\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## Code of Conduct\n\nEveryone interacting in the PrComet project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/[USERNAME]/pr_comet/blob/master/CODE_OF_CONDUCT.md).\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fryz310%2Fpr_comet","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fryz310%2Fpr_comet","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fryz310%2Fpr_comet/lists"}