mirror of
https://github.com/omniauth/omniauth.git
synced 2022-11-09 12:31:49 -05:00
Adding documentation and release tasks to Rakefile
This commit is contained in:
parent
8e15f5572d
commit
a6e1de9ca1
4 changed files with 101 additions and 52 deletions
2
.gitignore
vendored
2
.gitignore
vendored
|
@ -28,5 +28,7 @@ oa-live
|
||||||
*.gem
|
*.gem
|
||||||
.bundle
|
.bundle
|
||||||
.project
|
.project
|
||||||
|
.yardoc
|
||||||
|
doc
|
||||||
|
|
||||||
Gemfile.lock
|
Gemfile.lock
|
||||||
|
|
51
Rakefile
51
Rakefile
|
@ -1,8 +1,14 @@
|
||||||
require 'rubygems'
|
require 'rubygems'
|
||||||
require 'rake'
|
require 'rake'
|
||||||
require 'term/ansicolor'
|
|
||||||
|
|
||||||
include Term::ANSIColor
|
begin
|
||||||
|
require 'term/ansicolor'
|
||||||
|
include Term::ANSIColor
|
||||||
|
rescue LoadError
|
||||||
|
def cyan; '' end
|
||||||
|
def blue; '' end
|
||||||
|
def clear; '' end
|
||||||
|
end
|
||||||
|
|
||||||
OMNIAUTH_GEMS = %w(oa-basic oa-core oa-oauth oa-openid oa-enterprise omniauth)
|
OMNIAUTH_GEMS = %w(oa-basic oa-core oa-oauth oa-openid oa-enterprise omniauth)
|
||||||
|
|
||||||
|
@ -60,6 +66,15 @@ namespace :dependencies do
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
task :release => ['release:tag', 'gems:publish', 'doc:pages:publish']
|
||||||
|
|
||||||
|
namespace :release do
|
||||||
|
task :tag do
|
||||||
|
system("git tag v#{version}")
|
||||||
|
system('git push origin --tags')
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
namespace :gems do
|
namespace :gems do
|
||||||
|
|
||||||
desc 'Build all gems'
|
desc 'Build all gems'
|
||||||
|
@ -70,7 +85,7 @@ namespace :gems do
|
||||||
end
|
end
|
||||||
|
|
||||||
desc 'Push all gems to Gemcutter'
|
desc 'Push all gems to Gemcutter'
|
||||||
task :release do
|
task :push do
|
||||||
each_gem('is releasing to Gemcutter...') do
|
each_gem('is releasing to Gemcutter...') do
|
||||||
system('rake gem:publish')
|
system('rake gem:publish')
|
||||||
end
|
end
|
||||||
|
@ -119,3 +134,33 @@ namespace :version do
|
||||||
end
|
end
|
||||||
|
|
||||||
task :default => :spec
|
task :default => :spec
|
||||||
|
|
||||||
|
begin
|
||||||
|
require 'yard'
|
||||||
|
YARD::Rake::YardocTask.new(:doc) do |t|
|
||||||
|
t.name = 'doc'
|
||||||
|
t.files = OMNIAUTH_GEMS.inject([]){|a,g| a = a + ["#{g}/lib/**/*.rb"]; a} + ['README.markdown']
|
||||||
|
t.options = ["-o", "../omniauth.doc"]
|
||||||
|
end
|
||||||
|
|
||||||
|
namespace :doc do
|
||||||
|
YARD::Rake::YardocTask.new(:pages) do |t|
|
||||||
|
t.files = OMNIAUTH_GEMS.inject([]){|a,g| a = a + ["#{g}/lib/**/*.rb"]; a} + ['README.markdown']
|
||||||
|
t.options = ["-o", "../omniauth.doc"]
|
||||||
|
end
|
||||||
|
|
||||||
|
namespace :pages do
|
||||||
|
desc 'Generate and publish YARD docs to GitHub pages.'
|
||||||
|
task :publish => ['doc:pages'] do
|
||||||
|
Dir.chdir(File.dirname(__FILE__) + '/../omniauth.doc') do
|
||||||
|
system("git add .")
|
||||||
|
system("git add -u")
|
||||||
|
system("git commit -m 'Generating docs for version #{version}.'")
|
||||||
|
system("git push origin gh-pages")
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
rescue LoadError
|
||||||
|
puts "You need to install YARD."
|
||||||
|
end
|
|
@ -1,49 +0,0 @@
|
||||||
= OmniAuth::OpenID
|
|
||||||
|
|
||||||
OpenID strategies for the OmniAuth gem.
|
|
||||||
|
|
||||||
== Installation
|
|
||||||
|
|
||||||
To get just OpenID functionality:
|
|
||||||
|
|
||||||
gem install oa-openid
|
|
||||||
|
|
||||||
For the full auth suite:
|
|
||||||
|
|
||||||
gem install omniauth
|
|
||||||
|
|
||||||
== Stand-Alone Example
|
|
||||||
|
|
||||||
Use the strategy as a middleware in your application:
|
|
||||||
|
|
||||||
require 'omniauth/openid'
|
|
||||||
require 'openid/store/filesystem'
|
|
||||||
|
|
||||||
use OmniAuth::Strategies::OpenID, OpenID::Store::Filesystem.new('/tmp')
|
|
||||||
|
|
||||||
Then simply direct users to '/auth/open_id' to prompt them for their OpenID identifier. You may also pre-set the identifier by passing an <tt>identifier</tt> parameter to the URL (Example: <tt>/auth/open_id?openid_url=yahoo.com</tt>).
|
|
||||||
|
|
||||||
A list of all OpenID stores is available at http://github.com/openid/ruby-openid/tree/master/lib/openid/store/
|
|
||||||
|
|
||||||
== OmniAuth Builder
|
|
||||||
|
|
||||||
If OpenID is one of several authentication strategies, use the OmniAuth Builder:
|
|
||||||
|
|
||||||
require 'omniauth/openid'
|
|
||||||
require 'omniauth/basic' # for Campfire
|
|
||||||
require 'openid/store/filesystem'
|
|
||||||
|
|
||||||
use OmniAuth::Builder do
|
|
||||||
provider :open_id, OpenID::Store::Filesystem.new('/tmp')
|
|
||||||
provider :campfire
|
|
||||||
end
|
|
||||||
|
|
||||||
== Configured Identifiers
|
|
||||||
|
|
||||||
You may pre-configure an OpenID identifier. For example, to use Google's main OpenID endpoint:
|
|
||||||
|
|
||||||
use OmniAuth::Builder do
|
|
||||||
provider :openid, nil, :name => 'google', :identifier => 'https://www.google.com/accounts/o8/id'
|
|
||||||
end
|
|
||||||
|
|
||||||
Note the use of nil, which will trigger ruby-openid's default Memory Store.
|
|
|
@ -1,6 +1,57 @@
|
||||||
require 'omniauth/core'
|
require 'omniauth/core'
|
||||||
|
|
||||||
module OmniAuth
|
module OmniAuth
|
||||||
|
# OmniAuth::OpenID provides strategies for authenticating to providers
|
||||||
|
# using the OpenID standard.
|
||||||
|
#
|
||||||
|
# == Installation
|
||||||
|
#
|
||||||
|
# To get just OpenID functionality:
|
||||||
|
#
|
||||||
|
# gem install oa-openid
|
||||||
|
#
|
||||||
|
# For the full auth suite:
|
||||||
|
#
|
||||||
|
# gem install omniauth
|
||||||
|
#
|
||||||
|
# == Stand-Alone Example
|
||||||
|
#
|
||||||
|
# Use the strategy as a middleware in your application:
|
||||||
|
#
|
||||||
|
# require 'omniauth/openid'
|
||||||
|
# require 'openid/store/filesystem'
|
||||||
|
#
|
||||||
|
# use Rack::Session::Cookie
|
||||||
|
# use OmniAuth::Strategies::OpenID, OpenID::Store::Filesystem.new('/tmp')
|
||||||
|
#
|
||||||
|
# Then simply direct users to '/auth/open_id' to prompt them for their OpenID identifier. You may also pre-set the identifier by passing an <tt>identifier</tt> parameter to the URL (Example: <tt>/auth/open_id?openid_url=yahoo.com</tt>).
|
||||||
|
#
|
||||||
|
# A list of all OpenID stores is available at http://github.com/openid/ruby-openid/tree/master/lib/openid/store/
|
||||||
|
#
|
||||||
|
# == OmniAuth Builder
|
||||||
|
#
|
||||||
|
# If OpenID is one of several authentication strategies, use the OmniAuth Builder:
|
||||||
|
#
|
||||||
|
# require 'omniauth/openid'
|
||||||
|
# require 'omniauth/basic' # for Campfire
|
||||||
|
# require 'openid/store/filesystem'
|
||||||
|
#
|
||||||
|
# use OmniAuth::Builder do
|
||||||
|
# provider :open_id, OpenID::Store::Filesystem.new('/tmp')
|
||||||
|
# provider :campfire
|
||||||
|
# end
|
||||||
|
#
|
||||||
|
# == Configured Identifiers
|
||||||
|
#
|
||||||
|
# You may pre-configure an OpenID identifier. For example, to use Google's main OpenID endpoint:
|
||||||
|
#
|
||||||
|
# use OmniAuth::Builder do
|
||||||
|
# provider :open_id, nil, :name => 'google', :identifier => 'https://www.google.com/accounts/o8/id'
|
||||||
|
# end
|
||||||
|
#
|
||||||
|
# Note the use of nil, which will trigger ruby-openid's default Memory Store.
|
||||||
|
module OpenID; end
|
||||||
|
|
||||||
module Strategies
|
module Strategies
|
||||||
autoload :OpenID, 'omniauth/strategies/open_id'
|
autoload :OpenID, 'omniauth/strategies/open_id'
|
||||||
autoload :GoogleApps, 'omniauth/strategies/google_apps'
|
autoload :GoogleApps, 'omniauth/strategies/google_apps'
|
||||||
|
|
Loading…
Add table
Reference in a new issue