agiley-faraday_middleware 0.8.3 → 0.8.3.1
Sign up to get free protection for your applications and to get access to all the features.
data/.gitignore
CHANGED
data/lib/faraday_middleware.rb
CHANGED
@@ -1,20 +1,21 @@
|
|
1
1
|
require 'faraday'
|
2
2
|
|
3
3
|
module FaradayMiddleware
|
4
|
-
autoload :OAuth,
|
5
|
-
autoload :OAuth2,
|
6
|
-
autoload :EncodeJson,
|
7
|
-
autoload :Mashify,
|
8
|
-
autoload :Rashify,
|
9
|
-
autoload :ParseJson,
|
10
|
-
autoload :ParseXml,
|
11
|
-
autoload :ParseNokogiriXml,
|
12
|
-
autoload :
|
13
|
-
autoload :
|
14
|
-
autoload :
|
15
|
-
autoload :
|
16
|
-
autoload :
|
17
|
-
autoload :
|
4
|
+
autoload :OAuth, 'faraday_middleware/request/oauth'
|
5
|
+
autoload :OAuth2, 'faraday_middleware/request/oauth2'
|
6
|
+
autoload :EncodeJson, 'faraday_middleware/request/encode_json'
|
7
|
+
autoload :Mashify, 'faraday_middleware/response/mashify'
|
8
|
+
autoload :Rashify, 'faraday_middleware/response/rashify'
|
9
|
+
autoload :ParseJson, 'faraday_middleware/response/parse_json'
|
10
|
+
autoload :ParseXml, 'faraday_middleware/response/parse_xml'
|
11
|
+
autoload :ParseNokogiriXml, 'faraday_middleware/response/parse_nokogiri_xml'
|
12
|
+
autoload :ParseNokogiriHtml, 'faraday_middleware/response/parse_nokogiri_html'
|
13
|
+
autoload :ParseMarshal, 'faraday_middleware/response/parse_marshal'
|
14
|
+
autoload :ParseYaml, 'faraday_middleware/response/parse_yaml'
|
15
|
+
autoload :Caching, 'faraday_middleware/response/caching'
|
16
|
+
autoload :RackCompatible, 'faraday_middleware/rack_compatible'
|
17
|
+
autoload :FollowRedirects, 'faraday_middleware/response/follow_redirects'
|
18
|
+
autoload :Instrumentation, 'faraday_middleware/instrumentation'
|
18
19
|
|
19
20
|
if Faraday.respond_to? :register_middleware
|
20
21
|
Faraday.register_middleware :request,
|
@@ -29,6 +30,7 @@ module FaradayMiddleware
|
|
29
30
|
:json_fix => lambda { ParseJson::MimeTypeFix },
|
30
31
|
:xml => lambda { ParseXml },
|
31
32
|
:nokogiri_xml => lambda { ParseNokogiriXml },
|
33
|
+
:nokogiri_html => lambda { ParseNokogiriHtml },
|
32
34
|
:marshal => lambda { ParseMarshal },
|
33
35
|
:yaml => lambda { ParseYaml },
|
34
36
|
:caching => lambda { Caching },
|
@@ -6,10 +6,12 @@ Faraday::Request.class_eval do
|
|
6
6
|
end
|
7
7
|
|
8
8
|
Faraday::Response.class_eval do
|
9
|
-
autoload :Mashify,
|
10
|
-
autoload :Rashify,
|
11
|
-
autoload :ParseJson,
|
12
|
-
autoload :ParseXml,
|
13
|
-
autoload :
|
14
|
-
autoload :
|
9
|
+
autoload :Mashify, 'faraday_middleware/response/mashify'
|
10
|
+
autoload :Rashify, 'faraday_middleware/response/rashify'
|
11
|
+
autoload :ParseJson, 'faraday_middleware/response/parse_json'
|
12
|
+
autoload :ParseXml, 'faraday_middleware/response/parse_xml'
|
13
|
+
autoload :ParseNokogiriXml, 'faraday_middleware/response/parse_nokogiri_xml'
|
14
|
+
autoload :ParseNokogiriHtml, 'faraday_middleware/response/parse_nokogiri_html'
|
15
|
+
autoload :ParseMarshal, 'faraday_middleware/response/parse_marshal'
|
16
|
+
autoload :ParseYaml, 'faraday_middleware/response/parse_yaml'
|
15
17
|
end
|
@@ -0,0 +1,14 @@
|
|
1
|
+
require 'faraday_middleware/response_middleware'
|
2
|
+
|
3
|
+
module FaradayMiddleware
|
4
|
+
class ParseNokogiriHtml < ResponseMiddleware
|
5
|
+
dependency 'nokogiri'
|
6
|
+
|
7
|
+
define_parser { |body|
|
8
|
+
::Nokogiri::HTML(body, nil, "utf-8")
|
9
|
+
}
|
10
|
+
end
|
11
|
+
end
|
12
|
+
|
13
|
+
# deprecated alias
|
14
|
+
Faraday::Response::ParseNokogiriHtml = FaradayMiddleware::ParseNokogiriHtml
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: agiley-faraday_middleware
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.8.3
|
4
|
+
version: 0.8.3.1
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -10,11 +10,11 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2012-
|
13
|
+
date: 2012-03-04 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: faraday
|
17
|
-
requirement: &
|
17
|
+
requirement: &70295675858060 !ruby/object:Gem::Requirement
|
18
18
|
none: false
|
19
19
|
requirements:
|
20
20
|
- - ! '>='
|
@@ -25,10 +25,10 @@ dependencies:
|
|
25
25
|
version: '0.9'
|
26
26
|
type: :runtime
|
27
27
|
prerelease: false
|
28
|
-
version_requirements: *
|
28
|
+
version_requirements: *70295675858060
|
29
29
|
- !ruby/object:Gem::Dependency
|
30
30
|
name: multi_xml
|
31
|
-
requirement: &
|
31
|
+
requirement: &70295675857300 !ruby/object:Gem::Requirement
|
32
32
|
none: false
|
33
33
|
requirements:
|
34
34
|
- - ~>
|
@@ -36,10 +36,10 @@ dependencies:
|
|
36
36
|
version: '0.2'
|
37
37
|
type: :development
|
38
38
|
prerelease: false
|
39
|
-
version_requirements: *
|
39
|
+
version_requirements: *70295675857300
|
40
40
|
- !ruby/object:Gem::Dependency
|
41
41
|
name: nokogiri
|
42
|
-
requirement: &
|
42
|
+
requirement: &70295675856820 !ruby/object:Gem::Requirement
|
43
43
|
none: false
|
44
44
|
requirements:
|
45
45
|
- - ~>
|
@@ -47,10 +47,10 @@ dependencies:
|
|
47
47
|
version: 1.5.0
|
48
48
|
type: :development
|
49
49
|
prerelease: false
|
50
|
-
version_requirements: *
|
50
|
+
version_requirements: *70295675856820
|
51
51
|
- !ruby/object:Gem::Dependency
|
52
52
|
name: rake
|
53
|
-
requirement: &
|
53
|
+
requirement: &70295675856360 !ruby/object:Gem::Requirement
|
54
54
|
none: false
|
55
55
|
requirements:
|
56
56
|
- - ~>
|
@@ -58,10 +58,10 @@ dependencies:
|
|
58
58
|
version: '0.9'
|
59
59
|
type: :development
|
60
60
|
prerelease: false
|
61
|
-
version_requirements: *
|
61
|
+
version_requirements: *70295675856360
|
62
62
|
- !ruby/object:Gem::Dependency
|
63
63
|
name: hashie
|
64
|
-
requirement: &
|
64
|
+
requirement: &70295675855900 !ruby/object:Gem::Requirement
|
65
65
|
none: false
|
66
66
|
requirements:
|
67
67
|
- - ~>
|
@@ -69,10 +69,10 @@ dependencies:
|
|
69
69
|
version: '1.2'
|
70
70
|
type: :development
|
71
71
|
prerelease: false
|
72
|
-
version_requirements: *
|
72
|
+
version_requirements: *70295675855900
|
73
73
|
- !ruby/object:Gem::Dependency
|
74
74
|
name: rash
|
75
|
-
requirement: &
|
75
|
+
requirement: &70295675855440 !ruby/object:Gem::Requirement
|
76
76
|
none: false
|
77
77
|
requirements:
|
78
78
|
- - ~>
|
@@ -80,10 +80,10 @@ dependencies:
|
|
80
80
|
version: '0.3'
|
81
81
|
type: :development
|
82
82
|
prerelease: false
|
83
|
-
version_requirements: *
|
83
|
+
version_requirements: *70295675855440
|
84
84
|
- !ruby/object:Gem::Dependency
|
85
85
|
name: rspec
|
86
|
-
requirement: &
|
86
|
+
requirement: &70295675854940 !ruby/object:Gem::Requirement
|
87
87
|
none: false
|
88
88
|
requirements:
|
89
89
|
- - ~>
|
@@ -91,10 +91,10 @@ dependencies:
|
|
91
91
|
version: '2.6'
|
92
92
|
type: :development
|
93
93
|
prerelease: false
|
94
|
-
version_requirements: *
|
94
|
+
version_requirements: *70295675854940
|
95
95
|
- !ruby/object:Gem::Dependency
|
96
96
|
name: simple_oauth
|
97
|
-
requirement: &
|
97
|
+
requirement: &70295675854440 !ruby/object:Gem::Requirement
|
98
98
|
none: false
|
99
99
|
requirements:
|
100
100
|
- - ~>
|
@@ -102,10 +102,10 @@ dependencies:
|
|
102
102
|
version: '0.1'
|
103
103
|
type: :development
|
104
104
|
prerelease: false
|
105
|
-
version_requirements: *
|
105
|
+
version_requirements: *70295675854440
|
106
106
|
- !ruby/object:Gem::Dependency
|
107
107
|
name: rack-cache
|
108
|
-
requirement: &
|
108
|
+
requirement: &70295675853860 !ruby/object:Gem::Requirement
|
109
109
|
none: false
|
110
110
|
requirements:
|
111
111
|
- - ~>
|
@@ -113,7 +113,7 @@ dependencies:
|
|
113
113
|
version: '1.1'
|
114
114
|
type: :development
|
115
115
|
prerelease: false
|
116
|
-
version_requirements: *
|
116
|
+
version_requirements: *70295675853860
|
117
117
|
description: Various middleware for Faraday
|
118
118
|
email:
|
119
119
|
- sferik@gmail.com
|
@@ -145,6 +145,7 @@ files:
|
|
145
145
|
- lib/faraday_middleware/response/mashify.rb
|
146
146
|
- lib/faraday_middleware/response/parse_json.rb
|
147
147
|
- lib/faraday_middleware/response/parse_marshal.rb
|
148
|
+
- lib/faraday_middleware/response/parse_nokogiri_html.rb
|
148
149
|
- lib/faraday_middleware/response/parse_nokogiri_xml.rb
|
149
150
|
- lib/faraday_middleware/response/parse_xml.rb
|
150
151
|
- lib/faraday_middleware/response/parse_yaml.rb
|
@@ -183,7 +184,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
183
184
|
version: 1.3.6
|
184
185
|
requirements: []
|
185
186
|
rubyforge_project:
|
186
|
-
rubygems_version: 1.8.
|
187
|
+
rubygems_version: 1.8.17
|
187
188
|
signing_key:
|
188
189
|
specification_version: 3
|
189
190
|
summary: Various middleware for Faraday
|