webfinger 0.0.0
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +17 -0
- data/Gemfile +4 -0
- data/LICENSE.txt +22 -0
- data/README.md +29 -0
- data/Rakefile +18 -0
- data/VERSION +1 -0
- data/lib/webfinger.rb +70 -0
- data/lib/webfinger/cache.rb +12 -0
- data/lib/webfinger/debugger.rb +3 -0
- data/lib/webfinger/debugger/request_filter.rb +20 -0
- data/lib/webfinger/exception.rb +36 -0
- data/lib/webfinger/request.rb +72 -0
- data/lib/webfinger/response.rb +33 -0
- data/spec/helpers/webmock_helper.rb +38 -0
- data/spec/mock_json/all.json +27 -0
- data/spec/mock_json/device_info.json +7 -0
- data/spec/mock_json/email_config.json +19 -0
- data/spec/mock_json/open_id.json +12 -0
- data/spec/spec_helper.rb +4 -0
- data/spec/webfinger/debugger/request_filter_spec.rb +29 -0
- data/spec/webfinger/request_spec.rb +5 -0
- data/spec/webfinger_spec.rb +90 -0
- data/webfinger.gemspec +20 -0
- metadata +173 -0
data/.gitignore
ADDED
data/Gemfile
ADDED
data/LICENSE.txt
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
Copyright (c) 2012 nov matake
|
2
|
+
|
3
|
+
MIT License
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
6
|
+
a copy of this software and associated documentation files (the
|
7
|
+
"Software"), to deal in the Software without restriction, including
|
8
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
9
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
10
|
+
permit persons to whom the Software is furnished to do so, subject to
|
11
|
+
the following conditions:
|
12
|
+
|
13
|
+
The above copyright notice and this permission notice shall be
|
14
|
+
included in all copies or substantial portions of the Software.
|
15
|
+
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
17
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
18
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
19
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
20
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
21
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
22
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,29 @@
|
|
1
|
+
# Webfinger
|
2
|
+
|
3
|
+
TODO: Write a gem description
|
4
|
+
|
5
|
+
## Installation
|
6
|
+
|
7
|
+
Add this line to your application's Gemfile:
|
8
|
+
|
9
|
+
gem 'webfinger'
|
10
|
+
|
11
|
+
And then execute:
|
12
|
+
|
13
|
+
$ bundle
|
14
|
+
|
15
|
+
Or install it yourself as:
|
16
|
+
|
17
|
+
$ gem install webfinger
|
18
|
+
|
19
|
+
## Usage
|
20
|
+
|
21
|
+
TODO: Write usage instructions here
|
22
|
+
|
23
|
+
## Contributing
|
24
|
+
|
25
|
+
1. Fork it
|
26
|
+
2. Create your feature branch (`git checkout -b my-new-feature`)
|
27
|
+
3. Commit your changes (`git commit -am 'Add some feature'`)
|
28
|
+
4. Push to the branch (`git push origin my-new-feature`)
|
29
|
+
5. Create new Pull Request
|
data/Rakefile
ADDED
@@ -0,0 +1,18 @@
|
|
1
|
+
require 'bundler/gem_tasks'
|
2
|
+
|
3
|
+
require 'rspec/core/rake_task'
|
4
|
+
RSpec::Core::RakeTask.new(:spec)
|
5
|
+
|
6
|
+
namespace :cover_me do
|
7
|
+
desc "Generates and opens code coverage report."
|
8
|
+
task :report do
|
9
|
+
require 'cover_me'
|
10
|
+
CoverMe.complete!
|
11
|
+
end
|
12
|
+
end
|
13
|
+
|
14
|
+
task :spec do
|
15
|
+
Rake::Task['cover_me:report'].invoke
|
16
|
+
end
|
17
|
+
|
18
|
+
task default: :spec
|
data/VERSION
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
0.0.0
|
data/lib/webfinger.rb
ADDED
@@ -0,0 +1,70 @@
|
|
1
|
+
require 'digest/md5'
|
2
|
+
require 'httpclient'
|
3
|
+
require 'multi_json'
|
4
|
+
require 'active_support/core_ext'
|
5
|
+
|
6
|
+
module WebFinger
|
7
|
+
VERSION = File.read(
|
8
|
+
File.join(File.dirname(__FILE__), '../VERSION')
|
9
|
+
).delete("\n\r")
|
10
|
+
|
11
|
+
module_function
|
12
|
+
|
13
|
+
def discover!(resource, options = {})
|
14
|
+
Request.new(resource, options).discover!(options[:cache])
|
15
|
+
end
|
16
|
+
|
17
|
+
def cache=(cache)
|
18
|
+
@cache = cache
|
19
|
+
end
|
20
|
+
def cache
|
21
|
+
@cache
|
22
|
+
end
|
23
|
+
|
24
|
+
def logger
|
25
|
+
@logger
|
26
|
+
end
|
27
|
+
def logger=(logger)
|
28
|
+
@logger = logger
|
29
|
+
end
|
30
|
+
self.logger = ::Logger.new(STDOUT)
|
31
|
+
logger.progname = 'WebFinger'
|
32
|
+
|
33
|
+
def debugging?
|
34
|
+
@debugging
|
35
|
+
end
|
36
|
+
def debugging=(boolean)
|
37
|
+
@debugging = boolean
|
38
|
+
end
|
39
|
+
def debug!
|
40
|
+
self.debugging = true
|
41
|
+
end
|
42
|
+
self.debugging = false
|
43
|
+
|
44
|
+
def url_builder
|
45
|
+
@url_builder ||= URI::HTTPS
|
46
|
+
end
|
47
|
+
def url_builder=(builder)
|
48
|
+
@url_builder = builder
|
49
|
+
end
|
50
|
+
|
51
|
+
def http_client
|
52
|
+
_http_client_ = HTTPClient.new(
|
53
|
+
agent_name: "WebFinger (#{VERSION})"
|
54
|
+
)
|
55
|
+
_http_client_.request_filter << Debugger::RequestFilter.new if debugging?
|
56
|
+
http_config.try(:call, _http_client_)
|
57
|
+
_http_client_
|
58
|
+
end
|
59
|
+
def http_config(&block)
|
60
|
+
@http_config ||= block
|
61
|
+
end
|
62
|
+
end
|
63
|
+
|
64
|
+
require 'webfinger/debugger'
|
65
|
+
require 'webfinger/exception'
|
66
|
+
require 'webfinger/cache'
|
67
|
+
require 'webfinger/request'
|
68
|
+
require 'webfinger/response'
|
69
|
+
|
70
|
+
WebFinger.cache = WebFinger::Cache.new
|
@@ -0,0 +1,20 @@
|
|
1
|
+
module WebFinger
|
2
|
+
module Debugger
|
3
|
+
class RequestFilter
|
4
|
+
# Callback called in HTTPClient (before sending a request)
|
5
|
+
# request:: HTTP::Message
|
6
|
+
def filter_request(request)
|
7
|
+
started = "======= [WebFinger] HTTP REQUEST STARTED ======="
|
8
|
+
WebFinger.logger.info [started, request.dump].join("\n")
|
9
|
+
end
|
10
|
+
|
11
|
+
# Callback called in HTTPClient (after received a response)
|
12
|
+
# request:: HTTP::Message
|
13
|
+
# response:: HTTP::Message
|
14
|
+
def filter_response(request, response)
|
15
|
+
finished = "======= [WebFinger] HTTP REQUEST FINISHED ======="
|
16
|
+
WebFinger.logger.info ['-' * 50, response.dump, finished].join("\n")
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
@@ -0,0 +1,36 @@
|
|
1
|
+
module WebFinger
|
2
|
+
class Exception < StandardError; end
|
3
|
+
|
4
|
+
class HttpError < Exception
|
5
|
+
attr_accessor :status, :response
|
6
|
+
def initialize(status, message = nil, response = nil)
|
7
|
+
super message
|
8
|
+
@status = status
|
9
|
+
@response = response
|
10
|
+
end
|
11
|
+
end
|
12
|
+
|
13
|
+
class BadRequest < HttpError
|
14
|
+
def initialize(message = nil, response = nil)
|
15
|
+
super 400, message, response
|
16
|
+
end
|
17
|
+
end
|
18
|
+
|
19
|
+
class Unauthorized < HttpError
|
20
|
+
def initialize(message = nil, response = nil)
|
21
|
+
super 401, message, response
|
22
|
+
end
|
23
|
+
end
|
24
|
+
|
25
|
+
class Forbidden < HttpError
|
26
|
+
def initialize(message = nil, response = nil)
|
27
|
+
super 403, message, response
|
28
|
+
end
|
29
|
+
end
|
30
|
+
|
31
|
+
class NotFound < HttpError
|
32
|
+
def initialize(message = nil, response = nil)
|
33
|
+
super 404, message, response
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
@@ -0,0 +1,72 @@
|
|
1
|
+
module WebFinger
|
2
|
+
class Request
|
3
|
+
attr_accessor :resource, :relations, :path
|
4
|
+
|
5
|
+
def initialize(resource, options = {})
|
6
|
+
self.resource = resource
|
7
|
+
self.relations = Array(options[:rel] || options[:relations])
|
8
|
+
self.path ||= '/.well-known/webfinger'
|
9
|
+
end
|
10
|
+
|
11
|
+
def discover!(cache_options = nil)
|
12
|
+
cached = WebFinger.cache.read cache_key
|
13
|
+
if cached.blank? || cached.expired?
|
14
|
+
fetched = handle_response do
|
15
|
+
WebFinger.http_client.get_content endpoint.to_s
|
16
|
+
end
|
17
|
+
cache_options ||= {}
|
18
|
+
cache_options[:expires_in] ||= fetched.expires_in
|
19
|
+
WebFinger.cache.write cache_key, fetched, cache_options
|
20
|
+
fetched
|
21
|
+
else
|
22
|
+
cached
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
26
|
+
private
|
27
|
+
|
28
|
+
def cache_key
|
29
|
+
"webfinger:resource:#{Digest::MD5.hexdigest query_string}"
|
30
|
+
end
|
31
|
+
|
32
|
+
def endpoint
|
33
|
+
host = URI.parse(resource).host || resource.split(':').last.split('@').last
|
34
|
+
WebFinger.url_builder.build [nil, host, nil, path, query_string, nil]
|
35
|
+
rescue URI::Error => e
|
36
|
+
raise Exception.new(e.message)
|
37
|
+
end
|
38
|
+
|
39
|
+
def query_string
|
40
|
+
query_params.join('&')
|
41
|
+
end
|
42
|
+
|
43
|
+
def query_params
|
44
|
+
_query_params_ = [{resource: resource}.to_query]
|
45
|
+
relations.each do |relation|
|
46
|
+
_query_params_ << {rel: relation}.to_query
|
47
|
+
end
|
48
|
+
_query_params_
|
49
|
+
end
|
50
|
+
|
51
|
+
def handle_response
|
52
|
+
raw_jrd = yield
|
53
|
+
jrd = MultiJson.load raw_jrd, symbolize_keys: true
|
54
|
+
Response.new jrd
|
55
|
+
rescue HTTPClient::BadResponseError => e
|
56
|
+
case e.res.try(:status)
|
57
|
+
when nil
|
58
|
+
raise Exception.new(e.message)
|
59
|
+
when 400
|
60
|
+
raise BadRequest.new('Bad Request', res)
|
61
|
+
when 401
|
62
|
+
raise Unauthorized.new('Unauthorized', res)
|
63
|
+
when 403
|
64
|
+
raise Forbidden.new('Forbidden', res)
|
65
|
+
when 404
|
66
|
+
raise NotFound.new('Not Found', res)
|
67
|
+
else
|
68
|
+
raise HttpError.new(e.res.status, e.res.reason, res)
|
69
|
+
end
|
70
|
+
end
|
71
|
+
end
|
72
|
+
end
|
@@ -0,0 +1,33 @@
|
|
1
|
+
# NOTE:
|
2
|
+
# Make a JSON Resource Descriptor (JRD) gem as separate one and use it as superclass?
|
3
|
+
|
4
|
+
module WebFinger
|
5
|
+
class Response < Hash
|
6
|
+
def initialize(hash)
|
7
|
+
replace hash
|
8
|
+
end
|
9
|
+
|
10
|
+
[:subject, :aliases, :properties, :links].each do |method|
|
11
|
+
define_method method do
|
12
|
+
self[method]
|
13
|
+
end
|
14
|
+
end
|
15
|
+
|
16
|
+
def expired?
|
17
|
+
expires.try(:past?)
|
18
|
+
end
|
19
|
+
def expires
|
20
|
+
@expires ||= case self[:expires]
|
21
|
+
when Time
|
22
|
+
self[:expires]
|
23
|
+
when String
|
24
|
+
Time.parse self[:expires]
|
25
|
+
end
|
26
|
+
end
|
27
|
+
def expires_in
|
28
|
+
if expires.present?
|
29
|
+
(Time.now - expires).to_i
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
@@ -0,0 +1,38 @@
|
|
1
|
+
require 'webmock/rspec'
|
2
|
+
|
3
|
+
module WebMockHelper
|
4
|
+
def mock_json(endpoint, response_file, options = {})
|
5
|
+
endpoint = endpoint.to_s
|
6
|
+
stub_request(:get, endpoint).with(
|
7
|
+
request_for(options)
|
8
|
+
).to_return(
|
9
|
+
response_for(response_file, options)
|
10
|
+
)
|
11
|
+
yield
|
12
|
+
a_request(:get, endpoint).with(
|
13
|
+
request_for(options)
|
14
|
+
).should have_been_made.once
|
15
|
+
end
|
16
|
+
|
17
|
+
private
|
18
|
+
|
19
|
+
def request_for(options = {})
|
20
|
+
request = {}
|
21
|
+
if options[:query]
|
22
|
+
request[:query] = options[:query]
|
23
|
+
end
|
24
|
+
request
|
25
|
+
end
|
26
|
+
|
27
|
+
def response_for(response_file, options = {})
|
28
|
+
response = {}
|
29
|
+
response[:body] = File.new(File.join(File.dirname(__FILE__), '../mock_json', "#{response_file}.json"))
|
30
|
+
if options[:status]
|
31
|
+
response[:status] = options[:status]
|
32
|
+
end
|
33
|
+
response
|
34
|
+
end
|
35
|
+
end
|
36
|
+
|
37
|
+
include WebMockHelper
|
38
|
+
WebMock.disable_net_connect!
|
@@ -0,0 +1,27 @@
|
|
1
|
+
{
|
2
|
+
"expires": "2012-11-16T19:41:35Z",
|
3
|
+
"subject": "acct:nov@example.com",
|
4
|
+
"aliases": ["http://nov.example.com/"],
|
5
|
+
"properties": {
|
6
|
+
"http://example.com/rel/role/": "employee"
|
7
|
+
},
|
8
|
+
"links": [{
|
9
|
+
"rel": "http://webfinger.net/rel/avatar",
|
10
|
+
"type": "image/jpeg",
|
11
|
+
"href": "http://nov.example.com/profile_picture.png"
|
12
|
+
}, {
|
13
|
+
"rel": "http://webfinger.net/rel/profile-page",
|
14
|
+
"href": "http://nov.example.com/"
|
15
|
+
}, {
|
16
|
+
"rel": "blog",
|
17
|
+
"type": "text/html",
|
18
|
+
"href": "http://blogs.nov.example.com/",
|
19
|
+
"titles": {
|
20
|
+
"en-us": "Nov's Blog",
|
21
|
+
"ja": "Novのブログ"
|
22
|
+
}
|
23
|
+
}, {
|
24
|
+
"rel": "vcard",
|
25
|
+
"href": "http://nov.example.com/me.vcf"
|
26
|
+
}]
|
27
|
+
}
|
@@ -0,0 +1,19 @@
|
|
1
|
+
{
|
2
|
+
"subject": "mailto:nov@example.com",
|
3
|
+
"links": [{
|
4
|
+
"rel": "http://example.net/rel/smtp-server",
|
5
|
+
"properties": {
|
6
|
+
"http://example.net/email/host": "smtp.example.com",
|
7
|
+
"http://example.net/email/port": "587",
|
8
|
+
"http://example.net/email/login-required": "yes",
|
9
|
+
"http://example.net/email/transport": "starttls"
|
10
|
+
}
|
11
|
+
}, {
|
12
|
+
"rel": "http://example.net/rel/imap-server",
|
13
|
+
"properties": {
|
14
|
+
"http://example.net/email/host": "imap.example.com",
|
15
|
+
"http://example.net/email/port": "993",
|
16
|
+
"http://example.net/email/transport": "ssl"
|
17
|
+
}
|
18
|
+
}]
|
19
|
+
}
|
@@ -0,0 +1,12 @@
|
|
1
|
+
{
|
2
|
+
"expires": "2012-11-16T19:41:35Z",
|
3
|
+
"subject": "acct:nov@example.com",
|
4
|
+
"aliases": ["http://nov.example.com/"],
|
5
|
+
"properties": {
|
6
|
+
"http://example.com/rel/role/": "employee"
|
7
|
+
},
|
8
|
+
"links": [{
|
9
|
+
"rel": "http://openid.net/specs/connect/1.0/issuer",
|
10
|
+
"href": "https://openid.example.com/"
|
11
|
+
}]
|
12
|
+
}
|
data/spec/spec_helper.rb
ADDED
@@ -0,0 +1,29 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe WebFinger::Debugger::RequestFilter do
|
4
|
+
let(:resource_endpoint) { 'https://example.com/resources' }
|
5
|
+
let(:request) { HTTP::Message.new_request(:get, URI.parse(resource_endpoint)) }
|
6
|
+
let(:response) { HTTP::Message.new_response({:hello => 'world'}.to_json) }
|
7
|
+
let(:request_filter) { WebFinger::Debugger::RequestFilter.new }
|
8
|
+
|
9
|
+
describe '#filter_request' do
|
10
|
+
it 'should log request' do
|
11
|
+
WebFinger.logger.should_receive(:info).with(
|
12
|
+
"======= [WebFinger] HTTP REQUEST STARTED =======\n" +
|
13
|
+
request.dump
|
14
|
+
)
|
15
|
+
request_filter.filter_request(request)
|
16
|
+
end
|
17
|
+
end
|
18
|
+
|
19
|
+
describe '#filter_response' do
|
20
|
+
it 'should log response' do
|
21
|
+
WebFinger.logger.should_receive(:info).with(
|
22
|
+
"--------------------------------------------------\n" +
|
23
|
+
response.dump +
|
24
|
+
"\n======= [WebFinger] HTTP REQUEST FINISHED ======="
|
25
|
+
)
|
26
|
+
request_filter.filter_response(request, response)
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
@@ -0,0 +1,90 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe WebFinger do
|
4
|
+
let(:resource) { "acct:nov@example.com" }
|
5
|
+
describe '#discover' do
|
6
|
+
it 'should return WebFinger::Response' do
|
7
|
+
mock_json "https://example.com/.well-known/webfinger", 'all', query: {resource: resource} do
|
8
|
+
response = WebFinger.discover! resource
|
9
|
+
response.should be_instance_of WebFinger::Response
|
10
|
+
end
|
11
|
+
end
|
12
|
+
end
|
13
|
+
|
14
|
+
describe '#cache' do
|
15
|
+
subject { WebFinger.cache }
|
16
|
+
|
17
|
+
context 'as default' do
|
18
|
+
it { should be_instance_of WebFinger::Cache }
|
19
|
+
end
|
20
|
+
|
21
|
+
context 'when specified' do
|
22
|
+
let(:cacher) { 'Rails.cache or something' }
|
23
|
+
before { WebFinger.cache = cacher }
|
24
|
+
it { should == cacher }
|
25
|
+
end
|
26
|
+
end
|
27
|
+
|
28
|
+
describe '#logger' do
|
29
|
+
subject { WebFinger.logger }
|
30
|
+
|
31
|
+
context 'as default' do
|
32
|
+
it { should be_instance_of Logger }
|
33
|
+
end
|
34
|
+
|
35
|
+
context 'when specified' do
|
36
|
+
let(:logger) { 'Rails.logger or something' }
|
37
|
+
before { WebFinger.logger = logger }
|
38
|
+
it { should == logger }
|
39
|
+
end
|
40
|
+
end
|
41
|
+
|
42
|
+
describe '#debugging?' do
|
43
|
+
subject { WebFinger.debugging? }
|
44
|
+
|
45
|
+
context 'as default' do
|
46
|
+
it { should be_false }
|
47
|
+
end
|
48
|
+
|
49
|
+
context 'when debugging' do
|
50
|
+
before { WebFinger.debug! }
|
51
|
+
it { should be_true }
|
52
|
+
|
53
|
+
context 'when debugging mode canceled' do
|
54
|
+
before { WebFinger.debugging = false }
|
55
|
+
it { should be_false }
|
56
|
+
end
|
57
|
+
end
|
58
|
+
end
|
59
|
+
|
60
|
+
describe '#url_builder' do
|
61
|
+
subject { WebFinger.url_builder }
|
62
|
+
|
63
|
+
context 'as default' do
|
64
|
+
it { should == URI::HTTPS }
|
65
|
+
end
|
66
|
+
|
67
|
+
context 'when specified' do
|
68
|
+
let(:url_builder) { 'URI::HTTP or something' }
|
69
|
+
before { WebFinger.url_builder = url_builder }
|
70
|
+
it { should == url_builder }
|
71
|
+
end
|
72
|
+
end
|
73
|
+
|
74
|
+
describe '#http_client' do
|
75
|
+
subject { WebFinger.http_client }
|
76
|
+
|
77
|
+
describe '#request_filter' do
|
78
|
+
subject { WebFinger.http_client.request_filter.collect(&:class) }
|
79
|
+
|
80
|
+
context 'as default' do
|
81
|
+
it { should_not include WebFinger::Debugger::RequestFilter }
|
82
|
+
end
|
83
|
+
|
84
|
+
context 'when debugging' do
|
85
|
+
before { WebFinger.debug! }
|
86
|
+
it { should include WebFinger::Debugger::RequestFilter }
|
87
|
+
end
|
88
|
+
end
|
89
|
+
end
|
90
|
+
end
|
data/webfinger.gemspec
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
Gem::Specification.new do |gem|
|
2
|
+
gem.name = "webfinger"
|
3
|
+
gem.version = File.read("VERSION").delete("\n\r")
|
4
|
+
gem.authors = ["nov matake"]
|
5
|
+
gem.email = ["nov@matake.jp"]
|
6
|
+
gem.description = %q{Ruby WebFinger client library}
|
7
|
+
gem.summary = %q{Ruby WebFinger client library, following IETF WebFinger WG spec updates.}
|
8
|
+
gem.homepage = "https://github.com/nov/webfinger"
|
9
|
+
|
10
|
+
gem.files = `git ls-files`.split($/)
|
11
|
+
gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
|
12
|
+
gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
|
13
|
+
gem.require_paths = ["lib"]
|
14
|
+
gem.add_runtime_dependency "httpclient", ">= 2.2.0.2"
|
15
|
+
gem.add_runtime_dependency "multi_json"
|
16
|
+
gem.add_runtime_dependency "activesupport", ">= 3"
|
17
|
+
gem.add_development_dependency "rspec", ">= 2"
|
18
|
+
gem.add_development_dependency "cover_me", ">= 1.2.0"
|
19
|
+
gem.add_development_dependency "webmock", ">= 1.6.2"
|
20
|
+
end
|
metadata
ADDED
@@ -0,0 +1,173 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: webfinger
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.0
|
5
|
+
prerelease:
|
6
|
+
platform: ruby
|
7
|
+
authors:
|
8
|
+
- nov matake
|
9
|
+
autorequire:
|
10
|
+
bindir: bin
|
11
|
+
cert_chain: []
|
12
|
+
date: 2012-12-18 00:00:00.000000000 Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
15
|
+
name: httpclient
|
16
|
+
requirement: !ruby/object:Gem::Requirement
|
17
|
+
none: false
|
18
|
+
requirements:
|
19
|
+
- - ! '>='
|
20
|
+
- !ruby/object:Gem::Version
|
21
|
+
version: 2.2.0.2
|
22
|
+
type: :runtime
|
23
|
+
prerelease: false
|
24
|
+
version_requirements: !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
26
|
+
requirements:
|
27
|
+
- - ! '>='
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
version: 2.2.0.2
|
30
|
+
- !ruby/object:Gem::Dependency
|
31
|
+
name: multi_json
|
32
|
+
requirement: !ruby/object:Gem::Requirement
|
33
|
+
none: false
|
34
|
+
requirements:
|
35
|
+
- - ! '>='
|
36
|
+
- !ruby/object:Gem::Version
|
37
|
+
version: '0'
|
38
|
+
type: :runtime
|
39
|
+
prerelease: false
|
40
|
+
version_requirements: !ruby/object:Gem::Requirement
|
41
|
+
none: false
|
42
|
+
requirements:
|
43
|
+
- - ! '>='
|
44
|
+
- !ruby/object:Gem::Version
|
45
|
+
version: '0'
|
46
|
+
- !ruby/object:Gem::Dependency
|
47
|
+
name: activesupport
|
48
|
+
requirement: !ruby/object:Gem::Requirement
|
49
|
+
none: false
|
50
|
+
requirements:
|
51
|
+
- - ! '>='
|
52
|
+
- !ruby/object:Gem::Version
|
53
|
+
version: '3'
|
54
|
+
type: :runtime
|
55
|
+
prerelease: false
|
56
|
+
version_requirements: !ruby/object:Gem::Requirement
|
57
|
+
none: false
|
58
|
+
requirements:
|
59
|
+
- - ! '>='
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '3'
|
62
|
+
- !ruby/object:Gem::Dependency
|
63
|
+
name: rspec
|
64
|
+
requirement: !ruby/object:Gem::Requirement
|
65
|
+
none: false
|
66
|
+
requirements:
|
67
|
+
- - ! '>='
|
68
|
+
- !ruby/object:Gem::Version
|
69
|
+
version: '2'
|
70
|
+
type: :development
|
71
|
+
prerelease: false
|
72
|
+
version_requirements: !ruby/object:Gem::Requirement
|
73
|
+
none: false
|
74
|
+
requirements:
|
75
|
+
- - ! '>='
|
76
|
+
- !ruby/object:Gem::Version
|
77
|
+
version: '2'
|
78
|
+
- !ruby/object:Gem::Dependency
|
79
|
+
name: cover_me
|
80
|
+
requirement: !ruby/object:Gem::Requirement
|
81
|
+
none: false
|
82
|
+
requirements:
|
83
|
+
- - ! '>='
|
84
|
+
- !ruby/object:Gem::Version
|
85
|
+
version: 1.2.0
|
86
|
+
type: :development
|
87
|
+
prerelease: false
|
88
|
+
version_requirements: !ruby/object:Gem::Requirement
|
89
|
+
none: false
|
90
|
+
requirements:
|
91
|
+
- - ! '>='
|
92
|
+
- !ruby/object:Gem::Version
|
93
|
+
version: 1.2.0
|
94
|
+
- !ruby/object:Gem::Dependency
|
95
|
+
name: webmock
|
96
|
+
requirement: !ruby/object:Gem::Requirement
|
97
|
+
none: false
|
98
|
+
requirements:
|
99
|
+
- - ! '>='
|
100
|
+
- !ruby/object:Gem::Version
|
101
|
+
version: 1.6.2
|
102
|
+
type: :development
|
103
|
+
prerelease: false
|
104
|
+
version_requirements: !ruby/object:Gem::Requirement
|
105
|
+
none: false
|
106
|
+
requirements:
|
107
|
+
- - ! '>='
|
108
|
+
- !ruby/object:Gem::Version
|
109
|
+
version: 1.6.2
|
110
|
+
description: Ruby WebFinger client library
|
111
|
+
email:
|
112
|
+
- nov@matake.jp
|
113
|
+
executables: []
|
114
|
+
extensions: []
|
115
|
+
extra_rdoc_files: []
|
116
|
+
files:
|
117
|
+
- .gitignore
|
118
|
+
- Gemfile
|
119
|
+
- LICENSE.txt
|
120
|
+
- README.md
|
121
|
+
- Rakefile
|
122
|
+
- VERSION
|
123
|
+
- lib/webfinger.rb
|
124
|
+
- lib/webfinger/cache.rb
|
125
|
+
- lib/webfinger/debugger.rb
|
126
|
+
- lib/webfinger/debugger/request_filter.rb
|
127
|
+
- lib/webfinger/exception.rb
|
128
|
+
- lib/webfinger/request.rb
|
129
|
+
- lib/webfinger/response.rb
|
130
|
+
- spec/helpers/webmock_helper.rb
|
131
|
+
- spec/mock_json/all.json
|
132
|
+
- spec/mock_json/device_info.json
|
133
|
+
- spec/mock_json/email_config.json
|
134
|
+
- spec/mock_json/open_id.json
|
135
|
+
- spec/spec_helper.rb
|
136
|
+
- spec/webfinger/debugger/request_filter_spec.rb
|
137
|
+
- spec/webfinger/request_spec.rb
|
138
|
+
- spec/webfinger_spec.rb
|
139
|
+
- webfinger.gemspec
|
140
|
+
homepage: https://github.com/nov/webfinger
|
141
|
+
licenses: []
|
142
|
+
post_install_message:
|
143
|
+
rdoc_options: []
|
144
|
+
require_paths:
|
145
|
+
- lib
|
146
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
147
|
+
none: false
|
148
|
+
requirements:
|
149
|
+
- - ! '>='
|
150
|
+
- !ruby/object:Gem::Version
|
151
|
+
version: '0'
|
152
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
153
|
+
none: false
|
154
|
+
requirements:
|
155
|
+
- - ! '>='
|
156
|
+
- !ruby/object:Gem::Version
|
157
|
+
version: '0'
|
158
|
+
requirements: []
|
159
|
+
rubyforge_project:
|
160
|
+
rubygems_version: 1.8.24
|
161
|
+
signing_key:
|
162
|
+
specification_version: 3
|
163
|
+
summary: Ruby WebFinger client library, following IETF WebFinger WG spec updates.
|
164
|
+
test_files:
|
165
|
+
- spec/helpers/webmock_helper.rb
|
166
|
+
- spec/mock_json/all.json
|
167
|
+
- spec/mock_json/device_info.json
|
168
|
+
- spec/mock_json/email_config.json
|
169
|
+
- spec/mock_json/open_id.json
|
170
|
+
- spec/spec_helper.rb
|
171
|
+
- spec/webfinger/debugger/request_filter_spec.rb
|
172
|
+
- spec/webfinger/request_spec.rb
|
173
|
+
- spec/webfinger_spec.rb
|