assistly 0.2.3 → 0.2.4

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,4 +1,4 @@
1
- Copyright (c) 2011 Chris Warren
1
+ Copyright (c) 2011 Chris Warren / Zencoder, Inc
2
2
 
3
3
  Permission is hereby granted, free of charge, to any person obtaining
4
4
  a copy of this software and associated documentation files (the
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.
@@ -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.0')
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')
@@ -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
@@ -1,4 +1,4 @@
1
1
  module Assistly
2
2
  # The version of the gem
3
- VERSION = '0.2.3'.freeze unless defined?(::Assistly::VERSION)
3
+ VERSION = '0.2.4'.freeze unless defined?(::Assistly::VERSION)
4
4
  end
@@ -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: 17
4
+ hash: 31
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 2
9
- - 3
10
- version: 0.2.3
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-04-18 00:00:00 Z
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: 7
196
+ hash: 5
196
197
  segments:
197
198
  - 0
198
199
  - 6
199
- - 0
200
- version: 0.6.0
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.7.2
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: