Commit 63fc5fc3 authored by Taku YASUI's avatar Taku YASUI

Imported Upstream version 0.4.7

parent 0eff7bf7
=== 0.4.7 2012-09-03
* Fix merging paths if the path is not empty
* Set a configurable timeout for all requests (Rick Olson)
* Fix nested hash params in Consumer#request (Ernie Miller)
=== 0.4.6 2012-04-21
* Fixed nested attributes in #normalize (Shaliko Usubov)
......
$LOAD_PATH << File.dirname(__FILE__) unless $LOAD_PATH.include?(File.dirname(__FILE__))
module OAuth
VERSION = "0.4.6"
VERSION = "0.4.7"
end
require 'oauth/oauth'
......
......@@ -317,6 +317,10 @@ module OAuth
else
http_object.verify_mode = OpenSSL::SSL::VERIFY_NONE
end
http_object.read_timeout = http_object.open_timeout = @options[:timeout] || 30
http_object.open_timeout = @options[:open_timeout] if @options[:open_timeout]
http_object
end
......@@ -330,7 +334,7 @@ module OAuth
# if the base site contains a path, add it now
uri = URI.parse(site)
path = uri.path + path if uri.path
path = uri.path + path if uri.path && uri.path != '/'
headers = arguments.first.is_a?(Hash) ? arguments.shift : {}
......@@ -352,9 +356,8 @@ module OAuth
end
if data.is_a?(Hash)
form_data = {}
data.each {|k,v| form_data[k.to_s] = v if !v.nil?}
request.set_form_data(form_data)
request.body = OAuth::Helper.normalize(data)
request.content_type = 'application/x-www-form-urlencoded'
elsif data
if data.respond_to?(:read)
request.body_stream = data
......
--- !ruby/object:Gem::Specification
name: oauth
version: !ruby/object:Gem::Version
version: 0.4.6
version: 0.4.7
prerelease:
platform: ruby
authors:
......@@ -16,11 +16,11 @@ authors:
autorequire:
bindir: bin
cert_chain: []
date: 2012-04-21 00:00:00.000000000 Z
date: 2012-09-04 00:00:00.000000000 Z
dependencies:
- !ruby/object:Gem::Dependency
name: rake
requirement: &70205509498980 !ruby/object:Gem::Requirement
requirement: !ruby/object:Gem::Requirement
none: false
requirements:
- - ! '>='
......@@ -28,10 +28,15 @@ dependencies:
version: '0'
type: :development
prerelease: false
version_requirements: *70205509498980
version_requirements: !ruby/object:Gem::Requirement
none: false
requirements:
- - ! '>='
- !ruby/object:Gem::Version
version: '0'
- !ruby/object:Gem::Dependency
name: jeweler
requirement: &70205509498480 !ruby/object:Gem::Requirement
requirement: !ruby/object:Gem::Requirement
none: false
requirements:
- - ! '>='
......@@ -39,10 +44,15 @@ dependencies:
version: '0'
type: :development
prerelease: false
version_requirements: *70205509498480
version_requirements: !ruby/object:Gem::Requirement
none: false
requirements:
- - ! '>='
- !ruby/object:Gem::Version
version: '0'
- !ruby/object:Gem::Dependency
name: actionpack
requirement: &70205509497980 !ruby/object:Gem::Requirement
requirement: !ruby/object:Gem::Requirement
none: false
requirements:
- - ! '>='
......@@ -50,10 +60,15 @@ dependencies:
version: 2.3.5
type: :development
prerelease: false
version_requirements: *70205509497980
version_requirements: !ruby/object:Gem::Requirement
none: false
requirements:
- - ! '>='
- !ruby/object:Gem::Version
version: 2.3.5
- !ruby/object:Gem::Dependency
name: rack
requirement: &70205509497480 !ruby/object:Gem::Requirement
requirement: !ruby/object:Gem::Requirement
none: false
requirements:
- - ! '>='
......@@ -61,10 +76,15 @@ dependencies:
version: 1.0.0
type: :development
prerelease: false
version_requirements: *70205509497480
version_requirements: !ruby/object:Gem::Requirement
none: false
requirements:
- - ! '>='
- !ruby/object:Gem::Version
version: 1.0.0
- !ruby/object:Gem::Dependency
name: mocha
requirement: &70205509496960 !ruby/object:Gem::Requirement
requirement: !ruby/object:Gem::Requirement
none: false
requirements:
- - ! '>='
......@@ -72,10 +92,15 @@ dependencies:
version: 0.9.8
type: :development
prerelease: false
version_requirements: *70205509496960
version_requirements: !ruby/object:Gem::Requirement
none: false
requirements:
- - ! '>='
- !ruby/object:Gem::Version
version: 0.9.8
- !ruby/object:Gem::Dependency
name: typhoeus
requirement: &70205509496480 !ruby/object:Gem::Requirement
requirement: !ruby/object:Gem::Requirement
none: false
requirements:
- - ! '>='
......@@ -83,10 +108,15 @@ dependencies:
version: 0.1.13
type: :development
prerelease: false
version_requirements: *70205509496480
version_requirements: !ruby/object:Gem::Requirement
none: false
requirements:
- - ! '>='
- !ruby/object:Gem::Version
version: 0.1.13
- !ruby/object:Gem::Dependency
name: em-http-request
requirement: &70205509496000 !ruby/object:Gem::Requirement
requirement: !ruby/object:Gem::Requirement
none: false
requirements:
- - ! '>='
......@@ -94,10 +124,15 @@ dependencies:
version: 0.2.10
type: :development
prerelease: false
version_requirements: *70205509496000
version_requirements: !ruby/object:Gem::Requirement
none: false
requirements:
- - ! '>='
- !ruby/object:Gem::Version
version: 0.2.10
- !ruby/object:Gem::Dependency
name: curb
requirement: &70205509495520 !ruby/object:Gem::Requirement
requirement: !ruby/object:Gem::Requirement
none: false
requirements:
- - ! '>='
......@@ -105,7 +140,12 @@ dependencies:
version: 0.6.6.0
type: :development
prerelease: false
version_requirements: *70205509495520
version_requirements: !ruby/object:Gem::Requirement
none: false
requirements:
- - ! '>='
- !ruby/object:Gem::Version
version: 0.6.6.0
description: OAuth Core Ruby implementation
email: oauth-ruby@googlegroups.com
executables:
......@@ -223,7 +263,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
version: '0'
requirements: []
rubyforge_project: oauth
rubygems_version: 1.8.16
rubygems_version: 1.8.23
signing_key:
specification_version: 3
summary: OAuth Core Ruby implementation
......
......@@ -5,11 +5,11 @@
Gem::Specification.new do |s|
s.name = "oauth"
s.version = "0.4.6"
s.version = "0.4.7"
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
s.authors = ["Pelle Braendgaard", "Blaine Cook", "Larry Halff", "Jesse Clark", "Jon Crosby", "Seth Fitzsimmons", "Matt Sanford", "Aaron Quint"]
s.date = "2012-04-21"
s.date = "2012-09-04"
s.description = "OAuth Core Ruby implementation"
s.email = "oauth-ruby@googlegroups.com"
s.executables = ["oauth"]
......@@ -109,7 +109,7 @@ Gem::Specification.new do |s|
]
s.require_paths = ["lib"]
s.rubyforge_project = "oauth"
s.rubygems_version = "1.8.16"
s.rubygems_version = "1.8.23"
s.summary = "OAuth Core Ruby implementation"
if s.respond_to? :specification_version then
......
......@@ -89,6 +89,27 @@ class ConsumerTest < Test::Unit::TestCase
@consumer.request(:get, '/people', nil, {})
end
def test_post_of_nested_params_maintains_nesting
@consumer=OAuth::Consumer.new(
"key",
"secret",
{
:site=>"http://twitter.com"
})
request = @consumer.create_signed_request(
:post,
'/people',
nil,
{},
{
:key => {
:subkey => 'value'
}
})
assert_equal 'key%5Bsubkey%5D=value', request.body
assert_equal request.content_type, 'application/x-www-form-urlencoded'
end
def test_override_paths
@consumer=OAuth::Consumer.new(
"key",
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment