easy_auth 0.2.1 → 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 8031ade914227fa6a302b315b81ed1d770c983dc
4
+ data.tar.gz: 460ce79e6dc08a35bfa723d51e78022ec6f6f627
5
+ SHA512:
6
+ metadata.gz: f61a2d1b0133d7e119fc5bc045b4b34bdcd647541d2edcdcd9c54edbc40416afd00b90ea9557edb649e5933e5a8da030cdfccb35e9cfe2bd43440fcb8bb94a33
7
+ data.tar.gz: 37c2b860b6c5319df03ecf7d159088d9db713a2f2aae59790bfa75610bdc0552951ce3cc85f78975436ef19acd6a164ead24f2bf3dc14a223312f6889ab1a780
data/README.md CHANGED
@@ -2,9 +2,9 @@
2
2
 
3
3
  [![Build Status](https://secure.travis-ci.org/dockyard/easy_auth.png?branch=master)](http://travis-ci.org/dockyard/easy_auth)
4
4
  [![Dependency Status](https://gemnasium.com/dockyard/easy_auth.png?travis)](https://gemnasium.com/dockyard/easy_auth)
5
- [![Code Climate](https://codeclimate.com/badge.png)](https://codeclimate.com/github/dockyard/easy_auth)
5
+ [![Code Climate](https://codeclimate.com/github/dockyard/easy_auth.png)](https://codeclimate.com/github/dockyard/easy_auth)
6
6
 
7
- Dead simple drop in authentication for Rails
7
+ Dead simple drop in authentication for Rails 3.2+
8
8
 
9
9
  ## Installation ##
10
10
 
@@ -47,8 +47,14 @@ Your application is now ready for EasyAuth.
47
47
  ## Usage ##
48
48
 
49
49
  You will need to use one of the many
50
- [plugins](https://github.com/dockyard/easy_auth/wiki/Plugins) available for EasyAuth to
51
- provide a specific authentication strategy.
50
+ [plugins](https://github.com/dockyard/easy_auth/wiki/Plugins) available for EasyAuth to provide a specific authentication strategy.
51
+
52
+ ## What you get ##
53
+
54
+ You `User` model will be setup with an association to `identities`. The modeling is pretty simple:
55
+
56
+ ![EasyAuth Identity Modeling](http://i.imgur.com/LBafe.png)
57
+
52
58
 
53
59
  ## Authors ##
54
60
 
data/Rakefile CHANGED
@@ -1,6 +1,5 @@
1
1
  require 'bundler/setup'
2
2
  require 'rspec/core/rake_task'
3
- Bundler::GemHelper.install_tasks
4
3
 
5
4
  RSpec::Core::RakeTask.new('default') do |t|
6
5
  t.pattern = FileList['spec/**/*_spec.rb']
@@ -8,3 +7,4 @@ end
8
7
 
9
8
  APP_RAKEFILE = File.expand_path("../spec/dummy/Rakefile", __FILE__)
10
9
  load 'rails/tasks/engine.rake'
10
+ Bundler::GemHelper.install_tasks
@@ -1,46 +1,3 @@
1
1
  module EasyAuthHelper
2
- def self.included(base)
3
- base.class_eval do
4
- helper_method :current_account, :current_user, :account_signed_in?, :user_signed_in?, :account_not_signed_in?, :user_not_signed_in?
5
- end
6
- end
7
-
8
- # Access the current account the users is authenticated with
9
- #
10
- # @return [Account] instance
11
- def current_account
12
- if session[:session_token] && session[:account_class]
13
- begin
14
- @current_account ||= session[:account_class].constantize.find_by_session_token(session[:session_token])
15
- rescue
16
- @current_account = nil
17
- session.delete(:session_token)
18
- end
19
- elsif cookies[:remember_token]
20
- begin
21
- @current_account ||= EasyAuth.identity_model.find_by_remember_token(cookies[:remember_token]).account
22
- rescue
23
- @current_acount = nil
24
- cookies.delete(:remember_token)
25
- end
26
- else
27
- session.delete(:session_token)
28
- cookies.delete(:remember_token)
29
- end
30
-
31
- @current_account
32
- end
33
- alias :current_user :current_account
34
-
35
- # Should be used to test if user is authenticated
36
- def account_signed_in?
37
- current_account
38
- end
39
- alias :user_signed_in? :account_signed_in?
40
-
41
- # Should be used to test if user is not authenticated
42
- def account_not_signed_in?
43
- !account_signed_in?
44
- end
45
- alias :user_not_signed_in? :account_not_signed_in?
2
+ include EasyAuth::Helpers::EasyAuth
46
3
  end
@@ -1,18 +1,14 @@
1
1
  class CreateEasyAuthIdentities < ActiveRecord::Migration
2
2
  def change
3
3
  create_table :identities do |t|
4
- t.string :username
4
+ t.string :uid
5
5
  t.string :token
6
6
  t.string :account_type
7
7
  t.integer :account_id
8
- t.string :reset_token
9
- t.string :remember_token
10
8
  t.string :type
11
9
  t.timestamps
12
10
  end
13
11
 
14
- [:username, :reset_token, :remember_token].each do |column|
15
- add_index :identities, column
16
- end
12
+ add_index :identities, :uid, using: :gin
17
13
  end
18
14
  end
@@ -0,0 +1,37 @@
1
+ module ActiveSupport::Concern
2
+ def append_features(base)
3
+ if base.instance_variable_defined?("@_dependencies")
4
+ base.instance_variable_get("@_dependencies") << { :method => :include, :module => self }
5
+ return false
6
+ else
7
+ return false if base < self
8
+ @_dependencies.each { |dep| Hash === dep ? base.send(dep[:method], dep[:module]) : base.send(:include, dep) }
9
+ super
10
+ base.extend const_get("ClassMethods") if const_defined?("ClassMethods")
11
+ base.class_eval(&@_included_block) if instance_variable_defined?("@_included_block")
12
+ end
13
+ end
14
+
15
+ def prepend_features(base)
16
+ if base.instance_variable_defined?("@_dependencies")
17
+ base.instance_variable_get("@_dependencies").unshift({ :method => :prepend, :module => self })
18
+ return false
19
+ else
20
+ return false if base < self
21
+ super
22
+ base.singleton_class.send(:prepend, const_get("ClassMethods")) if const_defined?("ClassMethods")
23
+ @_dependencies.each { |dep| Hash === dep ? base.send(dep[:method], dep[:module]) : base.send(:prepend, dep) }
24
+ base.class_eval(&@_prepended_block) if instance_variable_defined?("@_prepended_block")
25
+ end
26
+ end
27
+
28
+ def prepended(base = nil, &block)
29
+ if base.nil?
30
+ raise MultipleIncludedBlocks if instance_variable_defined?("@_prepended_block")
31
+
32
+ @_prepended_block = block
33
+ else
34
+ super
35
+ end
36
+ end
37
+ end
@@ -1,7 +1,7 @@
1
1
  module EasyAuth::Controllers::Authenticated
2
- extend EasyAuth::ReverseConcern
2
+ extend ActiveSupport::Concern
3
3
 
4
- reverse_included do
4
+ included do
5
5
  before_filter :attempt_to_authenticate
6
6
  end
7
7
 
@@ -9,7 +9,7 @@ module EasyAuth::Controllers::Authenticated
9
9
 
10
10
  def attempt_to_authenticate
11
11
  if account_not_signed_in?
12
- session[:requested_path] = request.path
12
+ session[:requested_path] = request.method == 'GET' ? request.path : request.referer
13
13
  respond_to do |format|
14
14
  format.html { redirect_to main_app.sign_in_url }
15
15
  format.json { render :json => {}, :status => 401 }
@@ -1,64 +1,61 @@
1
1
  module EasyAuth::Controllers::Sessions
2
- extend EasyAuth::ReverseConcern
2
+ extend ActiveSupport::Concern
3
3
 
4
4
  def new
5
5
  EasyAuth.new_session(self)
6
6
  end
7
7
 
8
8
  def create
9
- if identity = EasyAuth.authenticate(self)
10
- identity.set_account_session(session)
11
- set_remember(identity)
12
- if identity.remember
13
- cookies[:remember_token] = { :value => identity.generate_remember_token!, :expires => identity.remember_time.from_now }
14
- end
15
- after_successful_sign_in(identity)
9
+ if @identity = EasyAuth.authenticate(self)
10
+ session[:identity_id] = @identity.id
11
+ after_successful_sign_in
16
12
  else
17
13
  @identity = EasyAuth.find_identity_model(params).new(params[params[:identity]])
18
- after_failed_sign_in(@identity)
14
+ after_failed_sign_in
19
15
  end
16
+ rescue AbstractController::DoubleRenderError
20
17
  end
21
18
 
22
19
  def destroy
23
- session.delete(:session_token)
24
- session.delete(:account_class)
25
- cookies.delete(:remember_token)
20
+ session.delete(:identity_id)
26
21
  after_sign_out
27
22
  end
28
23
 
29
- private
30
-
31
- def after_with_or_default(method_name, identity)
32
- send("#{method_name}_with_#{params[:identity]}", identity) || send("#{method_name}_default", identity)
24
+ def after_with_or_default(method_name)
25
+ send("#{method_name}_with_#{params[:identity]}") || send("#{method_name}_default")
33
26
  end
34
27
 
35
- def after_successful_sign_in(identity)
36
- after_with_or_default(__method__, identity)
28
+ def after_successful_sign_in
29
+ after_with_or_default(__method__)
37
30
  end
38
31
 
39
- def after_successful_sign_in_url(identity)
40
- after_with_or_default(__method__, identity)
32
+ def after_successful_sign_in_url
33
+ after_with_or_default(__method__)
41
34
  end
42
35
 
43
- def after_failed_sign_in(identity)
44
- after_with_or_default(__method__, identity)
36
+ def after_failed_sign_in
37
+ after_with_or_default(__method__)
45
38
  end
46
39
 
47
- def after_successful_sign_in_default(identity)
48
- redirect_to(session.delete(:requested_path) || after_successful_sign_in_url(identity), :notice => I18n.t('easy_auth.sessions.create.notice'))
40
+ def after_successful_sign_in_default
41
+ redirect_to(session.delete(:requested_path) || after_successful_sign_in_url, :notice => I18n.t('easy_auth.sessions.create.notice'))
49
42
  end
50
43
 
51
- def after_successful_sign_in_url_default(identity)
52
- identity.account
44
+ def after_successful_sign_in_url_default
45
+ @identity.account
53
46
  end
54
47
 
55
- def after_failed_sign_in_default(identity)
48
+ def after_failed_sign_in_default
56
49
  flash.now[:error] = I18n.t('easy_auth.sessions.create.error')
57
50
  render :new
58
51
  end
59
52
 
60
53
  def after_sign_out
61
- redirect_to main_app.root_url, :notice => I18n.t('easy_auth.sessions.delete.notice')
54
+ redirect_to after_sign_out_url, :notice => I18n.t('easy_auth.sessions.delete.notice')
55
+ end
56
+
57
+ def after_sign_out_url
58
+ main_app.root_url
62
59
  end
63
60
 
64
61
  def no_authentication
@@ -77,10 +74,4 @@ module EasyAuth::Controllers::Sessions
77
74
  super
78
75
  end
79
76
  end
80
-
81
- def set_remember(identity)
82
- if identity_attributes = params[ActiveModel::Naming.param_key(EasyAuth.find_identity_model(params).new)]
83
- identity.remember = identity_attributes[:remember]
84
- end
85
- end
86
77
  end
@@ -0,0 +1,48 @@
1
+ module EasyAuth::Helpers::EasyAuth
2
+ extend ActiveSupport::Concern
3
+
4
+ def self.included(base)
5
+ base.class_eval do
6
+ def self.included(base)
7
+ base.class_eval do
8
+ helper_method :current_account, :current_user, :account_signed_in?, :user_signed_in?, :account_not_signed_in?, :user_not_signed_in?
9
+ end
10
+ end
11
+ end
12
+ end
13
+
14
+ # Access the current account the users is authenticated with
15
+ #
16
+ # @return [Account] instance
17
+ def current_account
18
+ if session[:identity_id]
19
+ begin
20
+ @current_account ||= EasyAuth.identity_model.find(session[:identity_id]).account
21
+ rescue ActiveRecord::RecordNotFound
22
+ @current_account = nil
23
+ delete_session_data
24
+ end
25
+ end
26
+
27
+ @current_account
28
+ end
29
+ alias :current_user :current_account
30
+
31
+ # Should be used to test if user is authenticated
32
+ def account_signed_in?
33
+ current_account
34
+ end
35
+ alias :user_signed_in? :account_signed_in?
36
+
37
+ # Should be used to test if user is not authenticated
38
+ def account_not_signed_in?
39
+ !account_signed_in?
40
+ end
41
+ alias :user_not_signed_in? :account_not_signed_in?
42
+
43
+ private
44
+
45
+ def delete_session_data
46
+ session.delete(:identity_id)
47
+ end
48
+ end
@@ -0,0 +1,4 @@
1
+ module EasyAuth::Helpers
2
+ extend ActiveSupport::Autoload
3
+ autoload :EasyAuth
4
+ end
@@ -1,52 +1,9 @@
1
1
  module EasyAuth::Models::Account
2
- include EasyAuth::TokenGenerator
3
- extend EasyAuth::ReverseConcern
4
- class NoIdentityUsernameError < StandardError; end
2
+ extend ActiveSupport::Concern
5
3
 
6
- reverse_included do
4
+ included do
7
5
  # Relationships
8
- has_many :identities, :class_name => 'Identity', :as => :account, :dependent => :destroy
9
-
10
- def identity_username_attribute
11
- self.send(self.class.identity_username_attribute)
12
- end
13
- end
14
-
15
- module ClassMethods
16
- # Will attempt to find the username attribute
17
- #
18
- # First will check to see if #identity_username_attribute is already defined in the model.
19
- #
20
- # If not, will check to see if `username` exists as a column on the record
21
- # If not, will check to see if `email` exists as a column on the record
22
- #
23
- # @return [Symbol]
24
- def identity_username_attribute
25
- if respond_to?(:super)
26
- super
27
- elsif column_names.include?('username')
28
- :username
29
- elsif column_names.include?('email')
30
- :email
31
- else
32
- raise EasyAuth::Models::Account::NoIdentityUsernameError, 'your model must have either a #username or #email attribute. Or you must override the .identity_username_attribute class method'
33
- end
34
- end
35
- end
36
-
37
- # Generates a new session token and updates the record
38
- #
39
- # @return [String]
40
- def generate_session_token!
41
- self.update_column(:session_token, _generate_token(:session))
42
- self.session_token
43
- end
44
-
45
- # Used to set the session for the authenticated account
46
- #
47
- # @param [Rack::Session::Abstract::SessionHash] session controller session
48
- def set_session(session)
49
- session[:session_token] = generate_session_token!
50
- session[:account_class] = self.class.to_s
6
+ has_many :identities, :class_name => 'Identity', :as => :account, :dependent => :destroy, :autosave => true
7
+ accepts_nested_attributes_for :identities
51
8
  end
52
9
  end
@@ -1,12 +1,10 @@
1
1
  module EasyAuth::Models::Identity
2
- include EasyAuth::TokenGenerator
3
- include EasyAuth::ReverseConcern
2
+ extend ActiveSupport::Concern
4
3
 
5
- def self.included(base)
6
- base.class_eval do
7
- belongs_to :account, :polymorphic => true
8
- extend ClassMethods
9
- end
4
+ included do
5
+ belongs_to :account, polymorphic: true, dependent: :destroy, autosave: true, validate: true
6
+ validates :uid, :uniqueness => { :scope => :type }, :presence => true
7
+ validates :token, presence: true
10
8
  end
11
9
 
12
10
  module ClassMethods
@@ -24,40 +22,4 @@ module EasyAuth::Models::Identity
24
22
  controller.instance_variable_set(:@identity, self.new)
25
23
  end
26
24
  end
27
-
28
- # Sets the session for the association account
29
- #
30
- # @param [Rack::Session::Abstract::SessionHash] session controller session
31
- def set_account_session(session)
32
- account.set_session(session)
33
- end
34
-
35
- # Getter for the remember flag
36
- def remember
37
- @remember
38
- end
39
-
40
- # Setter for the remember flag
41
- #
42
- # @param [Boolean] value
43
- def remember=(value)
44
- @remember = ::ActiveRecord::ConnectionAdapters::Column.value_to_boolean(value)
45
- end
46
-
47
- # Generates a new remember token and updates it on the identity record
48
- #
49
- # @return [String]
50
- def generate_remember_token!
51
- update_column(:remember_token, _generate_token(:remember))
52
- remember_token
53
- end
54
-
55
- # The time used for remembering how long to stay signed in
56
- #
57
- # Defaults to 1 year, override in the model to set your own custom remember time
58
- #
59
- # @return [DateTime]
60
- def remember_time
61
- 1.year
62
- end
63
25
  end
@@ -2,6 +2,6 @@ module EasyAuth::TokenGenerator
2
2
  private
3
3
 
4
4
  def _generate_token(type)
5
- token = BCrypt::Password.create("#{id}-#{type}_token-#{DateTime.current}")
5
+ token = Digest::SHA2.hexdigest("#{id}-#{type}_token-#{DateTime.current}")
6
6
  end
7
7
  end
@@ -1,3 +1,3 @@
1
1
  module EasyAuth
2
- VERSION = '0.2.1'
2
+ VERSION = '0.3.0'
3
3
  end
data/lib/easy_auth.rb CHANGED
@@ -1,15 +1,15 @@
1
1
  require 'active_support'
2
- require 'bcrypt'
3
2
  require 'easy_auth/engine'
4
3
  require 'easy_auth/version'
4
+ require 'easy_auth/active_support/concern'
5
5
 
6
6
  module EasyAuth
7
7
  extend ActiveSupport::Autoload
8
8
 
9
9
  autoload :Controllers
10
+ autoload :Helpers
10
11
  autoload :Mailers
11
12
  autoload :Models
12
- autoload :ReverseConcern
13
13
  autoload :Routes
14
14
  autoload :TokenGenerator
15
15
 
metadata CHANGED
@@ -1,8 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: easy_auth
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
5
- prerelease:
4
+ version: 0.3.0
6
5
  platform: ruby
7
6
  authors:
8
7
  - Brian Cardarella
@@ -10,124 +9,109 @@ authors:
10
9
  autorequire:
11
10
  bindir: bin
12
11
  cert_chain: []
13
- date: 2012-11-05 00:00:00.000000000 Z
12
+ date: 2014-03-11 00:00:00.000000000 Z
14
13
  dependencies:
15
14
  - !ruby/object:Gem::Dependency
16
15
  name: rails
17
16
  requirement: !ruby/object:Gem::Requirement
18
- none: false
19
17
  requirements:
20
- - - ~>
18
+ - - '>='
21
19
  - !ruby/object:Gem::Version
22
- version: 3.2.1
20
+ version: 3.2.0
23
21
  type: :runtime
24
22
  prerelease: false
25
23
  version_requirements: !ruby/object:Gem::Requirement
26
- none: false
27
24
  requirements:
28
- - - ~>
25
+ - - '>='
29
26
  - !ruby/object:Gem::Version
30
- version: 3.2.1
27
+ version: 3.2.0
31
28
  - !ruby/object:Gem::Dependency
32
- name: bcrypt-ruby
29
+ name: rails
33
30
  requirement: !ruby/object:Gem::Requirement
34
- none: false
35
31
  requirements:
36
32
  - - ~>
37
33
  - !ruby/object:Gem::Version
38
- version: 3.0.0
39
- type: :runtime
34
+ version: 4.0.0
35
+ type: :development
40
36
  prerelease: false
41
37
  version_requirements: !ruby/object:Gem::Requirement
42
- none: false
43
38
  requirements:
44
39
  - - ~>
45
40
  - !ruby/object:Gem::Version
46
- version: 3.0.0
41
+ version: 4.0.0
47
42
  - !ruby/object:Gem::Dependency
48
43
  name: sqlite3
49
44
  requirement: !ruby/object:Gem::Requirement
50
- none: false
51
45
  requirements:
52
- - - ! '>='
46
+ - - '>='
53
47
  - !ruby/object:Gem::Version
54
48
  version: '0'
55
49
  type: :development
56
50
  prerelease: false
57
51
  version_requirements: !ruby/object:Gem::Requirement
58
- none: false
59
52
  requirements:
60
- - - ! '>='
53
+ - - '>='
61
54
  - !ruby/object:Gem::Version
62
55
  version: '0'
63
56
  - !ruby/object:Gem::Dependency
64
57
  name: rspec-rails
65
58
  requirement: !ruby/object:Gem::Requirement
66
- none: false
67
59
  requirements:
68
- - - ! '>='
60
+ - - '>='
69
61
  - !ruby/object:Gem::Version
70
62
  version: '0'
71
63
  type: :development
72
64
  prerelease: false
73
65
  version_requirements: !ruby/object:Gem::Requirement
74
- none: false
75
66
  requirements:
76
- - - ! '>='
67
+ - - '>='
77
68
  - !ruby/object:Gem::Version
78
69
  version: '0'
79
70
  - !ruby/object:Gem::Dependency
80
71
  name: capybara
81
72
  requirement: !ruby/object:Gem::Requirement
82
- none: false
83
73
  requirements:
84
- - - ! '>='
74
+ - - ~>
85
75
  - !ruby/object:Gem::Version
86
- version: '0'
76
+ version: '2.1'
87
77
  type: :development
88
78
  prerelease: false
89
79
  version_requirements: !ruby/object:Gem::Requirement
90
- none: false
91
80
  requirements:
92
- - - ! '>='
81
+ - - ~>
93
82
  - !ruby/object:Gem::Version
94
- version: '0'
83
+ version: '2.1'
95
84
  - !ruby/object:Gem::Dependency
96
85
  name: database_cleaner
97
86
  requirement: !ruby/object:Gem::Requirement
98
- none: false
99
87
  requirements:
100
- - - ! '>='
88
+ - - ~>
101
89
  - !ruby/object:Gem::Version
102
- version: '0'
90
+ version: 1.0.1
103
91
  type: :development
104
92
  prerelease: false
105
93
  version_requirements: !ruby/object:Gem::Requirement
106
- none: false
107
94
  requirements:
108
- - - ! '>='
95
+ - - ~>
109
96
  - !ruby/object:Gem::Version
110
- version: '0'
97
+ version: 1.0.1
111
98
  - !ruby/object:Gem::Dependency
112
99
  name: valid_attribute
113
100
  requirement: !ruby/object:Gem::Requirement
114
- none: false
115
101
  requirements:
116
- - - ! '>='
102
+ - - '>='
117
103
  - !ruby/object:Gem::Version
118
104
  version: '0'
119
105
  type: :development
120
106
  prerelease: false
121
107
  version_requirements: !ruby/object:Gem::Requirement
122
- none: false
123
108
  requirements:
124
- - - ! '>='
109
+ - - '>='
125
110
  - !ruby/object:Gem::Version
126
111
  version: '0'
127
112
  - !ruby/object:Gem::Dependency
128
113
  name: factory_girl_rails
129
114
  requirement: !ruby/object:Gem::Requirement
130
- none: false
131
115
  requirements:
132
116
  - - ~>
133
117
  - !ruby/object:Gem::Version
@@ -135,7 +119,6 @@ dependencies:
135
119
  type: :development
136
120
  prerelease: false
137
121
  version_requirements: !ruby/object:Gem::Requirement
138
- none: false
139
122
  requirements:
140
123
  - - ~>
141
124
  - !ruby/object:Gem::Version
@@ -143,7 +126,6 @@ dependencies:
143
126
  - !ruby/object:Gem::Dependency
144
127
  name: factory_girl
145
128
  requirement: !ruby/object:Gem::Requirement
146
- none: false
147
129
  requirements:
148
130
  - - ~>
149
131
  - !ruby/object:Gem::Version
@@ -151,57 +133,50 @@ dependencies:
151
133
  type: :development
152
134
  prerelease: false
153
135
  version_requirements: !ruby/object:Gem::Requirement
154
- none: false
155
136
  requirements:
156
137
  - - ~>
157
138
  - !ruby/object:Gem::Version
158
139
  version: 2.6.0
159
140
  - !ruby/object:Gem::Dependency
160
- name: bourne
141
+ name: mocha
161
142
  requirement: !ruby/object:Gem::Requirement
162
- none: false
163
143
  requirements:
164
- - - ! '>='
144
+ - - ~>
165
145
  - !ruby/object:Gem::Version
166
- version: '0'
146
+ version: 0.10.5
167
147
  type: :development
168
148
  prerelease: false
169
149
  version_requirements: !ruby/object:Gem::Requirement
170
- none: false
171
150
  requirements:
172
- - - ! '>='
151
+ - - ~>
173
152
  - !ruby/object:Gem::Version
174
- version: '0'
153
+ version: 0.10.5
175
154
  - !ruby/object:Gem::Dependency
176
155
  name: launchy
177
156
  requirement: !ruby/object:Gem::Requirement
178
- none: false
179
157
  requirements:
180
- - - ! '>='
158
+ - - '>='
181
159
  - !ruby/object:Gem::Version
182
160
  version: '0'
183
161
  type: :development
184
162
  prerelease: false
185
163
  version_requirements: !ruby/object:Gem::Requirement
186
- none: false
187
164
  requirements:
188
- - - ! '>='
165
+ - - '>='
189
166
  - !ruby/object:Gem::Version
190
167
  version: '0'
191
168
  - !ruby/object:Gem::Dependency
192
169
  name: generator_spec
193
170
  requirement: !ruby/object:Gem::Requirement
194
- none: false
195
171
  requirements:
196
- - - ! '>='
172
+ - - '>='
197
173
  - !ruby/object:Gem::Version
198
174
  version: '0'
199
175
  type: :development
200
176
  prerelease: false
201
177
  version_requirements: !ruby/object:Gem::Requirement
202
- none: false
203
178
  requirements:
204
- - - ! '>='
179
+ - - '>='
205
180
  - !ruby/object:Gem::Version
206
181
  version: '0'
207
182
  description: EasyAuth
@@ -220,16 +195,18 @@ files:
220
195
  - config/locales/en.yml
221
196
  - config/routes.rb
222
197
  - db/migrate/20120227014023_create_easy_auth_identities.rb
198
+ - lib/easy_auth/active_support/concern.rb
223
199
  - lib/easy_auth/controllers/authenticated.rb
224
200
  - lib/easy_auth/controllers/sessions.rb
225
201
  - lib/easy_auth/controllers.rb
226
202
  - lib/easy_auth/engine.rb
203
+ - lib/easy_auth/helpers/easy_auth.rb
204
+ - lib/easy_auth/helpers.rb
227
205
  - lib/easy_auth/mailers.rb
228
206
  - lib/easy_auth/models/account.rb
229
207
  - lib/easy_auth/models/identities.rb
230
208
  - lib/easy_auth/models/identity.rb
231
209
  - lib/easy_auth/models.rb
232
- - lib/easy_auth/reverse_concern.rb
233
210
  - lib/easy_auth/routes.rb
234
211
  - lib/easy_auth/token_generator.rb
235
212
  - lib/easy_auth/version.rb
@@ -240,32 +217,25 @@ files:
240
217
  - README.md
241
218
  homepage: https://github.com/dockyard/easy_auth
242
219
  licenses: []
220
+ metadata: {}
243
221
  post_install_message:
244
222
  rdoc_options: []
245
223
  require_paths:
246
224
  - lib
247
225
  required_ruby_version: !ruby/object:Gem::Requirement
248
- none: false
249
226
  requirements:
250
- - - ! '>='
227
+ - - '>='
251
228
  - !ruby/object:Gem::Version
252
- version: '0'
253
- segments:
254
- - 0
255
- hash: 911422429951666950
229
+ version: '2.0'
256
230
  required_rubygems_version: !ruby/object:Gem::Requirement
257
- none: false
258
231
  requirements:
259
- - - ! '>='
232
+ - - '>='
260
233
  - !ruby/object:Gem::Version
261
234
  version: '0'
262
- segments:
263
- - 0
264
- hash: 911422429951666950
265
235
  requirements: []
266
236
  rubyforge_project:
267
- rubygems_version: 1.8.23
237
+ rubygems_version: 2.0.3
268
238
  signing_key:
269
- specification_version: 3
239
+ specification_version: 4
270
240
  summary: EasyAuth
271
241
  test_files: []
@@ -1,27 +0,0 @@
1
- module EasyAuth::ReverseConcern
2
- def self.extended(base)
3
- base.instance_variable_set("@_dependencies", [])
4
- end
5
-
6
- def append_features(base)
7
- if base.instance_variable_defined?("@_dependencies")
8
- base.instance_variable_get("@_dependencies") << self
9
- return false
10
- else
11
- return false if base < self
12
- base.class_eval(&@_included_block) if instance_variable_defined?("@_included_block")
13
- base.extend const_get("ClassMethods") if const_defined?("ClassMethods")
14
- @_dependencies.each { |dep| base.send(:include, dep) }
15
- super
16
- end
17
- end
18
-
19
- def reverse_included(base = nil, &block)
20
- if base.nil?
21
- @_included_block = block
22
- else
23
- super
24
- end
25
- end
26
- end
27
-