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.
- data/lib/authn/activation.rb +9 -0
- data/lib/authn/activation/actionmailer.rb +12 -0
- data/lib/authn/config.rb +6 -0
- data/lib/authn/rails/version.rb +1 -1
- data/lib/authn/session.rb +9 -0
- data/lib/generators/authn/USAGE +14 -0
- data/lib/generators/authn/install_generator.rb +38 -0
- data/lib/generators/authn/templates/initializer.rb +10 -0
- metadata +11 -6
- data/test/lib/authn/rails/version_test.rb +0 -8
data/lib/authn/config.rb
ADDED
data/lib/authn/rails/version.rb
CHANGED
@@ -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
|
+
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-
|
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:
|
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:
|
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:
|