From db501c959a90c7d577504014bdf3cb9d8c4b5749 Mon Sep 17 00:00:00 2001 From: Lucas Kanashiro Date: Tue, 21 Oct 2014 11:42:17 -0200 Subject: [PATCH] Added the structure of omniauth-remote-user gem --- Gemfile | 13 +++++++++++++ Rakefile | 10 ++++++++++ lib/omniauth/remote_user.rb | 14 ++++++++++++++ lib/omniauth/strategies/remote_user.rb | 0 lib/omniauth_remote_user.rb | 3 +++ lib/omniauth_remote_user/version.rb | 6 ++++++ omniauth-remote-user.gemspec | 26 ++++++++++++++++++++++++++ spec/spec_helper.rb | 14 ++++++++++++++ 8 files changed, 86 insertions(+), 0 deletions(-) create mode 100644 Gemfile create mode 100644 Rakefile create mode 100644 lib/omniauth/remote_user.rb create mode 100644 lib/omniauth/strategies/remote_user.rb create mode 100644 lib/omniauth_remote_user.rb create mode 100644 lib/omniauth_remote_user/version.rb create mode 100644 omniauth-remote-user.gemspec create mode 100644 spec/spec_helper.rb diff --git a/Gemfile b/Gemfile new file mode 100644 index 0000000..9190d15 --- /dev/null +++ b/Gemfile @@ -0,0 +1,13 @@ +source "http://rubygems.org" + +gemspec + +group :development, :test do + gem 'guard' + gem 'guard-rspec' + gem 'guard-bundler' + gem 'growl' + gem 'rb-fsevent' + gem 'simplecov' +end + diff --git a/Rakefile b/Rakefile new file mode 100644 index 0000000..2ecea87 --- /dev/null +++ b/Rakefile @@ -0,0 +1,10 @@ +require 'bundler' +Bundler::GemHelper.install_tasks + +require 'rspec/core/rake_test' +desc "Run specs." +RSpec::Core::RakeTask.new(:spec) + +task :default => :spec +task :test => :spec + diff --git a/lib/omniauth/remote_user.rb b/lib/omniauth/remote_user.rb new file mode 100644 index 0000000..4684a9f --- /dev/null +++ b/lib/omniauth/remote_user.rb @@ -0,0 +1,14 @@ +require 'omniauth' + +module Omniauth + module Stratagies + autoload :RemoteUser, 'omniauth/stratagies/remote_user' + end + + module Remote_user + autoload :Model, 'omniauth/remote_user/model' + module Models + autoload :ActiveRecord, 'omniauth/remote_user/models/active_record' + end +end + diff --git a/lib/omniauth/strategies/remote_user.rb b/lib/omniauth/strategies/remote_user.rb new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/lib/omniauth/strategies/remote_user.rb diff --git a/lib/omniauth_remote_user.rb b/lib/omniauth_remote_user.rb new file mode 100644 index 0000000..d8f0999 --- /dev/null +++ b/lib/omniauth_remote_user.rb @@ -0,0 +1,3 @@ +require 'omniauth-remote-user/version' +require 'omniauth/remote-user' + diff --git a/lib/omniauth_remote_user/version.rb b/lib/omniauth_remote_user/version.rb new file mode 100644 index 0000000..178cf78 --- /dev/null +++ b/lib/omniauth_remote_user/version.rb @@ -0,0 +1,6 @@ +module Omniauth + module Remote_user + VERSION = '0.0.1' + end +end + diff --git a/omniauth-remote-user.gemspec b/omniauth-remote-user.gemspec new file mode 100644 index 0000000..a8aeb5e --- /dev/null +++ b/omniauth-remote-user.gemspec @@ -0,0 +1,26 @@ +require File.dirname(__FILE__) + '/lib/omniauth_remote_user/version' + +Gem::Specification.new do |gem| + gem.add_runtime_dependency 'omniauth' + + gem.add_runtime_dependency 'simplecov' + gem.add_runtime_dependency 'bundler' + gem.add_runtime_dependency 'rake' + gem.add_runtime_dependency 'rspec' + gem.add_runtime_dependency 'rack-test' + gem.add_runtime_dependency 'activerecord' + + gem.name = 'omniauth-remote-user' + gem.version = Omniauth::Remote_user::VERSION + gem.description = %q{Authentication with remote user HTTP header for Omniauth.} + gem.summary = gem.description + gem.email = ['kanashiro.duarte@gmail.com', 'thiagitosouza@gmail.com', 'rodrigosiqueiramelo@gmail.com'] + gem.homepage = 'http://beta.softwarepublico.gov.br/gitlab/softwarepublico/omiauth-remote-user' + gem.authors = ['Lucas Kanashiro', 'Thiago Ribeiro', 'Rodrigo Siqueira'] + gem.require_paths = %w(lib) + gem.files = `git ls-files -z`.split("\x0").reject {|f| f.start_with?('spec/')} + gem.test_files = `git ls-files -- {test,spec,feature}/*`.split("\n") + gem.license = %w(GPLv3) + gem.required_rubygems_version = '>= 1.3.5' +end + diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb new file mode 100644 index 0000000..0954046 --- /dev/null +++ b/spec/spec_helper.rb @@ -0,0 +1,14 @@ +require 'rubygems' +require 'bundler' +Bundler.setup :default, :development, :test + +require 'simplecov' +SimpleCov.start + +require 'rack/test' +require 'omniauth/remote_user' + +RSpec.configure do |config| + config.include Rack::Test::Methods +end + -- libgit2 0.21.2