Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Sinatra adapter for Geoloqi
branch: master

This branch is 6 commits behind geoloqi:master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
lib/sinatra
spec
.gitignore
.travis.yml
Gemfile
README.markdown
Rakefile
sinatra-geoloqi.gemspec

README.markdown

Geoloqi plugin for Sinatra

Easy drop-in Sinatra plugin for Geoloqi. All you need to do is require it, configure the settings and you're ready to go with Geoloqi application development!

Installation

gem install sinatra-geoloqi

Usage

First, go to the Geoloqi Developers Site and create an application on the "Your Apps" page.

Then, you can use it like this. This is the standard way with classic mode:

require 'sinatra'
require 'sinatra/geoloqi'

set :geoloqi_client_id,     'YOUR_APP_ID_GOES_HERE'
set :geoloqi_client_secret, 'YOUR_APP_SECRET_GOES_HERE'
set :geoloqi_redirect_uri,  'http://127.0.0.1:4567'
set :session_secret,        'ENTER_RANDOM_TEXT_HERE'

before do
  require_geoloqi_login
end

get '/?' do
  username = geoloqi.get('account/username')['username']
  "You have successfully logged in as #{username}!"
end

For "classy mode", don't forget to register the plugin explicitly:

register Sinatra::Geoloqi

Found a bug?

Let us know! Send a pull request or a patch. Questions? Ask! We're here to help. File issues, we'll respond to them!

Authors

Something went wrong with that request. Please try again.