{"id":19399401,"url":"https://github.com/errbit/errbit_plugin","last_synced_at":"2025-04-24T06:31:45.283Z","repository":{"id":11259736,"uuid":"13661673","full_name":"errbit/errbit_plugin","owner":"errbit","description":"Gem to inherit to create Errbit plugin","archived":false,"fork":false,"pushed_at":"2025-04-10T18:51:49.000Z","size":93,"stargazers_count":7,"open_issues_count":2,"forks_count":3,"subscribers_count":10,"default_branch":"master","last_synced_at":"2025-04-10T18:58:27.869Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/errbit.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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":"2013-10-17T21:28:53.000Z","updated_at":"2025-04-10T18:51:50.000Z","dependencies_parsed_at":"2025-04-12T06:00:49.614Z","dependency_job_id":null,"html_url":"https://github.com/errbit/errbit_plugin","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/errbit%2Ferrbit_plugin","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/errbit%2Ferrbit_plugin/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/errbit%2Ferrbit_plugin/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/errbit%2Ferrbit_plugin/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/errbit","download_url":"https://codeload.github.com/errbit/errbit_plugin/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250578187,"owners_count":21453266,"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":[],"created_at":"2024-11-10T11:09:16.720Z","updated_at":"2025-04-24T06:31:45.270Z","avatar_url":"https://github.com/errbit.png","language":"Ruby","readme":"# ErrbitPlugin\n\n[![RSpec](https://github.com/errbit/errbit_plugin/actions/workflows/rspec.yml/badge.svg)](https://github.com/errbit/errbit_plugin/actions/workflows/rspec.yml)\n[![RSpec on JRuby](https://github.com/errbit/errbit_plugin/actions/workflows/jruby.yml/badge.svg)](https://github.com/errbit/errbit_plugin/actions/workflows/jruby.yml)\n[![Ruby Style Guide](https://img.shields.io/badge/code_style-standard-brightgreen.svg)](https://github.com/standardrb/standard)\n\nErrbitPlugin provides a set of base classes that you can extend to create\nErrbit plugins.\n\n## Creating plugins\n\nErrbitPlugins are Ruby gems that extend the functionality of Errbit. To get\nstarted, create a Ruby gem and add 'errbit_plugin' as a dependency in your\ngem's gemspec.\n\nNow you can start adding plugins. At the moment, there is only one kind of\nplugin you can create, and that is the issue tracker.\n\n### Issue Trackers\n\nAn issue tracker plugin is a Ruby class that enables you to link errors within\nerrbit to an issue in an external issue tracker like Github. An app within\nerrbit can be associated an issue tracker or not. When there is an association,\nerrbit users can choose 'create issue' from an error page which will both\ncreate an issue on the external issue tracker out of the given error and link\nthat issue to the errbit error. Likewise, a user can also choose 'close issue'\nto close the issue on the external issue tracker, if your plugin provides a \nmethod to do so.\n\nYour issue tracker plugin is responsible for providing the interface defined by\nErrbitPlugin::IssueTracker. All of the required methods must be implemented and\nthe class must extend ErrbitPlugin::IssueTracker. Here's an example:\n\n```ruby\nclass MyIssueTracker \u003c ErrbitPlugin::IssueTracker\n\n  # A unique label for your tracker plugin used internally by errbit\n  def self.label\n    'my-tracker'\n  end\n\n  def self.note\n    'a note about this tracker that users will see'\n  end\n\n  # Form fields that will be presented to the administrator when setting up\n  # or editing the errbit app. The values we collect will be availble for use\n  # later when we have an instance of this class.\n  def self.fields\n    {\n      username: {\n        placeholder: \"Some placeholder text\"\n      },\n      password: {\n        placeholder: \"Some more placeholder text\",\n        label: \"Passphrase\" # a label to use in the UI instead of 'password'\n      }\n    }\n  end\n\n  # Icons to display during user interactions with this issue tracker. This\n  # method should return a hash of two-tuples, the key names being 'create',\n  # 'goto', and 'inactive'. The two-tuples should contain the icon media type\n  # and the binary icon data.\n  def self.icons\n    @icons ||= {\n      create: [ 'image/png', File.read('./path/to/create.png') ],\n      goto: [ 'image/png', File.read('./path/to/goto.png') ],\n      inactive: [ 'image/png', File.read('./path/to/inactive.png') ],\n    }\n  end\n\n  # If this tracker can be in a configured or non-configured state, you can let\n  # errbit know by returning a Boolean here\n  def configured?\n    # In this case, we'll say this issue tracker is configured when username\n    # and password are set\n    options[:username].present? \u0026\u0026 options[:password].present?\n  end\n\n  # Called to validate user input. Just return a hash of errors if there are\n  # any\n  def errors\n    if options[:username]\n      {}\n    else\n      { field_one: 'username must be present' }\n    end\n  end\n\n  # This is where you actually go create the issue on the external issue\n  # tracker. You get access to everything in options, an issue title, body and\n  # a user record representing the user who's creating the issue.\n  #\n  # Return a string with a link to the issue\n  def create_issue(title, body, user: {})\n    # Create an issue! Then update the problem to link it.\n\n    'http://sometracker.com/my/issue/123'\n  end\n\n  # This method is optional. Errbit will create body text for your issue by\n  # calling render_to_string with some arguments. If you want control over\n  # those arguments, you can specify them here. You can control which file is\n  # rendered and anything else Rails allows you to specify as arguments in\n  # render_to_string.\n  #\n  # If you don't implement this method, Errbit will render a body using a\n  # default template\n  #\n  # @see http://apidock.com/rails/ActionController/Base/render_to_string\n  def render_body_args\n    # In this example, we want to render a special file\n    ['/path/to/some/template', formats: [:rdoc]]\n  end\n\n  # This method is optional, and is where you actually go close the issue on\n  # the external issue tracker. You get access to everything in options, a\n  # string with a link to the issue # and a user resource.\n  #\n  # return true if successful, false otherwise\n  def close_issue(issue_link, user = {})\n    # Close the issue! (Perhaps using the passed in issue_link url to identify it.)\n  end\n\n  # The URL for your remote issue tracker\n  def url\n    'http://some-remote-tracker.com'\n  end\nend\n```\n\n## Contributing\n\nDiscuss any changes you'd like to make with the authors on the mailing list, or\nby opening a github issue.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ferrbit%2Ferrbit_plugin","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ferrbit%2Ferrbit_plugin","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ferrbit%2Ferrbit_plugin/lists"}