assistly 0.2.3 → 0.2.4
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/LICENSE.mkd +1 -1
- data/README.mkd +1 -1
- data/assistly.gemspec +1 -1
- data/lib/assistly/connection.rb +1 -1
- data/lib/assistly/version.rb +1 -1
- data/lib/faraday/request/oauth.rb +23 -0
- metadata +11 -9
data/LICENSE.mkd
CHANGED
data/README.mkd
CHANGED
@@ -238,5 +238,5 @@ Submitting a Pull Request
|
|
238
238
|
|
239
239
|
Copyright
|
240
240
|
---------
|
241
|
-
Copyright (c) 2011 Chris Warren/[Zencoder](http://zencoder.com)
|
241
|
+
Copyright (c) 2011 Chris Warren / [Zencoder, Inc](http://zencoder.com)
|
242
242
|
See [LICENSE](https://github.com/zencoder/assistly/blob/master/LICENSE.mkd) for details.
|
data/assistly.gemspec
CHANGED
@@ -13,7 +13,7 @@ Gem::Specification.new do |s|
|
|
13
13
|
s.add_development_dependency('yard', '~> 0.6')
|
14
14
|
s.add_development_dependency('ZenTest', '~> 4.5')
|
15
15
|
s.add_runtime_dependency('hashie', '~> 1.0.0')
|
16
|
-
s.add_runtime_dependency('faraday', '~> 0.6.
|
16
|
+
s.add_runtime_dependency('faraday', '~> 0.6.1')
|
17
17
|
s.add_runtime_dependency('faraday_middleware', '~> 0.6.3')
|
18
18
|
s.add_runtime_dependency('jruby-openssl', '~> 0.7.2') if RUBY_PLATFORM == 'java'
|
19
19
|
s.add_runtime_dependency('multi_json', '~> 0.0.5')
|
data/lib/assistly/connection.rb
CHANGED
@@ -17,8 +17,8 @@ module Assistly
|
|
17
17
|
}
|
18
18
|
|
19
19
|
Faraday.new(options) do |builder|
|
20
|
-
builder.use Faraday::Request::MultipartWithFile
|
21
20
|
builder.use Faraday::Request::OAuth, authentication if authenticated?
|
21
|
+
builder.use Faraday::Request::MultipartWithFile
|
22
22
|
builder.use Faraday::Request::Multipart
|
23
23
|
builder.use Faraday::Request::UrlEncoded
|
24
24
|
builder.use Faraday::Response::RaiseHttp4xx
|
data/lib/assistly/version.rb
CHANGED
@@ -0,0 +1,23 @@
|
|
1
|
+
require 'faraday'
|
2
|
+
|
3
|
+
module Faraday
|
4
|
+
class Request::OAuth < Faraday::Middleware
|
5
|
+
dependency 'simple_oauth'
|
6
|
+
|
7
|
+
def call(env)
|
8
|
+
params = env[:body] || {}
|
9
|
+
|
10
|
+
signature_params = params.reject{ |k,v| v.respond_to?(:content_type) || (env[:method] == :put) }
|
11
|
+
|
12
|
+
header = SimpleOAuth::Header.new(env[:method], env[:url], signature_params, @options)
|
13
|
+
|
14
|
+
env[:request_headers]['Authorization'] = header.to_s
|
15
|
+
|
16
|
+
@app.call(env)
|
17
|
+
end
|
18
|
+
|
19
|
+
def initialize(app, options)
|
20
|
+
@app, @options = app, options
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: assistly
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 31
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 2
|
9
|
-
-
|
10
|
-
version: 0.2.
|
9
|
+
- 4
|
10
|
+
version: 0.2.4
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Chris Warren
|
@@ -15,7 +15,8 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2011-
|
18
|
+
date: 2011-07-15 00:00:00 -07:00
|
19
|
+
default_executable:
|
19
20
|
dependencies:
|
20
21
|
- !ruby/object:Gem::Dependency
|
21
22
|
name: json
|
@@ -192,12 +193,12 @@ dependencies:
|
|
192
193
|
requirements:
|
193
194
|
- - ~>
|
194
195
|
- !ruby/object:Gem::Version
|
195
|
-
hash:
|
196
|
+
hash: 5
|
196
197
|
segments:
|
197
198
|
- 0
|
198
199
|
- 6
|
199
|
-
-
|
200
|
-
version: 0.6.
|
200
|
+
- 1
|
201
|
+
version: 0.6.1
|
201
202
|
type: :runtime
|
202
203
|
version_requirements: *id012
|
203
204
|
- !ruby/object:Gem::Dependency
|
@@ -333,6 +334,7 @@ files:
|
|
333
334
|
- lib/assistly/request.rb
|
334
335
|
- lib/assistly/version.rb
|
335
336
|
- lib/faraday/request/multipart_with_file.rb
|
337
|
+
- lib/faraday/request/oauth.rb
|
336
338
|
- lib/faraday/response/raise_http_4xx.rb
|
337
339
|
- lib/faraday/response/raise_http_5xx.rb
|
338
340
|
- spec/assistly/api_spec.rb
|
@@ -378,6 +380,7 @@ files:
|
|
378
380
|
- spec/fixtures/user.json
|
379
381
|
- spec/fixtures/users.json
|
380
382
|
- spec/helper.rb
|
383
|
+
has_rdoc: true
|
381
384
|
homepage: https://github.com/zencoder/assistly
|
382
385
|
licenses: []
|
383
386
|
|
@@ -415,7 +418,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
415
418
|
requirements: []
|
416
419
|
|
417
420
|
rubyforge_project: assistly
|
418
|
-
rubygems_version: 1.
|
421
|
+
rubygems_version: 1.4.2
|
419
422
|
signing_key:
|
420
423
|
specification_version: 3
|
421
424
|
summary: Ruby wrapper for the Assistly API, based on the Twitter gem
|
@@ -463,4 +466,3 @@ test_files:
|
|
463
466
|
- spec/fixtures/user.json
|
464
467
|
- spec/fixtures/users.json
|
465
468
|
- spec/helper.rb
|
466
|
-
has_rdoc:
|