faraday_middleware 0.1.1 → 0.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/.gitignore +24 -24
- data/CHANGELOG.md +9 -9
- data/Gemfile.lock +1 -4
- data/Rakefile +14 -14
- data/faraday_middleware.gemspec +0 -1
- data/lib/faraday_middleware/version.rb +1 -1
- metadata +4 -23
- data/lib/faraday/oauth.rb +0 -22
- data/test/oauth_test.rb +0 -20
data/.gitignore
CHANGED
@@ -1,24 +1,24 @@
|
|
1
|
-
## MAC OS
|
2
|
-
.DS_Store
|
3
|
-
|
4
|
-
## TEXTMATE
|
5
|
-
*.tmproj
|
6
|
-
tmtags
|
7
|
-
|
8
|
-
## EMACS
|
9
|
-
*~
|
10
|
-
\#*
|
11
|
-
.\#*
|
12
|
-
|
13
|
-
## VIM
|
14
|
-
*.swp
|
15
|
-
|
16
|
-
## PROJECT::GENERAL
|
17
|
-
coverage
|
18
|
-
rdoc
|
19
|
-
pkg
|
20
|
-
*.gem
|
21
|
-
.yardopts
|
22
|
-
.yardoc
|
23
|
-
|
24
|
-
## PROJECT::SPECIFIC
|
1
|
+
## MAC OS
|
2
|
+
.DS_Store
|
3
|
+
|
4
|
+
## TEXTMATE
|
5
|
+
*.tmproj
|
6
|
+
tmtags
|
7
|
+
|
8
|
+
## EMACS
|
9
|
+
*~
|
10
|
+
\#*
|
11
|
+
.\#*
|
12
|
+
|
13
|
+
## VIM
|
14
|
+
*.swp
|
15
|
+
|
16
|
+
## PROJECT::GENERAL
|
17
|
+
coverage
|
18
|
+
rdoc
|
19
|
+
pkg
|
20
|
+
*.gem
|
21
|
+
.yardopts
|
22
|
+
.yardoc
|
23
|
+
|
24
|
+
## PROJECT::SPECIFIC
|
data/CHANGELOG.md
CHANGED
@@ -1,10 +1,10 @@
|
|
1
|
-
# Changelog
|
2
|
-
|
3
|
-
### 0.0.2 September 25, 2010
|
4
|
-
|
5
|
-
* Mashify now handles arrays of non-hashes
|
6
|
-
|
7
|
-
### 0.0.1 June 27, 2010
|
8
|
-
|
9
|
-
* MultiJSON
|
1
|
+
# Changelog
|
2
|
+
|
3
|
+
### 0.0.2 September 25, 2010
|
4
|
+
|
5
|
+
* Mashify now handles arrays of non-hashes
|
6
|
+
|
7
|
+
### 0.0.1 June 27, 2010
|
8
|
+
|
9
|
+
* MultiJSON
|
10
10
|
* Mashify
|
data/Gemfile.lock
CHANGED
@@ -1,13 +1,12 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
faraday_middleware (0.1.
|
4
|
+
faraday_middleware (0.1.2)
|
5
5
|
faraday (~> 0.4.5)
|
6
6
|
hashie (~> 0.4.0)
|
7
7
|
multi_json (~> 0.0.4)
|
8
8
|
multi_xml (~> 0.0.1)
|
9
9
|
oauth2 (~> 0.0.13)
|
10
|
-
roauth (~> 0.0.3)
|
11
10
|
|
12
11
|
GEM
|
13
12
|
remote: http://rubygems.org/
|
@@ -25,7 +24,6 @@ GEM
|
|
25
24
|
multi_json (>= 0.0.4)
|
26
25
|
rack (1.2.1)
|
27
26
|
rake (0.8.7)
|
28
|
-
roauth (0.0.3)
|
29
27
|
shoulda (2.11.3)
|
30
28
|
|
31
29
|
PLATFORMS
|
@@ -40,5 +38,4 @@ DEPENDENCIES
|
|
40
38
|
multi_xml (~> 0.0.1)
|
41
39
|
oauth2 (~> 0.0.13)
|
42
40
|
rake (~> 0.8.7)
|
43
|
-
roauth (~> 0.0.3)
|
44
41
|
shoulda (~> 2.11.3)
|
data/Rakefile
CHANGED
@@ -1,14 +1,14 @@
|
|
1
|
-
$LOAD_PATH.unshift File.expand_path("../lib", __FILE__)
|
2
|
-
require 'rake'
|
3
|
-
require 'rake/testtask'
|
4
|
-
require 'bundler'
|
5
|
-
|
6
|
-
Bundler::GemHelper.install_tasks
|
7
|
-
|
8
|
-
Rake::TestTask.new(:test) do |test|
|
9
|
-
test.ruby_opts = ["-rubygems"] if defined? Gem
|
10
|
-
test.libs << "lib" << "test"
|
11
|
-
test.pattern = "test/**/*_test.rb"
|
12
|
-
end
|
13
|
-
|
14
|
-
task :default => :test
|
1
|
+
$LOAD_PATH.unshift File.expand_path("../lib", __FILE__)
|
2
|
+
require 'rake'
|
3
|
+
require 'rake/testtask'
|
4
|
+
require 'bundler'
|
5
|
+
|
6
|
+
Bundler::GemHelper.install_tasks
|
7
|
+
|
8
|
+
Rake::TestTask.new(:test) do |test|
|
9
|
+
test.ruby_opts = ["-rubygems"] if defined? Gem
|
10
|
+
test.libs << "lib" << "test"
|
11
|
+
test.pattern = "test/**/*_test.rb"
|
12
|
+
end
|
13
|
+
|
14
|
+
task :default => :test
|
data/faraday_middleware.gemspec
CHANGED
@@ -10,7 +10,6 @@ Gem::Specification.new do |s|
|
|
10
10
|
s.add_runtime_dependency('multi_json', ['~> 0.0.4'])
|
11
11
|
s.add_runtime_dependency('multi_xml', ['~> 0.0.1'])
|
12
12
|
s.add_runtime_dependency('oauth2', ['~> 0.0.13'])
|
13
|
-
s.add_runtime_dependency('roauth', ['~> 0.0.3'])
|
14
13
|
s.authors = ["Wynn Netherland"]
|
15
14
|
s.description = %q{Various middleware for Faraday}
|
16
15
|
s.email = ['wynn.netherland@gmail.com']
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: faraday_middleware
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 31
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 1
|
9
|
-
-
|
10
|
-
version: 0.1.
|
9
|
+
- 2
|
10
|
+
version: 0.1.2
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Wynn Netherland
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2010-10-
|
18
|
+
date: 2010-10-12 00:00:00 -07:00
|
19
19
|
default_executable:
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|
@@ -162,22 +162,6 @@ dependencies:
|
|
162
162
|
version: 0.0.13
|
163
163
|
type: :runtime
|
164
164
|
version_requirements: *id009
|
165
|
-
- !ruby/object:Gem::Dependency
|
166
|
-
name: roauth
|
167
|
-
prerelease: false
|
168
|
-
requirement: &id010 !ruby/object:Gem::Requirement
|
169
|
-
none: false
|
170
|
-
requirements:
|
171
|
-
- - ~>
|
172
|
-
- !ruby/object:Gem::Version
|
173
|
-
hash: 25
|
174
|
-
segments:
|
175
|
-
- 0
|
176
|
-
- 0
|
177
|
-
- 3
|
178
|
-
version: 0.0.3
|
179
|
-
type: :runtime
|
180
|
-
version_requirements: *id010
|
181
165
|
description: Various middleware for Faraday
|
182
166
|
email:
|
183
167
|
- wynn.netherland@gmail.com
|
@@ -196,7 +180,6 @@ files:
|
|
196
180
|
- Rakefile
|
197
181
|
- faraday_middleware.gemspec
|
198
182
|
- lib/faraday/mashify.rb
|
199
|
-
- lib/faraday/oauth.rb
|
200
183
|
- lib/faraday/oauth2.rb
|
201
184
|
- lib/faraday/parse_json.rb
|
202
185
|
- lib/faraday/parse_xml.rb
|
@@ -205,7 +188,6 @@ files:
|
|
205
188
|
- test/helper.rb
|
206
189
|
- test/mashify_test.rb
|
207
190
|
- test/oauth2_test.rb
|
208
|
-
- test/oauth_test.rb
|
209
191
|
- test/parse_json_test.rb
|
210
192
|
- test/parse_xml_test.rb
|
211
193
|
has_rdoc: true
|
@@ -248,6 +230,5 @@ test_files:
|
|
248
230
|
- test/helper.rb
|
249
231
|
- test/mashify_test.rb
|
250
232
|
- test/oauth2_test.rb
|
251
|
-
- test/oauth_test.rb
|
252
233
|
- test/parse_json_test.rb
|
253
234
|
- test/parse_xml_test.rb
|
data/lib/faraday/oauth.rb
DELETED
@@ -1,22 +0,0 @@
|
|
1
|
-
require 'roauth'
|
2
|
-
|
3
|
-
module Faraday
|
4
|
-
class Request::OAuth < Faraday::Middleware
|
5
|
-
def initialize(app, *args)
|
6
|
-
@app = app
|
7
|
-
@oauth_params = {
|
8
|
-
:consumer_secret => args.shift,
|
9
|
-
:consumer_key => args.shift,
|
10
|
-
:access_key => args.shift,
|
11
|
-
:access_secret => args.shift
|
12
|
-
}
|
13
|
-
|
14
|
-
end
|
15
|
-
|
16
|
-
def call(env)
|
17
|
-
params = env[:url].query_values || {}
|
18
|
-
env[:request_headers].merge!('Authorization' => ROAuth.header(@oauth_params, env[:url], params))
|
19
|
-
@app.call env
|
20
|
-
end
|
21
|
-
end
|
22
|
-
end
|
data/test/oauth_test.rb
DELETED
@@ -1,20 +0,0 @@
|
|
1
|
-
require 'helper'
|
2
|
-
|
3
|
-
class OAuthTest < Test::Unit::TestCase
|
4
|
-
context 'when used' do
|
5
|
-
setup do
|
6
|
-
@stubs = Faraday::Adapter::Test::Stubs.new
|
7
|
-
@stubs.get('/me') { [200, {}, 'pengwynn'] }
|
8
|
-
|
9
|
-
end
|
10
|
-
|
11
|
-
should 'add the access token to the request' do
|
12
|
-
do_you = Faraday::Connection.new do |builder|
|
13
|
-
builder.use Faraday::Request::OAuth, 'OU812', 'vh5150', '8675309', '8008135'
|
14
|
-
builder.adapter :test, @stubs
|
15
|
-
end
|
16
|
-
resp = do_you.get("/me")
|
17
|
-
|
18
|
-
end
|
19
|
-
end
|
20
|
-
end
|