Ping
A little library for extracting GitHub @mentions and issue references.
Installation
Add this line to your application's Gemfile:
gem 'ping'
And then execute:
$ bundle
Or install it yourself as:
$ gem install ping
Basic Usage
Simply load a new parser object and extract issue references and mentions. Here are examples.
issue references
parser = Ping::Parser.new('closed codetree/ping#25')
parser.issue_references # => [#<Ping::IssueReference:0x000056099c3cf400 @number="25", @qualifier="closed", @repository='codetree/ping'>]
mentions
parser = Ping::Mention.new('Hey @djreimer, please look into the bug.')
parser.mentions # => [#<Ping::Mention:0x000055ad151f43d0 @username="djreimer">]
Configuration
gem provided some default qualifiers to extract issue references
DEFAULT_QUALIFIERS = [
'close', 'closes', 'closed', 'fix', 'fixes', 'fixed', 'need', 'needs', 'needed',
'require', 'requires', 'required', 'resolve', 'resolves', 'resolved'
]
but you can also define your own qualifiers along with default qualifiers
## config/initializers/ping.rb
require 'ping'
Ping.configure do |config|
config.qualifiers = Ping::DEFAULT_QUALIFIERS.push(*['epic' 'needed-by'])
end
** Note: qualifiers must be an array of qualifier words
Contributing
- Fork it ( https://github.com/codetree/ping/fork )
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create a new Pull Request
Updating RubyGems
- Create an annotated tag
git tag -a v0.1.0 -m "msg with the tag
- Push tag to Github
github push --tags