From 0cdc080b590e06fe944c51b73f492257258625ee Mon Sep 17 00:00:00 2001 From: Michael Bleigh Date: Sun, 4 Apr 2010 23:30:40 -0400 Subject: [PATCH] First stage of moving to gem family route, still need to add gemspecs and gem building methods. --- README.markdown | 18 +++++ Rakefile | 59 ++++------------ VERSION | 1 - oa-basic/Rakefile | 10 +++ oa-basic/lib/omniauth/basic.rb | 2 + .../lib/omniauth}/strategies/gowalla.rb | 0 .../lib/omniauth}/strategies/http_basic.rb | 2 +- oa-core/Rakefile | 10 +++ .../lib/omniauth}/builder.rb | 0 .../lib/omniauth/core.rb | 11 +-- oa-core/lib/omniauth/password.rb | 2 + .../lib/omniauth}/strategies/password.rb | 0 .../lib/omniauth}/strategy.rb | 0 oa-core/spec/omniauth/core_spec.rb | 58 ++++++++++++++++ .../spec/omniauth/strategies/password_spec.rb | 6 ++ oa-core/spec/spec.opts | 2 + oa-core/spec/spec_helper.rb | 10 +++ oa-oauth/Rakefile | 10 +++ oa-oauth/lib/omniauth/oauth.rb | 5 ++ .../lib/omniauth}/strategies/linked_in.rb | 2 + .../lib/omniauth}/strategies/oauth.rb | 0 .../lib/omniauth}/strategies/twitter.rb | 2 + oa-oauth/oa-oauth.gemspec | 18 +++++ .../spec/omniauth}/strategies/oauth_spec.rb | 0 oa-oauth/spec/spec.opts | 3 + oa-oauth/spec/spec_helper.rb | 10 +++ oa-openid/Rakefile | 10 +++ oa-openid/lib/omniauth/openid.rb | 2 + .../lib/omniauth}/strategies/open_id.rb | 0 .../spec/omniauth}/strategies/open_id_spec.rb | 0 oa-rails/Rakefile | 10 +++ omni_auth.gemspec | 69 ------------------- LICENSE => omniauth/LICENSE | 0 README.rdoc => omniauth/README.rdoc | 2 +- omniauth/lib/omniauth.rb | 9 +++ spec/omni_auth/strategies/password_spec.rb | 13 ---- spec/spec.opts | 3 - spec/spec_helper.rb | 16 ----- 38 files changed, 216 insertions(+), 159 deletions(-) create mode 100644 README.markdown delete mode 100644 VERSION create mode 100644 oa-basic/Rakefile create mode 100644 oa-basic/lib/omniauth/basic.rb rename {lib/omni_auth => oa-basic/lib/omniauth}/strategies/gowalla.rb (100%) rename {lib/omni_auth => oa-basic/lib/omniauth}/strategies/http_basic.rb (95%) create mode 100644 oa-core/Rakefile rename {lib/omni_auth => oa-core/lib/omniauth}/builder.rb (100%) rename lib/omni_auth.rb => oa-core/lib/omniauth/core.rb (85%) create mode 100644 oa-core/lib/omniauth/password.rb rename {lib/omni_auth => oa-core/lib/omniauth}/strategies/password.rb (100%) rename {lib/omni_auth => oa-core/lib/omniauth}/strategy.rb (100%) create mode 100644 oa-core/spec/omniauth/core_spec.rb create mode 100644 oa-core/spec/omniauth/strategies/password_spec.rb create mode 100644 oa-core/spec/spec.opts create mode 100644 oa-core/spec/spec_helper.rb create mode 100644 oa-oauth/Rakefile create mode 100644 oa-oauth/lib/omniauth/oauth.rb rename {lib/omni_auth => oa-oauth/lib/omniauth}/strategies/linked_in.rb (96%) rename {lib/omni_auth => oa-oauth/lib/omniauth}/strategies/oauth.rb (100%) rename {lib/omni_auth => oa-oauth/lib/omniauth}/strategies/twitter.rb (95%) create mode 100644 oa-oauth/oa-oauth.gemspec rename {spec/omni_auth => oa-oauth/spec/omniauth}/strategies/oauth_spec.rb (100%) create mode 100644 oa-oauth/spec/spec.opts create mode 100644 oa-oauth/spec/spec_helper.rb create mode 100644 oa-openid/Rakefile create mode 100644 oa-openid/lib/omniauth/openid.rb rename {lib/omni_auth => oa-openid/lib/omniauth}/strategies/open_id.rb (100%) rename {spec/omni_auth => oa-openid/spec/omniauth}/strategies/open_id_spec.rb (100%) create mode 100644 oa-rails/Rakefile delete mode 100644 omni_auth.gemspec rename LICENSE => omniauth/LICENSE (100%) rename README.rdoc => omniauth/README.rdoc (96%) create mode 100644 omniauth/lib/omniauth.rb delete mode 100644 spec/omni_auth/strategies/password_spec.rb delete mode 100644 spec/spec.opts delete mode 100644 spec/spec_helper.rb diff --git a/README.markdown b/README.markdown new file mode 100644 index 0000000..6b5ce24 --- /dev/null +++ b/README.markdown @@ -0,0 +1,18 @@ +# OmniAuth + +I know what you're thinking: yes, it's yet **another** authentication solution for Rack applications. But we're going to do things a little bit differently this time. OmniAuth is built from the ground up on the philosophy that **authentication is not the same as identity**. OmniAuth is based on two observations: + +1. The traditional 'sign up using a login and password' model is becoming the exception, not the rule. Modern web applications offer external authentication via OpenID, Facebook, and OAuth. +2. The interconnectable web is no longer a dream, it is a necessity. It is not unreasonable to expect that one application may need to be able to connect to one, three, or twelve other services. Modern authentication systems should a user's identity to be associated with many authentications. + +## Theoretical Framework + +OmniAuth works on the principle that every authentication system can essentially be boiled down into two "phases". + +### The Request Phase + +In the Request Phase, we *request* information from the user that is necessary to complete authentication. This information may be **POST**ed to a URL or performed externally through an authentication process such as OpenID. + +### The Callback Phase + +In the Callback Phase, we receive an authenticated **unique identifier** that can differentiate this user from other users of the same authentication system. Additionally, we may provide **user information** that can be automatically harvested by the application to fill in the details of the authenticating user. \ No newline at end of file diff --git a/Rakefile b/Rakefile index 0db5971..1e58d72 100644 --- a/Rakefile +++ b/Rakefile @@ -1,51 +1,18 @@ require 'rubygems' require 'rake' +require 'term/ansicolor' -begin - require 'jeweler' - Jeweler::Tasks.new do |gem| - gem.name = "omni_auth" - gem.summary = %Q{Auth from anywhere.} - gem.description = %Q{Auth from anywhere.} - gem.email = "michael@intridea.com" - gem.homepage = "http://github.com/intridea/omni_auth" - gem.authors = ["Michael Bleigh"] - gem.add_dependency 'rack' - gem.add_dependency 'rest-client' - gem.add_dependency 'oauth' - gem.add_dependency 'nokogiri' - gem.add_dependency 'json' - gem.add_dependency 'rack-openid' - gem.add_development_dependency "rspec", ">= 1.2.9" - # gem is a Gem::Specification... see http://www.rubygems.org/read/chapter/20 for additional settings +include Term::ANSIColor + +OMNIAUTH_GEMS = %w(oa-core oa-basic oa-oauth oa-openid) + +desc 'Run specs for all of the gems.' +task :spec do + OMNIAUTH_GEMS.each_with_index do |dir, i| + Dir.chdir(dir) do + print blue, "\n\n== ", cyan, dir, blue, " specs are running...", clear, "\n\n" + system('rake spec') + end end - Jeweler::GemcutterTasks.new -rescue LoadError - puts "Jeweler (or a dependency) not available. Install it with: gem install jeweler" -end - -require 'spec/rake/spectask' -Spec::Rake::SpecTask.new(:spec) do |spec| - spec.libs << 'lib' << 'spec' - spec.spec_files = FileList['spec/**/*_spec.rb'] -end - -Spec::Rake::SpecTask.new(:rcov) do |spec| - spec.libs << 'lib' << 'spec' - spec.pattern = 'spec/**/*_spec.rb' - spec.rcov = true -end - -task :spec => :check_dependencies - -task :default => :spec - -require 'rake/rdoctask' -Rake::RDocTask.new do |rdoc| - version = File.exist?('VERSION') ? File.read('VERSION') : "" - - rdoc.rdoc_dir = 'rdoc' - rdoc.title = "rack-oauthable #{version}" - rdoc.rdoc_files.include('README*') - rdoc.rdoc_files.include('lib/**/*.rb') end + \ No newline at end of file diff --git a/VERSION b/VERSION deleted file mode 100644 index 8acdd82..0000000 --- a/VERSION +++ /dev/null @@ -1 +0,0 @@ -0.0.1 diff --git a/oa-basic/Rakefile b/oa-basic/Rakefile new file mode 100644 index 0000000..96438b6 --- /dev/null +++ b/oa-basic/Rakefile @@ -0,0 +1,10 @@ +require 'rubygems' +require 'rake' + +require 'spec/rake/spectask' +Spec::Rake::SpecTask.new(:spec) do |spec| + spec.libs << '../oa-core/lib' << 'lib' << 'spec' + spec.spec_files = FileList['spec/**/*_spec.rb'] +end + +task :default => :spec \ No newline at end of file diff --git a/oa-basic/lib/omniauth/basic.rb b/oa-basic/lib/omniauth/basic.rb new file mode 100644 index 0000000..e2f3c2b --- /dev/null +++ b/oa-basic/lib/omniauth/basic.rb @@ -0,0 +1,2 @@ +require 'omniauth/core' +require 'omniauth/strategies/http_basic' \ No newline at end of file diff --git a/lib/omni_auth/strategies/gowalla.rb b/oa-basic/lib/omniauth/strategies/gowalla.rb similarity index 100% rename from lib/omni_auth/strategies/gowalla.rb rename to oa-basic/lib/omniauth/strategies/gowalla.rb diff --git a/lib/omni_auth/strategies/http_basic.rb b/oa-basic/lib/omniauth/strategies/http_basic.rb similarity index 95% rename from lib/omni_auth/strategies/http_basic.rb rename to oa-basic/lib/omniauth/strategies/http_basic.rb index cf6e4e7..ac09591 100644 --- a/lib/omni_auth/strategies/http_basic.rb +++ b/oa-basic/lib/omniauth/strategies/http_basic.rb @@ -25,7 +25,7 @@ module OmniAuth end def callback_phase - [401, {}, 'Unauthorized'] + @app.call(env) end end end diff --git a/oa-core/Rakefile b/oa-core/Rakefile new file mode 100644 index 0000000..4cd514a --- /dev/null +++ b/oa-core/Rakefile @@ -0,0 +1,10 @@ +require 'rubygems' +require 'rake' + +require 'spec/rake/spectask' +Spec::Rake::SpecTask.new(:spec) do |spec| + spec.libs << 'lib' << 'spec' + spec.spec_files = FileList['spec/**/*_spec.rb'] +end + +task :default => :spec \ No newline at end of file diff --git a/lib/omni_auth/builder.rb b/oa-core/lib/omniauth/builder.rb similarity index 100% rename from lib/omni_auth/builder.rb rename to oa-core/lib/omniauth/builder.rb diff --git a/lib/omni_auth.rb b/oa-core/lib/omniauth/core.rb similarity index 85% rename from lib/omni_auth.rb rename to oa-core/lib/omniauth/core.rb index 98d32ab..8aac922 100644 --- a/lib/omni_auth.rb +++ b/oa-core/lib/omniauth/core.rb @@ -24,10 +24,6 @@ module OmniAuth attr_accessor :path_prefix end - def self.build(stack, &block) - OmniAuth::Builder.new(stack, &block) - end - def self.config Configuration.instance end @@ -67,8 +63,5 @@ module OmniAuth end end -require 'omni_auth/strategy' -%w(oauth http_basic linked_in gowalla twitter open_id password).each do |s| - require "omni_auth/strategies/#{s}" -end -require 'omni_auth/builder' \ No newline at end of file +require 'omniauth/builder' +require 'omniauth/strategy' \ No newline at end of file diff --git a/oa-core/lib/omniauth/password.rb b/oa-core/lib/omniauth/password.rb new file mode 100644 index 0000000..b3d4a1d --- /dev/null +++ b/oa-core/lib/omniauth/password.rb @@ -0,0 +1,2 @@ +require 'omniauth/core' +require 'omniauth/strategies/password' \ No newline at end of file diff --git a/lib/omni_auth/strategies/password.rb b/oa-core/lib/omniauth/strategies/password.rb similarity index 100% rename from lib/omni_auth/strategies/password.rb rename to oa-core/lib/omniauth/strategies/password.rb diff --git a/lib/omni_auth/strategy.rb b/oa-core/lib/omniauth/strategy.rb similarity index 100% rename from lib/omni_auth/strategy.rb rename to oa-core/lib/omniauth/strategy.rb diff --git a/oa-core/spec/omniauth/core_spec.rb b/oa-core/spec/omniauth/core_spec.rb new file mode 100644 index 0000000..6205d89 --- /dev/null +++ b/oa-core/spec/omniauth/core_spec.rb @@ -0,0 +1,58 @@ +require File.dirname(__FILE__) + '/../spec_helper' + +describe OmniAuth do + context 'configuration' do + it 'should be callable from .configure' do + OmniAuth.configure do |c| + c.should be_kind_of(OmniAuth::Configuration) + end + end + + it 'should be able to set the path' do + OmniAuth.configure do |config| + config.path_prefix = '/awesome' + end + + OmniAuth.config.path_prefix.should == '/awesome' + end + + it 'should be able to set the on_failure rack app' do + OmniAuth.configure do |config| + config.on_failure do + 'yoyo' + end + end + + OmniAuth.config.on_failure.call.should == 'yoyo' + end + end + + describe '::Utils' do + describe '.deep_merge' do + it 'should combine hashes' do + OmniAuth::Utils.deep_merge({'abc' => {'def' => 123}}, {'abc' => {'foo' => 'bar'}}).should == { + 'abc' => {'def' => 123, 'foo' => 'bar'} + } + end + end + + describe '.camelize' do + it 'should work on normal cases' do + { + 'some_word' => 'SomeWord', + 'AnotherWord' => 'AnotherWord', + 'one' => 'One', + 'three_words_now' => 'ThreeWordsNow' + }.each_pair{ |k,v| OmniAuth::Utils.camelize(k).should == v } + end + + it 'should work in special cases' do + { + 'oauth' => "OAuth", + 'openid' => 'OpenID', + 'open_id' => 'OpenID' + }.each_pair{ |k,v| OmniAuth::Utils.camelize(k).should == v} + end + end + end +end \ No newline at end of file diff --git a/oa-core/spec/omniauth/strategies/password_spec.rb b/oa-core/spec/omniauth/strategies/password_spec.rb new file mode 100644 index 0000000..0519db0 --- /dev/null +++ b/oa-core/spec/omniauth/strategies/password_spec.rb @@ -0,0 +1,6 @@ +require File.dirname(__FILE__) + '/../../spec_helper' +require 'omniauth/password' + +describe OmniAuth::Strategies::Password do + +end \ No newline at end of file diff --git a/oa-core/spec/spec.opts b/oa-core/spec/spec.opts new file mode 100644 index 0000000..61607f1 --- /dev/null +++ b/oa-core/spec/spec.opts @@ -0,0 +1,2 @@ +--colour +--format=specdoc \ No newline at end of file diff --git a/oa-core/spec/spec_helper.rb b/oa-core/spec/spec_helper.rb new file mode 100644 index 0000000..ae234d0 --- /dev/null +++ b/oa-core/spec/spec_helper.rb @@ -0,0 +1,10 @@ +require 'rubygems' +require 'spec' +require 'spec/autorun' +require 'rack/test' +require 'webmock/rspec' + +include Rack::Test::Methods +include WebMock + +require 'omniauth/core' diff --git a/oa-oauth/Rakefile b/oa-oauth/Rakefile new file mode 100644 index 0000000..96438b6 --- /dev/null +++ b/oa-oauth/Rakefile @@ -0,0 +1,10 @@ +require 'rubygems' +require 'rake' + +require 'spec/rake/spectask' +Spec::Rake::SpecTask.new(:spec) do |spec| + spec.libs << '../oa-core/lib' << 'lib' << 'spec' + spec.spec_files = FileList['spec/**/*_spec.rb'] +end + +task :default => :spec \ No newline at end of file diff --git a/oa-oauth/lib/omniauth/oauth.rb b/oa-oauth/lib/omniauth/oauth.rb new file mode 100644 index 0000000..17f7f8d --- /dev/null +++ b/oa-oauth/lib/omniauth/oauth.rb @@ -0,0 +1,5 @@ +require 'oauth' +require 'omniauth/core' +require 'omniauth/strategies/oauth' +require 'omniauth/strategies/twitter' +require 'omniauth/strategies/linked_in' \ No newline at end of file diff --git a/lib/omni_auth/strategies/linked_in.rb b/oa-oauth/lib/omniauth/strategies/linked_in.rb similarity index 96% rename from lib/omni_auth/strategies/linked_in.rb rename to oa-oauth/lib/omniauth/strategies/linked_in.rb index dcf58cb..42692dd 100644 --- a/lib/omni_auth/strategies/linked_in.rb +++ b/oa-oauth/lib/omniauth/strategies/linked_in.rb @@ -1,3 +1,5 @@ +require 'omniauth/core' +require 'omniauth/strategies/oauth' require 'nokogiri' module OmniAuth diff --git a/lib/omni_auth/strategies/oauth.rb b/oa-oauth/lib/omniauth/strategies/oauth.rb similarity index 100% rename from lib/omni_auth/strategies/oauth.rb rename to oa-oauth/lib/omniauth/strategies/oauth.rb diff --git a/lib/omni_auth/strategies/twitter.rb b/oa-oauth/lib/omniauth/strategies/twitter.rb similarity index 95% rename from lib/omni_auth/strategies/twitter.rb rename to oa-oauth/lib/omniauth/strategies/twitter.rb index 280f735..6fc330d 100644 --- a/lib/omni_auth/strategies/twitter.rb +++ b/oa-oauth/lib/omniauth/strategies/twitter.rb @@ -1,3 +1,5 @@ +require 'omniauth/core' +require 'omniauth/strategies/oauth' require 'json' module OmniAuth diff --git a/oa-oauth/oa-oauth.gemspec b/oa-oauth/oa-oauth.gemspec new file mode 100644 index 0000000..065772e --- /dev/null +++ b/oa-oauth/oa-oauth.gemspec @@ -0,0 +1,18 @@ +require 'omniauth/version' + +Gem::Specification.new do |gem| + gem.name = "oa-oauth" + gem.version = File.open(File.dirname(__FILE__) + '/VERSION', 'r').read.trim + gem.summary = %Q{OAuth strategies for OmniAuth.} + gem.description = %Q{OAuth strategies for OmniAuth.} + gem.email = "michael@intridea.com" + gem.homepage = "http://github.com/intridea/omni_auth" + gem.authors = ["Michael Bleigh"] + + gem.add_dependency 'oa-core' + gem.add_dependency 'oauth' + gem.add_dependency 'nokogiri' + gem.add_dependency 'json' + + gem.add_development_dependency "rspec", ">= 1.2.9" +end \ No newline at end of file diff --git a/spec/omni_auth/strategies/oauth_spec.rb b/oa-oauth/spec/omniauth/strategies/oauth_spec.rb similarity index 100% rename from spec/omni_auth/strategies/oauth_spec.rb rename to oa-oauth/spec/omniauth/strategies/oauth_spec.rb diff --git a/oa-oauth/spec/spec.opts b/oa-oauth/spec/spec.opts new file mode 100644 index 0000000..c791b36 --- /dev/null +++ b/oa-oauth/spec/spec.opts @@ -0,0 +1,3 @@ +--colour +--format=specdoc +--backtrace \ No newline at end of file diff --git a/oa-oauth/spec/spec_helper.rb b/oa-oauth/spec/spec_helper.rb new file mode 100644 index 0000000..3dbf4b0 --- /dev/null +++ b/oa-oauth/spec/spec_helper.rb @@ -0,0 +1,10 @@ +require 'rubygems' +require 'spec' +require 'spec/autorun' +require 'rack/test' +require 'webmock/rspec' + +include Rack::Test::Methods +include WebMock + +require 'omniauth/oauth' \ No newline at end of file diff --git a/oa-openid/Rakefile b/oa-openid/Rakefile new file mode 100644 index 0000000..96438b6 --- /dev/null +++ b/oa-openid/Rakefile @@ -0,0 +1,10 @@ +require 'rubygems' +require 'rake' + +require 'spec/rake/spectask' +Spec::Rake::SpecTask.new(:spec) do |spec| + spec.libs << '../oa-core/lib' << 'lib' << 'spec' + spec.spec_files = FileList['spec/**/*_spec.rb'] +end + +task :default => :spec \ No newline at end of file diff --git a/oa-openid/lib/omniauth/openid.rb b/oa-openid/lib/omniauth/openid.rb new file mode 100644 index 0000000..a2dbe7e --- /dev/null +++ b/oa-openid/lib/omniauth/openid.rb @@ -0,0 +1,2 @@ +require 'omniauth/core' +require 'omniauth/strategies/open_id' \ No newline at end of file diff --git a/lib/omni_auth/strategies/open_id.rb b/oa-openid/lib/omniauth/strategies/open_id.rb similarity index 100% rename from lib/omni_auth/strategies/open_id.rb rename to oa-openid/lib/omniauth/strategies/open_id.rb diff --git a/spec/omni_auth/strategies/open_id_spec.rb b/oa-openid/spec/omniauth/strategies/open_id_spec.rb similarity index 100% rename from spec/omni_auth/strategies/open_id_spec.rb rename to oa-openid/spec/omniauth/strategies/open_id_spec.rb diff --git a/oa-rails/Rakefile b/oa-rails/Rakefile new file mode 100644 index 0000000..96438b6 --- /dev/null +++ b/oa-rails/Rakefile @@ -0,0 +1,10 @@ +require 'rubygems' +require 'rake' + +require 'spec/rake/spectask' +Spec::Rake::SpecTask.new(:spec) do |spec| + spec.libs << '../oa-core/lib' << 'lib' << 'spec' + spec.spec_files = FileList['spec/**/*_spec.rb'] +end + +task :default => :spec \ No newline at end of file diff --git a/omni_auth.gemspec b/omni_auth.gemspec deleted file mode 100644 index 486bc30..0000000 --- a/omni_auth.gemspec +++ /dev/null @@ -1,69 +0,0 @@ -# Generated by jeweler -# DO NOT EDIT THIS FILE DIRECTLY -# Instead, edit Jeweler::Tasks in Rakefile, and run the gemspec command -# -*- encoding: utf-8 -*- - -Gem::Specification.new do |s| - s.name = %q{omni_auth} - s.version = "0.0.0.alpha.1" - - s.required_rubygems_version = Gem::Requirement.new("> 1.3.1") if s.respond_to? :required_rubygems_version= - s.authors = ["Michael Bleigh"] - s.date = %q{2010-03-30} - s.description = %q{Auth from anywhere.} - s.email = %q{michael@intridea.com} - s.extra_rdoc_files = [ - "LICENSE", - "README.rdoc" - ] - s.files = [ - ".document", - ".gitignore", - "LICENSE", - "README.rdoc", - "Rakefile", - "VERSION", - "lib/omni_auth.rb", - "lib/omni_auth/strategies/gowalla.rb", - "lib/omni_auth/strategies/http_basic.rb", - "lib/omni_auth/strategies/linked_in.rb", - "lib/omni_auth/strategies/oauth.rb", - "lib/omni_auth/strategies/twitter.rb", - "lib/omni_auth/strategy.rb", - "spec/auth_elsewhere/oauth_spec.rb", - "spec/spec.opts", - "spec/spec_helper.rb" - ] - s.homepage = %q{http://github.com/intridea/omni_auth} - s.rdoc_options = ["--charset=UTF-8"] - s.require_paths = ["lib"] - s.rubygems_version = %q{1.3.6} - s.summary = %q{Auth from anywhere.} - s.test_files = [ - "spec/auth_elsewhere/oauth_spec.rb", - "spec/spec_helper.rb" - ] - - if s.respond_to? :specification_version then - current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION - s.specification_version = 3 - - if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then - s.add_runtime_dependency(%q, [">= 0"]) - s.add_runtime_dependency(%q, [">= 0"]) - s.add_runtime_dependency(%q, [">= 0"]) - s.add_development_dependency(%q, [">= 1.2.9"]) - else - s.add_dependency(%q, [">= 0"]) - s.add_dependency(%q, [">= 0"]) - s.add_dependency(%q, [">= 0"]) - s.add_dependency(%q, [">= 1.2.9"]) - end - else - s.add_dependency(%q, [">= 0"]) - s.add_dependency(%q, [">= 0"]) - s.add_dependency(%q, [">= 0"]) - s.add_dependency(%q, [">= 1.2.9"]) - end -end - diff --git a/LICENSE b/omniauth/LICENSE similarity index 100% rename from LICENSE rename to omniauth/LICENSE diff --git a/README.rdoc b/omniauth/README.rdoc similarity index 96% rename from README.rdoc rename to omniauth/README.rdoc index 559daf7..7feb94a 100644 --- a/README.rdoc +++ b/omniauth/README.rdoc @@ -1,4 +1,4 @@ -= rack-oauthable += OmniAuth Description goes here. diff --git a/omniauth/lib/omniauth.rb b/omniauth/lib/omniauth.rb new file mode 100644 index 0000000..92918b9 --- /dev/null +++ b/omniauth/lib/omniauth.rb @@ -0,0 +1,9 @@ +require 'omniauth/core' + +%w(password oauth basic openid).each do |s| + begin + require "omniauth/#{s}" + rescue LoadError + puts "Unable to find the files for oa-#{s}, ignored it." + end +end \ No newline at end of file diff --git a/spec/omni_auth/strategies/password_spec.rb b/spec/omni_auth/strategies/password_spec.rb deleted file mode 100644 index 9faf697..0000000 --- a/spec/omni_auth/strategies/password_spec.rb +++ /dev/null @@ -1,13 +0,0 @@ -require File.dirname(__FILE__) + '/../../spec_helper' - -describe OmniAuth::Strategies::Password do - before(:each) do - FakeAdapter.reset! - end - - it do - FakeAdapter.authenticate('mbleigh','dude').should be_false - FakeAdapter.register('mbleigh','dude') - FakeAdapter.authenticate('mbleigh','dude').should be_true - end -end \ No newline at end of file diff --git a/spec/spec.opts b/spec/spec.opts deleted file mode 100644 index 8fcdd17..0000000 --- a/spec/spec.opts +++ /dev/null @@ -1,3 +0,0 @@ ---color ---format=specdoc ---backtrace \ No newline at end of file diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb deleted file mode 100644 index cd3191d..0000000 --- a/spec/spec_helper.rb +++ /dev/null @@ -1,16 +0,0 @@ -$LOAD_PATH.unshift(File.dirname(__FILE__)) -$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib')) - -require 'rubygems' -require 'omni_auth' -require 'spec' -require 'spec/autorun' -require 'rack/test' -require 'webmock/rspec' - -include Rack::Test::Methods -include WebMock - -Spec::Runner.configure do |config| - -end