Adding gem version badge to README

This commit is contained in:
Eugen Rochko 2016-02-17 16:36:19 +01:00
parent d045107c18
commit 8b0d7af683
4 changed files with 30 additions and 1 deletions

20
LICENSE
View File

@ -0,0 +1,20 @@
Copyright (c) 2016 Eugen Rochko
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

View File

@ -1,6 +1,10 @@
Goldfinger, a Webfinger client for Ruby Goldfinger, a Webfinger client for Ruby
======================================= =======================================
[![Gem Version](http://img.shields.io/gem/v/goldfinger.svg)][gem]
[gem]: https://rubygems.org/gems/goldfinger
A Webfinger client for Ruby. Supports `application/xrd+xml` and `application/jrd+json` responses. Raises `Goldfinger::Error::NotFound` on failure to fetch the Webfinger or XRD data. A Webfinger client for Ruby. Supports `application/xrd+xml` and `application/jrd+json` responses. Raises `Goldfinger::Error::NotFound` on failure to fetch the Webfinger or XRD data.
## Installation ## Installation
@ -12,3 +16,7 @@ A Webfinger client for Ruby. Supports `application/xrd+xml` and `application/jrd
data = Goldfinger.finger('acct:gargron@quitter.no') data = Goldfinger.finger('acct:gargron@quitter.no')
data.link('http://schemas.google.com/g/2010#updates-from')[:href] data.link('http://schemas.google.com/g/2010#updates-from')[:href]
# => "https://quitter.no/api/statuses/user_timeline/7477.atom" # => "https://quitter.no/api/statuses/user_timeline/7477.atom"
## RFC support
The gem only parses link data. It does not currently parse aliases, properties, or more complex structures.

View File

@ -10,7 +10,7 @@ Gem::Specification.new do |s|
s.email = 'eugen@zeonfederated.com' s.email = 'eugen@zeonfederated.com'
s.files = `git ls-files lib LICENSE README.md`.split($RS) s.files = `git ls-files lib LICENSE README.md`.split($RS)
s.homepage = 'https://github.com/Gargron/goldfinger' s.homepage = 'https://github.com/Gargron/goldfinger'
s.license = 'MIT' s.licenses = ['MIT']
s.add_dependency('http', '~> 1.0') s.add_dependency('http', '~> 1.0')
s.add_dependency('addressable', '~> 2.4') s.add_dependency('addressable', '~> 2.4')

View File

@ -21,6 +21,7 @@ module Goldfinger
def parse def parse
case @mime_type case @mime_type
when 'application/jrd+json' when 'application/jrd+json'
when 'application/json'
parse_json parse_json
when 'application/xrd+xml' when 'application/xrd+xml'
parse_xml parse_xml