mbleigh-twitter-auth 0.1.11 → 0.1.12
Sign up to get free protection for your applications and to get access to all the features.
data/README.markdown
CHANGED
@@ -76,10 +76,17 @@ TwitterAuth provides some default controller methods that may be overridden in y
|
|
76
76
|
* `authentication_succeeded(message=default)`: called when Twitter authorization has completed successfully. By default, simply redirects to the site root and sets the `flash[:notice]`.
|
77
77
|
* `access_denied`: what happens when the `login_required` before filter fails. By default it stores the current location to return to and redirects to the login process.
|
78
78
|
|
79
|
+
Tips and Tricks
|
80
|
+
---------------
|
81
|
+
|
82
|
+
* If you are getting an `OpenSSL::SSL:SSLError (certificate verify failed)` you may want to [see this ticket and comments](https://mbleigh.lighthouseapp.com/projects/27783-twitterauth/tickets/6-error-on-login#ticket-6-2).
|
83
|
+
|
79
84
|
Resources
|
80
85
|
---------
|
81
86
|
|
82
87
|
* **Bug Reports:** See the [Lighthouse Project](http://mbleigh.lighthouseapp.com/projects/27783-twitterauth) to report any problems you have using TwitterAuth.
|
88
|
+
* **Blog Post:** The [original blog post about TwitterAuth](http://intridea.com/2009/3/23/twitter-auth-for-near-instant-twitter-apps) has a tutorial as well to get you started.
|
89
|
+
* **GitHub Pages:** TwitterAuth has a [simple GitHub page](http://mbleigh.com/twitter-auth)
|
83
90
|
|
84
91
|
Copyright
|
85
92
|
---------
|
data/VERSION.yml
CHANGED
@@ -13,7 +13,7 @@ module TwitterAuth
|
|
13
13
|
end
|
14
14
|
|
15
15
|
def request(http_method, path, body=nil, *arguments)
|
16
|
-
path
|
16
|
+
path = append_extension_to(path)
|
17
17
|
|
18
18
|
response = TwitterAuth.net.start{ |http|
|
19
19
|
req = "Net::HTTP::#{http_method.to_s.capitalize}".constantize.new(path, *arguments)
|
@@ -1,6 +1,12 @@
|
|
1
1
|
module TwitterAuth
|
2
2
|
module Dispatcher
|
3
3
|
module Shared
|
4
|
+
def append_extension_to(path)
|
5
|
+
path, query_string = *(path.split("?"))
|
6
|
+
path << '.json' unless path.match(/\.(:?xml|json)\z/i)
|
7
|
+
"#{path}#{"?#{query_string}" if query_string}"
|
8
|
+
end
|
9
|
+
|
4
10
|
def handle_response(response)
|
5
11
|
case response
|
6
12
|
when Net::HTTPOK
|
@@ -0,0 +1,26 @@
|
|
1
|
+
require File.dirname(__FILE__) + '/../../spec_helper'
|
2
|
+
|
3
|
+
describe TwitterAuth::Dispatcher::Shared do
|
4
|
+
include TwitterAuth::Dispatcher::Shared
|
5
|
+
|
6
|
+
describe '#append_extension_to' do
|
7
|
+
it 'should leave extensions alone if they exist' do
|
8
|
+
append_extension_to('/fake.json').should == '/fake.json'
|
9
|
+
append_extension_to('/fake.xml').should == '/fake.xml'
|
10
|
+
end
|
11
|
+
|
12
|
+
it 'should append .json if no extension is provided' do
|
13
|
+
append_extension_to('/fake').should == '/fake.json'
|
14
|
+
append_extension_to('/verify/fake').should == '/verify/fake.json'
|
15
|
+
end
|
16
|
+
|
17
|
+
it 'should leave extensions alone even with query strings' do
|
18
|
+
append_extension_to('/fake.json?since_id=123').should == '/fake.json?since_id=123'
|
19
|
+
append_extension_to('/fake.xml?since_id=123').should == '/fake.xml?since_id=123'
|
20
|
+
end
|
21
|
+
|
22
|
+
it 'should add an extension even with query strings' do
|
23
|
+
append_extension_to('/fake?since_id=123').should == '/fake.json?since_id=123'
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mbleigh-twitter-auth
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.12
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Michael Bleigh
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2009-03-
|
12
|
+
date: 2009-03-27 00:00:00 -07:00
|
13
13
|
default_executable:
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
@@ -62,6 +62,7 @@ files:
|
|
62
62
|
- spec/controllers
|
63
63
|
- spec/controllers/controller_extensions_spec.rb
|
64
64
|
- spec/controllers/sessions_controller_spec.rb
|
65
|
+
- spec/debug.log
|
65
66
|
- spec/fixtures
|
66
67
|
- spec/fixtures/config
|
67
68
|
- spec/fixtures/config/twitter_auth.yml
|
@@ -81,6 +82,7 @@ files:
|
|
81
82
|
- spec/twitter_auth/dispatcher
|
82
83
|
- spec/twitter_auth/dispatcher/basic_spec.rb
|
83
84
|
- spec/twitter_auth/dispatcher/oauth_spec.rb
|
85
|
+
- spec/twitter_auth/dispatcher/shared_spec.rb
|
84
86
|
- spec/twitter_auth_spec.rb
|
85
87
|
- config/routes.rb
|
86
88
|
- app/controllers
|