merbful_authentication 0.1.0 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/README +1 -1
- data/Rakefile +4 -3
- data/merb_default_generators/merbful_authentication_model/merbful_authentication_model_generator.rb +55 -0
- data/merb_generators/{authentication → authenticated}/USAGE +0 -0
- data/merb_generators/{authentication/authentication_generator.rb → authenticated/authenticated_generator.rb} +15 -14
- data/merb_generators/{authentication → authenticated}/templates/activation.html.erb +0 -0
- data/merb_generators/{authentication → authenticated}/templates/activation.text.erb +0 -0
- data/merb_generators/{authentication → authenticated}/templates/authenticated_system_controller.rb +0 -0
- data/merb_generators/{authentication → authenticated}/templates/authenticated_system_model.rb +0 -0
- data/merb_generators/{authentication → authenticated}/templates/login.html.erb +0 -0
- data/merb_generators/{authentication → authenticated}/templates/mail_controller.rb +0 -0
- data/merb_generators/{authentication → authenticated}/templates/model_controller.rb +0 -0
- data/merb_generators/{authentication → authenticated}/templates/new_model.html.erb +0 -0
- data/merb_generators/{authentication → authenticated}/templates/session_controller.rb +0 -0
- data/merb_generators/{authentication → authenticated}/templates/signup.html.erb +0 -0
- data/merb_generators/{authentication → authenticated}/templates/signup.text.erb +0 -0
- data/sequel_generators/merbful_authentication_model/merbful_authentication_model_generator.rb +53 -0
- metadata +24 -19
- data/test_unit_generators/merbful_authentication_tests/USAGE +0 -5
data/README
CHANGED
@@ -22,7 +22,7 @@ the controller that handles the actual login/logout function on the
|
|
22
22
|
site.
|
23
23
|
|
24
24
|
The third parameter (--include-activation) generates the code for a
|
25
|
-
|
25
|
+
Mailer and the required support code. Don't forget to setup your mailer for this.
|
26
26
|
|
27
27
|
=== Currently supported ORMs
|
28
28
|
Active Record
|
data/Rakefile
CHANGED
@@ -3,7 +3,7 @@ require 'rake/gempackagetask'
|
|
3
3
|
|
4
4
|
PLUGIN = "merbful_authentication"
|
5
5
|
NAME = "merbful_authentication"
|
6
|
-
VERSION = "0.1.
|
6
|
+
VERSION = "0.1.1"
|
7
7
|
AUTHOR = "Daniel Neighman"
|
8
8
|
EMAIL = "has.sox@gmail.com"
|
9
9
|
HOMEPAGE = "http://rubyforge.org/projects/merbful-auth/"
|
@@ -20,10 +20,11 @@ spec = Gem::Specification.new do |s|
|
|
20
20
|
s.author = AUTHOR
|
21
21
|
s.email = EMAIL
|
22
22
|
s.homepage = HOMEPAGE
|
23
|
-
s.add_dependency('merb', '>= 0.
|
23
|
+
s.add_dependency('merb', '>= 0.5.0')
|
24
24
|
s.require_path = 'lib'
|
25
25
|
s.autorequire = PLUGIN
|
26
|
-
s.files = %w(LICENSE README Rakefile TODO) +
|
26
|
+
s.files = %w(LICENSE README Rakefile TODO) +
|
27
|
+
Dir.glob("{lib,specs,merb_generators,datamapper_generators,activerecord_generators,merb_default_generators,sequel_generators,rspec_generators,test_unit_generators}/**/*")
|
27
28
|
end
|
28
29
|
|
29
30
|
Rake::GemPackageTask.new(spec) do |pkg|
|
data/merb_default_generators/merbful_authentication_model/merbful_authentication_model_generator.rb
ADDED
@@ -0,0 +1,55 @@
|
|
1
|
+
class MerbfulAuthenticationModelGenerator < RubiGen::Base
|
2
|
+
|
3
|
+
default_options :author => nil
|
4
|
+
|
5
|
+
attr_reader :name
|
6
|
+
|
7
|
+
def initialize(runtime_args, runtime_options = {})
|
8
|
+
super
|
9
|
+
usage if args.empty?
|
10
|
+
@name = args.shift
|
11
|
+
extract_options
|
12
|
+
end
|
13
|
+
|
14
|
+
def manifest
|
15
|
+
record do |m|
|
16
|
+
# Exit out because there should be an orm present
|
17
|
+
puts "\n"
|
18
|
+
puts "-" * 70
|
19
|
+
puts "\nThere is no ORM selected. merbful_authentication requires there to be an ORM present."
|
20
|
+
puts "\nSelect and ORM in config/dependencies.rb"
|
21
|
+
puts "\ne.g."
|
22
|
+
puts "use_orm :datamapper"
|
23
|
+
puts "\n"
|
24
|
+
puts "-" * 70
|
25
|
+
exit
|
26
|
+
end
|
27
|
+
end
|
28
|
+
|
29
|
+
protected
|
30
|
+
def banner
|
31
|
+
<<-EOS
|
32
|
+
Creates a ...
|
33
|
+
|
34
|
+
USAGE: #{$0} #{spec.name} name"
|
35
|
+
EOS
|
36
|
+
end
|
37
|
+
|
38
|
+
def add_options!(opts)
|
39
|
+
# opts.separator ''
|
40
|
+
# opts.separator 'Options:'
|
41
|
+
# For each option below, place the default
|
42
|
+
# at the top of the file next to "default_options"
|
43
|
+
# opts.on("-a", "--author=\"Your Name\"", String,
|
44
|
+
# "Some comment about this option",
|
45
|
+
# "Default: none") { |options[:author]| }
|
46
|
+
# opts.on("-v", "--version", "Show the #{File.basename($0)} version number and quit.")
|
47
|
+
end
|
48
|
+
|
49
|
+
def extract_options
|
50
|
+
# for each option, extract it into a local variable (and create an "attr_reader :author" at the top)
|
51
|
+
# Templates can access these value via the attr_reader-generated methods, but not the
|
52
|
+
# raw instance variable value.
|
53
|
+
# @author = options[:author]
|
54
|
+
end
|
55
|
+
end
|
File without changes
|
@@ -1,5 +1,5 @@
|
|
1
1
|
require 'merb'
|
2
|
-
class
|
2
|
+
class AuthenticatedGenerator < RubiGen::Base
|
3
3
|
|
4
4
|
default_options :author => nil
|
5
5
|
|
@@ -75,6 +75,20 @@ class AuthenticationGenerator < RubiGen::Base
|
|
75
75
|
m.class_collisions class_path, "#{class_name}", "#{class_name}Mailer"# , "#{class_name}MailerTest", "#{class_name}Observer"
|
76
76
|
m.class_collisions [], 'AuthenticatedSystem::Controller', 'AuthenticatedSystem::Model'
|
77
77
|
|
78
|
+
# Generate the model first. These can then throw an error when generating if there is no ORM present
|
79
|
+
model_attributes = {
|
80
|
+
:class_name => class_name,
|
81
|
+
:class_path => class_path,
|
82
|
+
:file_name => file_name,
|
83
|
+
:class_nesting => class_nesting,
|
84
|
+
:class_nesting_depth => class_nesting_depth,
|
85
|
+
:plural_name => plural_name,
|
86
|
+
:singular_name => singular_name,
|
87
|
+
:include_activation => options[:include_activation]
|
88
|
+
}
|
89
|
+
m.dependency "merbful_authentication_model", [name], model_attributes
|
90
|
+
|
91
|
+
|
78
92
|
# Controller, helper, views, and test directories.
|
79
93
|
|
80
94
|
m.directory File.join('app/controllers', controller_class_path)
|
@@ -106,19 +120,6 @@ class AuthenticationGenerator < RubiGen::Base
|
|
106
120
|
end
|
107
121
|
end
|
108
122
|
|
109
|
-
# Generate the model
|
110
|
-
model_attributes = {
|
111
|
-
:class_name => class_name,
|
112
|
-
:class_path => class_path,
|
113
|
-
:file_name => file_name,
|
114
|
-
:class_nesting => class_nesting,
|
115
|
-
:class_nesting_depth => class_nesting_depth,
|
116
|
-
:plural_name => plural_name,
|
117
|
-
:singular_name => singular_name,
|
118
|
-
:include_activation => options[:include_activation]
|
119
|
-
}
|
120
|
-
m.dependency "merbful_authentication_model", [name], model_attributes
|
121
|
-
|
122
123
|
# Generate the sessions controller
|
123
124
|
m.template "session_controller.rb", File.join('app/controllers',
|
124
125
|
controller_class_path,
|
File without changes
|
File without changes
|
data/merb_generators/{authentication → authenticated}/templates/authenticated_system_controller.rb
RENAMED
File without changes
|
data/merb_generators/{authentication → authenticated}/templates/authenticated_system_model.rb
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
@@ -0,0 +1,53 @@
|
|
1
|
+
class MerbfulAuthenticationModelGenerator < RubiGen::Base
|
2
|
+
|
3
|
+
default_options :author => nil
|
4
|
+
|
5
|
+
attr_reader :name
|
6
|
+
|
7
|
+
def initialize(runtime_args, runtime_options = {})
|
8
|
+
super
|
9
|
+
usage if args.empty?
|
10
|
+
@name = args.shift
|
11
|
+
extract_options
|
12
|
+
end
|
13
|
+
|
14
|
+
def manifest
|
15
|
+
record do |m|
|
16
|
+
# Exit out because sequel is not yet supported.
|
17
|
+
# For anyone who want to implement sequel, the model, and ORM map lib are the only files that should
|
18
|
+
# need to be updated. Some of the specs may need to change sytnax to pass though.
|
19
|
+
puts "\n"
|
20
|
+
puts "-" * 70
|
21
|
+
puts "\nThe sequel ORM is not yet supported in merbful_authentication. Please select another ORM.\n"
|
22
|
+
puts "-" * 70
|
23
|
+
exit
|
24
|
+
end
|
25
|
+
end
|
26
|
+
|
27
|
+
protected
|
28
|
+
def banner
|
29
|
+
<<-EOS
|
30
|
+
Creates a ...
|
31
|
+
|
32
|
+
USAGE: #{$0} #{spec.name} name"
|
33
|
+
EOS
|
34
|
+
end
|
35
|
+
|
36
|
+
def add_options!(opts)
|
37
|
+
# opts.separator ''
|
38
|
+
# opts.separator 'Options:'
|
39
|
+
# For each option below, place the default
|
40
|
+
# at the top of the file next to "default_options"
|
41
|
+
# opts.on("-a", "--author=\"Your Name\"", String,
|
42
|
+
# "Some comment about this option",
|
43
|
+
# "Default: none") { |options[:author]| }
|
44
|
+
# opts.on("-v", "--version", "Show the #{File.basename($0)} version number and quit.")
|
45
|
+
end
|
46
|
+
|
47
|
+
def extract_options
|
48
|
+
# for each option, extract it into a local variable (and create an "attr_reader :author" at the top)
|
49
|
+
# Templates can access these value via the attr_reader-generated methods, but not the
|
50
|
+
# raw instance variable value.
|
51
|
+
# @author = options[:author]
|
52
|
+
end
|
53
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: merbful_authentication
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Daniel Neighman
|
@@ -9,7 +9,7 @@ autorequire: merbful_authentication
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2008-01-
|
12
|
+
date: 2008-01-07 00:00:00 +11:00
|
13
13
|
default_executable:
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
@@ -19,7 +19,7 @@ dependencies:
|
|
19
19
|
requirements:
|
20
20
|
- - ">="
|
21
21
|
- !ruby/object:Gem::Version
|
22
|
-
version: 0.
|
22
|
+
version: 0.5.0
|
23
23
|
version:
|
24
24
|
description: A Merb plugin that is essentially a port of Rick Olsons restful_authentication plugin for rails
|
25
25
|
email: has.sox@gmail.com
|
@@ -39,21 +39,21 @@ files:
|
|
39
39
|
- lib/merbful_authentication
|
40
40
|
- lib/merbful_authentication/merbtasks.rb
|
41
41
|
- lib/merbful_authentication.rb
|
42
|
-
- merb_generators/
|
43
|
-
- merb_generators/
|
44
|
-
- merb_generators/
|
45
|
-
- merb_generators/
|
46
|
-
- merb_generators/
|
47
|
-
- merb_generators/
|
48
|
-
- merb_generators/
|
49
|
-
- merb_generators/
|
50
|
-
- merb_generators/
|
51
|
-
- merb_generators/
|
52
|
-
- merb_generators/
|
53
|
-
- merb_generators/
|
54
|
-
- merb_generators/
|
55
|
-
- merb_generators/
|
56
|
-
- merb_generators/
|
42
|
+
- merb_generators/authenticated
|
43
|
+
- merb_generators/authenticated/authenticated_generator.rb
|
44
|
+
- merb_generators/authenticated/templates
|
45
|
+
- merb_generators/authenticated/templates/activation.html.erb
|
46
|
+
- merb_generators/authenticated/templates/activation.text.erb
|
47
|
+
- merb_generators/authenticated/templates/authenticated_system_controller.rb
|
48
|
+
- merb_generators/authenticated/templates/authenticated_system_model.rb
|
49
|
+
- merb_generators/authenticated/templates/login.html.erb
|
50
|
+
- merb_generators/authenticated/templates/mail_controller.rb
|
51
|
+
- merb_generators/authenticated/templates/model_controller.rb
|
52
|
+
- merb_generators/authenticated/templates/new_model.html.erb
|
53
|
+
- merb_generators/authenticated/templates/session_controller.rb
|
54
|
+
- merb_generators/authenticated/templates/signup.html.erb
|
55
|
+
- merb_generators/authenticated/templates/signup.text.erb
|
56
|
+
- merb_generators/authenticated/USAGE
|
57
57
|
- datamapper_generators/merbful_authentication_model
|
58
58
|
- datamapper_generators/merbful_authentication_model/merbful_authentication_model_generator.rb
|
59
59
|
- datamapper_generators/merbful_authentication_model/templates
|
@@ -65,6 +65,12 @@ files:
|
|
65
65
|
- activerecord_generators/merbful_authentication_model/templates/authenticated_system_orm_map.rb
|
66
66
|
- activerecord_generators/merbful_authentication_model/templates/migration.rb
|
67
67
|
- activerecord_generators/merbful_authentication_model/templates/model.rb
|
68
|
+
- merb_default_generators/merbful_authentication_model
|
69
|
+
- merb_default_generators/merbful_authentication_model/merbful_authentication_model_generator.rb
|
70
|
+
- merb_default_generators/merbful_authentication_model/templates
|
71
|
+
- sequel_generators/merbful_authentication_model
|
72
|
+
- sequel_generators/merbful_authentication_model/merbful_authentication_model_generator.rb
|
73
|
+
- sequel_generators/merbful_authentication_model/templates
|
68
74
|
- rspec_generators/merbful_authentication_tests
|
69
75
|
- rspec_generators/merbful_authentication_tests/merbful_authentication_tests_generator.rb
|
70
76
|
- rspec_generators/merbful_authentication_tests/templates
|
@@ -83,7 +89,6 @@ files:
|
|
83
89
|
- test_unit_generators/merbful_authentication_tests/templates/model_functional_test.rb
|
84
90
|
- test_unit_generators/merbful_authentication_tests/templates/model_test_helper.rb
|
85
91
|
- test_unit_generators/merbful_authentication_tests/templates/unit_test.rb
|
86
|
-
- test_unit_generators/merbful_authentication_tests/USAGE
|
87
92
|
has_rdoc: true
|
88
93
|
homepage: http://rubyforge.org/projects/merbful-auth/
|
89
94
|
post_install_message:
|