Skip to content

Commit

Permalink
Update simple_oauth dependency to ~> 0.3.0
Browse files Browse the repository at this point in the history
  • Loading branch information
sferik committed Oct 9, 2014
1 parent 5c57042 commit 1d55768
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 11 deletions.
17 changes: 9 additions & 8 deletions lib/twitter/client.rb
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,11 @@ def user_agent
# @return [Hash]
def credentials
{
:consumer_key => consumer_key,
:consumer_secret => consumer_secret,
:token => access_token,
:token_secret => access_token_secret,
:consumer_key => consumer_key,
:consumer_secret => consumer_secret,
:token => access_token,
:token_secret => access_token_secret,
:ignore_extra_keys => true,
}
end

Expand All @@ -54,14 +55,14 @@ def credentials?
private

# Ensures that all credentials set during configuration are of a
# valid type. Valid types are String and Symbol.
# valid type. Valid types are String and Boolean.
#
# @raise [Twitter::Error::ConfigurationError] Error is raised when
# supplied twitter credentials are not a String or Symbol.
# supplied twitter credentials are not a String or Boolean.
def validate_credential_type!
credentials.each do |credential, value|
next if value.nil?
fail(Twitter::Error::ConfigurationError.new("Invalid #{credential} specified: #{value.inspect} must be a string or symbol.")) unless value.is_a?(String) || value.is_a?(Symbol)
next if value.nil? || value == true || value == false || value.is_a?(String)
fail(Twitter::Error::ConfigurationError.new("Invalid #{credential} specified: #{value.inspect} must be a string."))
end
end

Expand Down
4 changes: 2 additions & 2 deletions spec/twitter/rest/client_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@
end
it 'submits the correct auth header when no media is present' do
# We use static values for nounce and timestamp to get a stable signature
secret = {:consumer_key => 'CK', :consumer_secret => 'CS', :token => 'OT', :token_secret => 'OS', :nonce => 'b6ebe4c2a11af493f8a2290fe1296965', :timestamp => '1370968658'}
secret = {:consumer_key => 'CK', :consumer_secret => 'CS', :token => 'OT', :token_secret => 'OS', :nonce => 'b6ebe4c2a11af493f8a2290fe1296965', :timestamp => '1370968658', :ignore_extra_keys => true}
headers = {:authorization => /oauth_signature="FbthwmgGq02iQw%2FuXGEWaL6V6eM%3D"/, :content_type => 'application/json; charset=utf-8'}

allow(@client).to receive(:credentials).and_return(secret)
Expand All @@ -184,7 +184,7 @@
end
it 'submits the correct auth header when media is present' do
# We use static values for nounce and timestamp to get a stable signature
secret = {:consumer_key => 'CK', :consumer_secret => 'CS', :token => 'OT', :token_secret => 'OS', :nonce => 'e08201ad0dab4897c99445056feefd95', :timestamp => '1370967652'}
secret = {:consumer_key => 'CK', :consumer_secret => 'CS', :token => 'OT', :token_secret => 'OS', :nonce => 'e08201ad0dab4897c99445056feefd95', :timestamp => '1370967652', :ignore_extra_keys => true}
headers = {:authorization => /oauth_signature="9ziouUPwZT9IWWRbJL8r0BerKYA%3D"/, :content_type => 'application/json; charset=utf-8'}

allow(@client).to receive(:credentials).and_return(secret)
Expand Down
2 changes: 1 addition & 1 deletion twitter.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Gem::Specification.new do |spec|
spec.add_dependency 'json', '~> 1.8'
spec.add_dependency 'memoizable', '~> 0.4.0'
spec.add_dependency 'naught', '~> 1.0'
spec.add_dependency 'simple_oauth', '~> 0.2.0'
spec.add_dependency 'simple_oauth', '~> 0.3.0'
spec.add_development_dependency 'bundler', '~> 1.0'
spec.authors = ['Erik Michaels-Ober', 'John Nunemaker', 'Wynn Netherland', 'Steve Richert', 'Steve Agalloco']
spec.description = 'A Ruby interface to the Twitter API.'
Expand Down

0 comments on commit 1d55768

Please sign in to comment.