Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

require OAuth2 v0.4.1 gem #1

Merged
merged 3 commits into from

2 participants

@wehal3001

this pull request fixes a problem described over at Stackoverflow where OAuth2 gem complains about missing method web_server:

NoMethodError at /
undefined method `web_server' for #<OAuth2::Client:0x16168bc>
@mh mh merged commit 2371d8c into mh:master
@mh
Owner
mh commented

thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Jul 22, 2012
  1. require OAuth2 v0.4.1 gem

    wehal3001 authored
Commits on Jul 23, 2012
  1. remove a space in URL

    wehal3001 authored
This page is out of date. Refresh to see the latest.
Showing with 7 additions and 5 deletions.
  1. +4 −3 README.rdoc
  2. +3 −2 main.rb
View
7 README.rdoc
@@ -1,10 +1,11 @@
== foursquare APIv2 Sinatra Example
-This shows how easy it is to use Foursquare APIv2 via the OAuth2 gem.
+This shows how easy it is to use Foursquare APIv2 via the OAuth2 gem (requires v0.4.1).
== code
require 'rubygems'
require 'sinatra'
+ gem 'oauth2', '=0.4.1'
require 'oauth2'
require 'json'
require 'net/https'
@@ -16,7 +17,7 @@ This shows how easy it is to use Foursquare APIv2 via the OAuth2 gem.
def client
OAuth2::Client.new(CLIENT_ID, CLIENT_SECRET,
- :site => ' http://foursquare.com/v2/',
+ :site => 'http://foursquare.com/v2/',
:request_token_path => "/oauth2/request_token",
:access_token_path => "/oauth2/access_token",
:authorize_path => "/oauth2/authenticate?response_type=code",
@@ -53,4 +54,4 @@ This shows how easy it is to use Foursquare APIv2 via the OAuth2 gem.
get '/' do
redirect client.web_server.authorize_url(:redirect_uri => redirect_uri)
- end
+ end
View
5 main.rb
@@ -1,5 +1,6 @@
require 'rubygems'
require 'sinatra'
+gem 'oauth2', '=0.4.1'
require 'oauth2'
require 'json'
require 'net/https'
@@ -11,7 +12,7 @@
def client
OAuth2::Client.new(CLIENT_ID, CLIENT_SECRET,
- :site => ' http://foursquare.com/v2/',
+ :site => 'http://foursquare.com/v2/',
:request_token_path => "/oauth2/request_token",
:access_token_path => "/oauth2/access_token",
:authorize_path => "/oauth2/authenticate?response_type=code",
@@ -48,4 +49,4 @@ def redirect_uri()
get '/' do
redirect client.web_server.authorize_url(:redirect_uri => redirect_uri)
-end
+end
Something went wrong with that request. Please try again.