Permalink
Browse files

more complete example

  • Loading branch information...
1 parent 788a26c commit a7d3576d23a2a820e5375fe6ba871a0157322bed @atmos committed Feb 10, 2010
Showing with 32 additions and 14 deletions.
  1. +1 −0 .gitignore
  2. +29 −12 README.md
  3. +2 −2 Rakefile
View
@@ -1 +1,2 @@
coverage
+pkg
View
@@ -1,7 +1,7 @@
-sinatra_gmail_auth
+sinatra_auth_gmail
==================
-A sinatra app the provides a gem that...
+A sinatra app that lets you authenticate users via gmail.
Developing
==========
@@ -14,15 +14,32 @@ Gemfile
gem "sinatra_auth_gmail"
# vim:ft=ruby
-Example
--------
- module Fooby
- class App < Sinatra::Base
- register Sinatra::Auth::Gmail
- get '/' do
- authorize!
- haml "%h2= 'Hello There, #{gmail_user.full_name}!'"
- end
- end
+Example config.ru
+-----------------
+ require 'rubygems'
+ require 'bundler'
+
+ Bundler.setup
+ Bundler.require
+
+ class MyFirstGmailApp < Sinatra::Base
+ use Rack::Session::Cookie
+ register Sinatra::Auth::Gmail
+
+ get '/' do
+ authorize!
+ haml "%h2= 'Hello There, #{gmail_user.full_name}!'"
end
end
+
+ run MyFirstGmailApp
+
+Executing
+---------
+ % bundle install
+ % bundle exec rackup
+
+Visiting
+--------
+ % open http://localhost:9292
+
View
@@ -30,7 +30,7 @@ spec = Gem::Specification.new do |s|
s.version = GEM_VERSION
s.platform = Gem::Platform::RUBY
s.has_rdoc = true
- s.extra_rdoc_files = ["LICENSE", 'TODO']
+ s.extra_rdoc_files = ["LICENSE"]
s.summary = SUMMARY
s.description = s.summary
s.author = AUTHOR
@@ -44,7 +44,7 @@ spec = Gem::Specification.new do |s|
end
s.require_path = 'lib'
- s.files = %w(LICENSE README.md Rakefile TODO) + Dir.glob("{lib}/**/*")
+ s.files = %w(LICENSE README.md Rakefile) + Dir.glob("{lib}/**/*")
end
Rake::GemPackageTask.new(spec) do |pkg|

0 comments on commit a7d3576

Please sign in to comment.