authn-rails 1.4.2 → 1.7.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,9 @@
1
+ require_reative 'activation/actionmailer' if defined?(ActionMailer)
2
+
3
+ module AuthN
4
+ module Activation
5
+ module ClassMethods
6
+ include AuthN::Activation::ActionMailer if defined?(ActionMailer)
7
+ end
8
+ end
9
+ end
@@ -0,0 +1,12 @@
1
+ module AuthN
2
+ module Activation
3
+ module ActionMailer
4
+
5
+ private
6
+
7
+ def send_activation_mail
8
+
9
+ end
10
+ end
11
+ end
12
+ end
@@ -0,0 +1,6 @@
1
+ module AuthN
2
+ class Config
3
+ @@defaults.merge!(
4
+ unauthenticated_redirect_to_method: :root_path)
5
+ end
6
+ end
@@ -1,5 +1,5 @@
1
1
  module AuthN
2
2
  module Rails
3
- VERSION = "1.4.2"
3
+ VERSION = "1.7.2"
4
4
  end
5
5
  end
@@ -0,0 +1,9 @@
1
+ module AuthN
2
+ module Session
3
+ private
4
+
5
+ def unauthenticated
6
+ redirect_to send AuthN.config.unauthenticated_redirect_to_method
7
+ end
8
+ end
9
+ end
@@ -0,0 +1,14 @@
1
+ Description:
2
+ This will generate the configuration file (should you need it) to
3
+ modify AuthN's configuration.
4
+
5
+ Examples:
6
+ rails generate authn:config
7
+
8
+ This will generate an commented-out config file. Change and update if
9
+ you need to. AuthN doesn't require this config file to exist.
10
+
11
+ rails generate authn:config --model SomeUserModel
12
+
13
+ This generates the config file but with a specific model in for the
14
+ default "User" model. Default Value: Account
@@ -0,0 +1,38 @@
1
+ require 'rails/generators/migration'
2
+
3
+ module AuthN
4
+ module Generators
5
+ class ConfigGenerator < Rails::Generators::Base
6
+ include Rails::Generators::Migration
7
+
8
+ source_root File.expand_path('../templates', __FILE__)
9
+
10
+ class_option :model, model_option_options
11
+
12
+ # Copy the initializer file to config/initializers folder.
13
+ def copy_initializer_file
14
+ template "initializer.rb", "config/initializers/authn.rb"
15
+ end
16
+
17
+ private
18
+
19
+ # Either return the model passed in a classified form or return the default "Account".
20
+ def model_class_name
21
+ options[:model] ? options[:model].classify : "Account"
22
+ end
23
+
24
+ def model_option_options
25
+ {
26
+ optional: true,
27
+ type: :string,
28
+ banner: "model",
29
+ desc: model_option_description
30
+ }
31
+ end
32
+
33
+ def model_option_description
34
+ "Define the name of your default 'User' class. Default Value: Account"
35
+ end
36
+ end
37
+ end
38
+ end
@@ -0,0 +1,10 @@
1
+ # By default, assuming your user model is named Account, you wont have
2
+ # to do anything to this file. All config methods here show their default
3
+ # value.
4
+
5
+ # AuthN.config.unauthenticated_redirect_to_method = :root_path
6
+ <% if model_class_name == "Account" %>
7
+ # AuthN.config.account_klass = "<%= model_class_name %>"
8
+ <% else %>
9
+ AuthN.config.account_klass = "<%= model_class_name %>"
10
+ <% end %>
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: authn-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.4.2
4
+ version: 1.7.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-09-07 00:00:00.000000000 Z
12
+ date: 2012-09-21 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: authn
@@ -108,10 +108,16 @@ files:
108
108
  - Rakefile
109
109
  - authn-rails.gemspec
110
110
  - lib/authn-rails.rb
111
+ - lib/authn/activation.rb
112
+ - lib/authn/activation/actionmailer.rb
113
+ - lib/authn/config.rb
111
114
  - lib/authn/rails/engine.rb
112
115
  - lib/authn/rails/version.rb
116
+ - lib/authn/session.rb
117
+ - lib/generators/authn/USAGE
118
+ - lib/generators/authn/install_generator.rb
119
+ - lib/generators/authn/templates/initializer.rb
113
120
  - test/helper.rb
114
- - test/lib/authn/rails/version_test.rb
115
121
  homepage: http://krainboltgreene.github.com/authn-rails
116
122
  licenses: []
117
123
  post_install_message:
@@ -126,7 +132,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
126
132
  version: '0'
127
133
  segments:
128
134
  - 0
129
- hash: -796563585685691889
135
+ hash: 3503165329620379370
130
136
  required_rubygems_version: !ruby/object:Gem::Requirement
131
137
  none: false
132
138
  requirements:
@@ -135,7 +141,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
135
141
  version: '0'
136
142
  segments:
137
143
  - 0
138
- hash: -796563585685691889
144
+ hash: 3503165329620379370
139
145
  requirements: []
140
146
  rubyforge_project:
141
147
  rubygems_version: 1.8.24
@@ -144,5 +150,4 @@ specification_version: 3
144
150
  summary: The plugin library for AuthN and Rails
145
151
  test_files:
146
152
  - test/helper.rb
147
- - test/lib/authn/rails/version_test.rb
148
153
  has_rdoc:
@@ -1,8 +0,0 @@
1
- require 'minitest/autorun'
2
- require_relative '../../../helper'
3
-
4
- class TestAuthNRailsVersion < MiniTest::Unit::TestCase
5
- def test_that_version_is_latest
6
- assert_equal "1.3.2", AuthN::Rails::VERSION
7
- end
8
- end