faraday-hypermedia 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +9 -0
- data/.travis.yml +4 -0
- data/Gemfile +4 -0
- data/LICENSE.txt +21 -0
- data/README.md +41 -0
- data/Rakefile +10 -0
- data/bin/console +14 -0
- data/bin/setup +8 -0
- data/faraday-hypermedia.gemspec +34 -0
- data/lib/faraday-hypermedia.rb +1 -0
- data/lib/faraday/hypermedia.rb +17 -0
- data/lib/faraday/hypermedia/history.rb +120 -0
- data/lib/faraday/hypermedia/link_extractor.rb +88 -0
- data/lib/faraday/hypermedia/navigation.rb +48 -0
- data/lib/faraday/hypermedia/version.rb +5 -0
- data/lib/uri/navigation.rb +39 -0
- metadata +215 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: f63e35dfde4a2d3f6515bf0657d07a1b128610ce
|
4
|
+
data.tar.gz: bb28d0fca41af3d65699dc94dbf5f19febad83f5
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 970c174716e533844369a0f314e8e98bc3ac28be282976a1a36cf5ca285e05b23d0d16fb96bb0c74802ebea0575e1b0a8b9d6a85f8fa32bd9857bb7765aca9a5
|
7
|
+
data.tar.gz: 80ba187fdbe7a6783d9c2bf26916f76f2bdb1901b6f88d07b034e8cf1c6b37149eeb50cae23fbe7330eecf4b920cfa2d45400e9073806014e5e312f99a756b22
|
data/.gitignore
ADDED
data/.travis.yml
ADDED
data/Gemfile
ADDED
data/LICENSE.txt
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Copyright (c) 2016 Toru KAWAMURA
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in
|
13
|
+
all copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
21
|
+
THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,41 @@
|
|
1
|
+
# Faraday::Hypermedia
|
2
|
+
|
3
|
+
Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/faraday/hypermedia`. To experiment with that code, run `bin/console` for an interactive prompt.
|
4
|
+
|
5
|
+
TODO: Delete this and the text above, and describe your gem
|
6
|
+
|
7
|
+
## Installation
|
8
|
+
|
9
|
+
Add this line to your application's Gemfile:
|
10
|
+
|
11
|
+
```ruby
|
12
|
+
gem 'faraday-hypermedia'
|
13
|
+
```
|
14
|
+
|
15
|
+
And then execute:
|
16
|
+
|
17
|
+
$ bundle
|
18
|
+
|
19
|
+
Or install it yourself as:
|
20
|
+
|
21
|
+
$ gem install faraday-hypermedia
|
22
|
+
|
23
|
+
## Usage
|
24
|
+
|
25
|
+
TODO: Write usage instructions here
|
26
|
+
|
27
|
+
## Development
|
28
|
+
|
29
|
+
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake test` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|
30
|
+
|
31
|
+
To 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).
|
32
|
+
|
33
|
+
## Contributing
|
34
|
+
|
35
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/faraday-hypermedia.
|
36
|
+
|
37
|
+
|
38
|
+
## License
|
39
|
+
|
40
|
+
The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
|
41
|
+
|
data/Rakefile
ADDED
data/bin/console
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require "bundler/setup"
|
4
|
+
require "faraday/hypermedia"
|
5
|
+
|
6
|
+
# You can add fixtures and/or initialization code here to make experimenting
|
7
|
+
# with your gem easier. You can also use a different console, if you like.
|
8
|
+
|
9
|
+
# (If you use this, don't forget to add pry to your Gemfile!)
|
10
|
+
# require "pry"
|
11
|
+
# Pry.start
|
12
|
+
|
13
|
+
require "irb"
|
14
|
+
IRB.start
|
data/bin/setup
ADDED
@@ -0,0 +1,34 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require 'faraday/hypermedia/version'
|
5
|
+
|
6
|
+
Gem::Specification.new do |spec|
|
7
|
+
spec.name = "faraday-hypermedia"
|
8
|
+
spec.version = Faraday::Hypermedia::VERSION
|
9
|
+
spec.authors = ["Toru KAWAMURA"]
|
10
|
+
spec.email = ["tkawa@4bit.net"]
|
11
|
+
|
12
|
+
spec.summary = %q{Faraday middleware that supports hypermedia client}
|
13
|
+
spec.description = %q{Faraday middleware that supports hypermedia client}
|
14
|
+
spec.homepage = "https://github.com/tkawa/faraday-hypermedia"
|
15
|
+
spec.license = "MIT"
|
16
|
+
|
17
|
+
spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
18
|
+
spec.bindir = "exe"
|
19
|
+
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
20
|
+
spec.require_paths = ["lib"]
|
21
|
+
|
22
|
+
spec.add_dependency "faraday", ">= 0.8.0"
|
23
|
+
spec.add_dependency 'faraday_middleware'
|
24
|
+
spec.add_dependency 'http_link_header'
|
25
|
+
spec.add_dependency 'faraday_collection_json'
|
26
|
+
spec.add_dependency 'uri_template'
|
27
|
+
|
28
|
+
spec.add_development_dependency "bundler", "~> 1.11"
|
29
|
+
spec.add_development_dependency "rake", "~> 10.0"
|
30
|
+
spec.add_development_dependency "minitest", "~> 5.0"
|
31
|
+
spec.add_development_dependency 'awesome_print'
|
32
|
+
spec.add_development_dependency 'faraday-detailed_logger'
|
33
|
+
spec.add_development_dependency 'faraday-http-cache'
|
34
|
+
end
|
@@ -0,0 +1 @@
|
|
1
|
+
require 'faraday/hypermedia'
|
@@ -0,0 +1,17 @@
|
|
1
|
+
require 'faraday'
|
2
|
+
require 'faraday/hypermedia/history'
|
3
|
+
require 'faraday/hypermedia/link_extractor'
|
4
|
+
require 'faraday/hypermedia/navigation'
|
5
|
+
require 'faraday/hypermedia/version'
|
6
|
+
require_relative '../uri/navigation'
|
7
|
+
|
8
|
+
module Faraday
|
9
|
+
module Hypermedia
|
10
|
+
RE_URI_TEMPLATE = /\{.*\}/
|
11
|
+
end
|
12
|
+
|
13
|
+
Middleware.register_middleware navigation: Hypermedia::Navigation
|
14
|
+
Response.register_middleware link_cj: Hypermedia::LinkExtractorCJ
|
15
|
+
Response.register_middleware link_github: Hypermedia::LinkExtractorGithub
|
16
|
+
|
17
|
+
end
|
@@ -0,0 +1,120 @@
|
|
1
|
+
require 'http_link_header'
|
2
|
+
require 'uri_template'
|
3
|
+
|
4
|
+
module Faraday
|
5
|
+
module Hypermedia
|
6
|
+
class History
|
7
|
+
State = Struct.new(:data, :title, :url)
|
8
|
+
|
9
|
+
def initialize
|
10
|
+
@stored_states = [build_state]
|
11
|
+
@current_index = 0
|
12
|
+
reset_current_links
|
13
|
+
end
|
14
|
+
|
15
|
+
def current_state
|
16
|
+
@stored_states[@current_index]
|
17
|
+
end
|
18
|
+
|
19
|
+
# いったんここに実装
|
20
|
+
def current_links
|
21
|
+
@current_links ||= build_current_links
|
22
|
+
end
|
23
|
+
|
24
|
+
def pp_current_links
|
25
|
+
# TODO: きれいにする
|
26
|
+
# current_links.to_a.join("#{current_links.class::DELIMETER}\n")
|
27
|
+
rels = current_links.map{|url, params| params['rel'].to_a.map{|rel| [rel, [url, params]] }}.flatten(1).group_by{|rel, _| rel}
|
28
|
+
rels.each do |rel, links|
|
29
|
+
puts("rel=#{rel}")
|
30
|
+
if links.length >= 2
|
31
|
+
links.each.with_index(1) do |(_, link), i|
|
32
|
+
url, params = link
|
33
|
+
params = params.dup
|
34
|
+
params.delete('rel')
|
35
|
+
print(" (#{i}) <#{url}>")
|
36
|
+
print(" (#{params})") unless params.empty?
|
37
|
+
puts
|
38
|
+
end
|
39
|
+
else
|
40
|
+
url, params = links.first.last
|
41
|
+
params = params.dup
|
42
|
+
params.delete('rel')
|
43
|
+
print(" <#{url}>")
|
44
|
+
print(" (#{params})") unless params.empty?
|
45
|
+
puts
|
46
|
+
end
|
47
|
+
end
|
48
|
+
nil
|
49
|
+
end
|
50
|
+
|
51
|
+
def fill_in_template_params(template_params)
|
52
|
+
template_urls = current_links.keys.select { |k| k =~ RE_URI_TEMPLATE }
|
53
|
+
template_urls.each do |template_url|
|
54
|
+
expanded_url = URITemplate.new(template_url).expand(template_params) # Addressable のほうが良いかも
|
55
|
+
link_params = current_links.delete(template_url)
|
56
|
+
current_links.store(expanded_url, link_params)
|
57
|
+
end
|
58
|
+
end
|
59
|
+
|
60
|
+
def reset_current_links
|
61
|
+
@current_links = nil
|
62
|
+
end
|
63
|
+
|
64
|
+
def push_state(data, title, url)
|
65
|
+
if url == current_state.url
|
66
|
+
replace_state(data, title, url)
|
67
|
+
else
|
68
|
+
@stored_states.slice!((@current_index+1)..-1) # current_index の先から最後まで削除
|
69
|
+
state = build_state(data: data, title: title, url: url)
|
70
|
+
@stored_states.push(state)
|
71
|
+
@current_index += 1
|
72
|
+
reset_current_links
|
73
|
+
state
|
74
|
+
end
|
75
|
+
end
|
76
|
+
|
77
|
+
def replace_state(data, title, url)
|
78
|
+
reset_current_links
|
79
|
+
@stored_states[@current_index] = build_state(data: data, title: title, url: url)
|
80
|
+
end
|
81
|
+
|
82
|
+
def push(response_env)
|
83
|
+
url = response_env[:url]
|
84
|
+
push_state(response_env, '', url)
|
85
|
+
end
|
86
|
+
|
87
|
+
def back
|
88
|
+
if @current_index >= 1
|
89
|
+
@current_index -= 1
|
90
|
+
reset_current_links
|
91
|
+
end
|
92
|
+
end
|
93
|
+
|
94
|
+
def forward
|
95
|
+
if @current_index < @stored_states.length - 1
|
96
|
+
@current_index += 1
|
97
|
+
reset_current_links
|
98
|
+
end
|
99
|
+
end
|
100
|
+
|
101
|
+
private
|
102
|
+
|
103
|
+
def build_state(source = {})
|
104
|
+
State.new(
|
105
|
+
source[:data] || {},
|
106
|
+
source[:title] || '',
|
107
|
+
source[:url] || URI('navigation:blank')
|
108
|
+
)
|
109
|
+
end
|
110
|
+
|
111
|
+
def build_current_links
|
112
|
+
current_response_headers = current_state.data[:response_headers]
|
113
|
+
return HttpLinkHeader.new unless current_response_headers
|
114
|
+
links = current_response_headers['link'].to_s.scan(/<[^>]*>[^,]*/)
|
115
|
+
link_templates = current_response_headers['link-template'].to_s.scan(/<[^>]*>[^,]*/) # 自前でsplitする
|
116
|
+
HttpLinkHeader.new(links + link_templates)
|
117
|
+
end
|
118
|
+
end
|
119
|
+
end
|
120
|
+
end
|
@@ -0,0 +1,88 @@
|
|
1
|
+
require 'faraday_collection_json'
|
2
|
+
require 'faraday_middleware'
|
3
|
+
|
4
|
+
module Faraday
|
5
|
+
module Hypermedia
|
6
|
+
class LinkExtractorCJ < FaradayCollectionJSON::ParseCollectionJSON
|
7
|
+
def process_response(response_env)
|
8
|
+
# TODO: collectionのlinksしか取り出していない。itemsにも存在する
|
9
|
+
# TODO: itemsのselfがあれば取り出す
|
10
|
+
cj = parse(response_env[:body])
|
11
|
+
return if cj.links.empty? && cj.items.empty?
|
12
|
+
# link_arrays = cj.links.map do |link|
|
13
|
+
# attrs = [['rel', link.rel]]
|
14
|
+
# attrs << ['title', link.name] if link.name
|
15
|
+
# [link.href, attrs]
|
16
|
+
# end
|
17
|
+
# link_value = LinkHeader.new(link_arrays).to_s
|
18
|
+
link_values = cj.links.map { |link|
|
19
|
+
value = %(<#{link.href}>;rel="#{link.rel}")
|
20
|
+
value += %(;title="#{link.name}") if link.name
|
21
|
+
value
|
22
|
+
}
|
23
|
+
item_values = cj.items.map { |item| %(<#{item.href}>;rel="item") if item.href }.compact
|
24
|
+
link_header = (link_values + item_values).join(',')
|
25
|
+
if response_env[:response_headers]['link']
|
26
|
+
response_env[:response_headers]['link'] += ",#{link_header}"
|
27
|
+
else
|
28
|
+
response_env[:response_headers]['link'] = link_header
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
32
|
+
|
33
|
+
class LinkExtractorGithub < FaradayMiddleware::ParseJson
|
34
|
+
def process_response(response_env)
|
35
|
+
doc = parse(response_env[:body])
|
36
|
+
if doc.is_a? Hash
|
37
|
+
link_template_props, link_props = doc.select { |name, _| name.end_with?('_url') }.partition { |_, url| url =~ RE_URI_TEMPLATE }
|
38
|
+
self_url = doc['url']
|
39
|
+
return if link_props.empty? && self_url.nil?
|
40
|
+
link_values = build_link_values(link_props)
|
41
|
+
link_values.unshift(%(<#{self_url}>;rel="self")) if self_url
|
42
|
+
item_props = doc.map { |name, c| [name, c['url']] if c.is_a?(Hash) && c['url'] }.compact
|
43
|
+
link_values.concat build_item_link_values(item_props)
|
44
|
+
link_template_values = build_link_values(link_template_props)
|
45
|
+
elsif doc.is_a? Array
|
46
|
+
# treat it as a collection
|
47
|
+
item_props = doc.map { |d| [d['name'], d['url']] if d['url'] }.compact
|
48
|
+
return if item_props.empty?
|
49
|
+
link_values = build_item_link_values(item_props)
|
50
|
+
link_template_values = []
|
51
|
+
else
|
52
|
+
return
|
53
|
+
end
|
54
|
+
link_header = link_values.join(',')
|
55
|
+
unless link_header.empty?
|
56
|
+
if response_env[:response_headers]['link']
|
57
|
+
response_env[:response_headers]['link'] += ",#{link_header}"
|
58
|
+
else
|
59
|
+
response_env[:response_headers]['link'] = link_header
|
60
|
+
end
|
61
|
+
end
|
62
|
+
link_template_header = link_template_values.join(',')
|
63
|
+
unless link_template_header.empty?
|
64
|
+
if response_env[:response_headers]['link-template']
|
65
|
+
response_env[:response_headers]['link-template'] += ",#{link_template_header}"
|
66
|
+
else
|
67
|
+
response_env[:response_headers]['link-template'] = link_template_header
|
68
|
+
end
|
69
|
+
end
|
70
|
+
end
|
71
|
+
|
72
|
+
private
|
73
|
+
|
74
|
+
def build_link_values(props)
|
75
|
+
props.map { |name, url|
|
76
|
+
rel = name.slice(0..-5) # '_url' を除いた名前
|
77
|
+
%(<#{url}>;rel="#{rel}") if url.to_s != ''
|
78
|
+
}.compact
|
79
|
+
end
|
80
|
+
|
81
|
+
def build_item_link_values(props)
|
82
|
+
props.map { |name, url|
|
83
|
+
%(<#{url}>;rel="item";title="#{name}") if url.to_s != ''
|
84
|
+
}.compact
|
85
|
+
end
|
86
|
+
end
|
87
|
+
end
|
88
|
+
end
|
@@ -0,0 +1,48 @@
|
|
1
|
+
module Faraday
|
2
|
+
module Hypermedia
|
3
|
+
class Navigation < Middleware
|
4
|
+
attr_reader :history
|
5
|
+
|
6
|
+
def initialize(app, history = nil, options = {})
|
7
|
+
super(app)
|
8
|
+
puts 'Navigation Enabled!'
|
9
|
+
@history = history || History.new
|
10
|
+
end
|
11
|
+
|
12
|
+
def call(request_env)
|
13
|
+
# request
|
14
|
+
url = request_env[:url]
|
15
|
+
if url.scheme == 'navigation'
|
16
|
+
case url.to
|
17
|
+
when 'back'
|
18
|
+
@history.back
|
19
|
+
request_env[:url] = @history.current_state.url
|
20
|
+
when 'forward'
|
21
|
+
@history.forward
|
22
|
+
request_env[:url] = @history.current_state.url
|
23
|
+
when 'go'
|
24
|
+
# TODO
|
25
|
+
when /\Alink(?:\((\d+)\))?\z/ # link or link(index)
|
26
|
+
index = (Regexp.last_match(1) || 1).to_i # one origin
|
27
|
+
matched_links = @history.current_links
|
28
|
+
unless url.queries.empty?
|
29
|
+
attr_name, attr_value = url.queries.first # TODO: multiple
|
30
|
+
matched_links = matched_links.select { |_ ,v| v[attr_name] && v[attr_name].include?(attr_value) } # TODO: multiple
|
31
|
+
end
|
32
|
+
raise 'cannot find link' if matched_links.empty?
|
33
|
+
matched_url = matched_links.to_a[index - 1].first
|
34
|
+
matched_url = URITemplate.new(matched_url).expand if matched_url =~ RE_URI_TEMPLATE
|
35
|
+
request_env[:url] = URI(matched_url)
|
36
|
+
else
|
37
|
+
raise "cannot use #{url.to}"
|
38
|
+
end
|
39
|
+
end
|
40
|
+
|
41
|
+
# response
|
42
|
+
@app.call(request_env).on_complete do |response_env|
|
43
|
+
@history.push response_env
|
44
|
+
end
|
45
|
+
end
|
46
|
+
end
|
47
|
+
end
|
48
|
+
end
|
@@ -0,0 +1,39 @@
|
|
1
|
+
require 'uri'
|
2
|
+
|
3
|
+
module URI
|
4
|
+
class Navigation < Generic
|
5
|
+
DEFAULT_PORT = nil
|
6
|
+
COMPONENT = [ :scheme, :to, :query ].freeze
|
7
|
+
|
8
|
+
def initialize(*arg)
|
9
|
+
super(*arg)
|
10
|
+
to, query = @opaque.split('?', 2)
|
11
|
+
@to = to
|
12
|
+
self.query = query
|
13
|
+
end
|
14
|
+
|
15
|
+
attr_reader :to
|
16
|
+
|
17
|
+
def query=(v)
|
18
|
+
return @query = nil unless v
|
19
|
+
|
20
|
+
x = v.to_str
|
21
|
+
v = x.dup if x.equal? v
|
22
|
+
v.encode!(Encoding::UTF_8) rescue nil
|
23
|
+
v.delete!("\t\r\n")
|
24
|
+
v.force_encoding(Encoding::ASCII_8BIT)
|
25
|
+
v.gsub!(/(?!%\h\h|[!$-&(-;=?-_a-~])./n.freeze){'%%%02X' % $&.ord}
|
26
|
+
v.force_encoding(Encoding::US_ASCII)
|
27
|
+
@query = v
|
28
|
+
end
|
29
|
+
|
30
|
+
def queries
|
31
|
+
@query.split('&').map { |x| x.split(/=/, 2) }.to_h
|
32
|
+
end
|
33
|
+
|
34
|
+
def to_s
|
35
|
+
"#{@scheme}:#{@to}" + (@query && !@query.empty? ? "?#{@query}" : '')
|
36
|
+
end
|
37
|
+
end
|
38
|
+
@@schemes['NAVIGATION'] = Navigation
|
39
|
+
end
|
metadata
ADDED
@@ -0,0 +1,215 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: faraday-hypermedia
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Toru KAWAMURA
|
8
|
+
autorequire:
|
9
|
+
bindir: exe
|
10
|
+
cert_chain: []
|
11
|
+
date: 2016-09-09 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: faraday
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - ">="
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: 0.8.0
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ">="
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: 0.8.0
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: faraday_middleware
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ">="
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '0'
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ">="
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: http_link_header
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - ">="
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '0'
|
48
|
+
type: :runtime
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - ">="
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: faraday_collection_json
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - ">="
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
62
|
+
type: :runtime
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - ">="
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '0'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: uri_template
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - ">="
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '0'
|
76
|
+
type: :runtime
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - ">="
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '0'
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: bundler
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - "~>"
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: '1.11'
|
90
|
+
type: :development
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - "~>"
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: '1.11'
|
97
|
+
- !ruby/object:Gem::Dependency
|
98
|
+
name: rake
|
99
|
+
requirement: !ruby/object:Gem::Requirement
|
100
|
+
requirements:
|
101
|
+
- - "~>"
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
version: '10.0'
|
104
|
+
type: :development
|
105
|
+
prerelease: false
|
106
|
+
version_requirements: !ruby/object:Gem::Requirement
|
107
|
+
requirements:
|
108
|
+
- - "~>"
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: '10.0'
|
111
|
+
- !ruby/object:Gem::Dependency
|
112
|
+
name: minitest
|
113
|
+
requirement: !ruby/object:Gem::Requirement
|
114
|
+
requirements:
|
115
|
+
- - "~>"
|
116
|
+
- !ruby/object:Gem::Version
|
117
|
+
version: '5.0'
|
118
|
+
type: :development
|
119
|
+
prerelease: false
|
120
|
+
version_requirements: !ruby/object:Gem::Requirement
|
121
|
+
requirements:
|
122
|
+
- - "~>"
|
123
|
+
- !ruby/object:Gem::Version
|
124
|
+
version: '5.0'
|
125
|
+
- !ruby/object:Gem::Dependency
|
126
|
+
name: awesome_print
|
127
|
+
requirement: !ruby/object:Gem::Requirement
|
128
|
+
requirements:
|
129
|
+
- - ">="
|
130
|
+
- !ruby/object:Gem::Version
|
131
|
+
version: '0'
|
132
|
+
type: :development
|
133
|
+
prerelease: false
|
134
|
+
version_requirements: !ruby/object:Gem::Requirement
|
135
|
+
requirements:
|
136
|
+
- - ">="
|
137
|
+
- !ruby/object:Gem::Version
|
138
|
+
version: '0'
|
139
|
+
- !ruby/object:Gem::Dependency
|
140
|
+
name: faraday-detailed_logger
|
141
|
+
requirement: !ruby/object:Gem::Requirement
|
142
|
+
requirements:
|
143
|
+
- - ">="
|
144
|
+
- !ruby/object:Gem::Version
|
145
|
+
version: '0'
|
146
|
+
type: :development
|
147
|
+
prerelease: false
|
148
|
+
version_requirements: !ruby/object:Gem::Requirement
|
149
|
+
requirements:
|
150
|
+
- - ">="
|
151
|
+
- !ruby/object:Gem::Version
|
152
|
+
version: '0'
|
153
|
+
- !ruby/object:Gem::Dependency
|
154
|
+
name: faraday-http-cache
|
155
|
+
requirement: !ruby/object:Gem::Requirement
|
156
|
+
requirements:
|
157
|
+
- - ">="
|
158
|
+
- !ruby/object:Gem::Version
|
159
|
+
version: '0'
|
160
|
+
type: :development
|
161
|
+
prerelease: false
|
162
|
+
version_requirements: !ruby/object:Gem::Requirement
|
163
|
+
requirements:
|
164
|
+
- - ">="
|
165
|
+
- !ruby/object:Gem::Version
|
166
|
+
version: '0'
|
167
|
+
description: Faraday middleware that supports hypermedia client
|
168
|
+
email:
|
169
|
+
- tkawa@4bit.net
|
170
|
+
executables: []
|
171
|
+
extensions: []
|
172
|
+
extra_rdoc_files: []
|
173
|
+
files:
|
174
|
+
- ".gitignore"
|
175
|
+
- ".travis.yml"
|
176
|
+
- Gemfile
|
177
|
+
- LICENSE.txt
|
178
|
+
- README.md
|
179
|
+
- Rakefile
|
180
|
+
- bin/console
|
181
|
+
- bin/setup
|
182
|
+
- faraday-hypermedia.gemspec
|
183
|
+
- lib/faraday-hypermedia.rb
|
184
|
+
- lib/faraday/hypermedia.rb
|
185
|
+
- lib/faraday/hypermedia/history.rb
|
186
|
+
- lib/faraday/hypermedia/link_extractor.rb
|
187
|
+
- lib/faraday/hypermedia/navigation.rb
|
188
|
+
- lib/faraday/hypermedia/version.rb
|
189
|
+
- lib/uri/navigation.rb
|
190
|
+
homepage: https://github.com/tkawa/faraday-hypermedia
|
191
|
+
licenses:
|
192
|
+
- MIT
|
193
|
+
metadata: {}
|
194
|
+
post_install_message:
|
195
|
+
rdoc_options: []
|
196
|
+
require_paths:
|
197
|
+
- lib
|
198
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
199
|
+
requirements:
|
200
|
+
- - ">="
|
201
|
+
- !ruby/object:Gem::Version
|
202
|
+
version: '0'
|
203
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
204
|
+
requirements:
|
205
|
+
- - ">="
|
206
|
+
- !ruby/object:Gem::Version
|
207
|
+
version: '0'
|
208
|
+
requirements: []
|
209
|
+
rubyforge_project:
|
210
|
+
rubygems_version: 2.5.1
|
211
|
+
signing_key:
|
212
|
+
specification_version: 4
|
213
|
+
summary: Faraday middleware that supports hypermedia client
|
214
|
+
test_files: []
|
215
|
+
has_rdoc:
|