merbful_authentication 0.9.1 → 0.9.2

Sign up to get free protection for your applications and to get access to all the features.
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.9.1"
6
+ VERSION = "0.9.2"
7
7
  AUTHOR = "Daniel Neighman"
8
8
  EMAIL = "has.sox@gmail.com"
9
9
  HOMEPAGE = "http://rubyforge.org/projects/merbful-auth/"
@@ -3,7 +3,7 @@ class MerbfulAuthenticationModelGenerator < Merb::GeneratorBase
3
3
  attr_reader :name,
4
4
  :class_name,
5
5
  :class_path,
6
- :file_name,
6
+ :model_file_name,
7
7
  :class_nesting,
8
8
  :class_nesting_depth,
9
9
  :plural_name,
@@ -35,7 +35,7 @@ class MerbfulAuthenticationModelGenerator < Merb::GeneratorBase
35
35
  :name => name,
36
36
  :class_name => class_name,
37
37
  :class_path => class_path,
38
- :file_name => file_name,
38
+ :model_file_name => model_file_name,
39
39
  :class_nesting => class_nesting,
40
40
  :class_nesting_depth => class_nesting_depth,
41
41
  :plural_name => plural_name,
@@ -3,7 +3,7 @@ class MerbfulAuthenticationModelGenerator < Merb::GeneratorBase
3
3
  attr_reader :name,
4
4
  :class_name,
5
5
  :class_path,
6
- :file_name,
6
+ :model_file_name,
7
7
  :class_nesting,
8
8
  :class_nesting_depth,
9
9
  :plural_name,
@@ -27,7 +27,7 @@ class MerbfulAuthenticationModelGenerator < Merb::GeneratorBase
27
27
  :name => name,
28
28
  :class_name => class_name,
29
29
  :class_path => class_path,
30
- :file_name => file_name,
30
+ :model_file_name => model_file_name,
31
31
  :class_nesting => class_nesting,
32
32
  :class_nesting_depth => class_nesting_depth,
33
33
  :plural_name => plural_name,
@@ -5,7 +5,7 @@ class AuthenticatedGenerator < Merb::GeneratorBase
5
5
  attr_reader :name,
6
6
  :class_name,
7
7
  :class_path,
8
- :file_name,
8
+ :model_file_name,
9
9
  :class_nesting,
10
10
  :class_nesting_depth,
11
11
  :plural_name,
@@ -89,7 +89,7 @@ class AuthenticatedGenerator < Merb::GeneratorBase
89
89
  @assigns = {
90
90
  :class_name => class_name,
91
91
  :class_path => class_path,
92
- :file_name => file_name,
92
+ :model_file_name => model_file_name,
93
93
  :class_nesting => class_nesting,
94
94
  :class_nesting_depth => class_nesting_depth,
95
95
  :plural_name => plural_name,
@@ -218,7 +218,7 @@ END
218
218
 
219
219
  def assign_names!(name)
220
220
  @name = name.singularize
221
- base_name, @class_path, @file_name, @class_nesting, @class_nesting_depth = extract_modules(@name)
221
+ base_name, @class_path, @model_file_name, @class_nesting, @class_nesting_depth = extract_modules(@name)
222
222
  @class_name_without_nesting, @singular_name, @plural_name = inflect_names(base_name)
223
223
  @table_name = @name.pluralize
224
224
  # @table_name = (!defined?(ActiveRecord::Base) || ActiveRecord::Base.pluralize_table_names) ? plural_name : singular_name
@@ -5,8 +5,11 @@ module AuthenticatedSystem
5
5
  Merb::Router.prepend do |r|
6
6
  r.match("/login").to(:controller => "<%= controller_class_name %>", :action => "create").name(:login)
7
7
  r.match("/logout").to(:controller => "<%= controller_class_name %>", :action => "destroy").name(:logout)
8
+ <% if include_activation -%>
8
9
  r.match("/<%= plural_name %>/activate/:activation_code").to(:controller => "<%= model_controller_class_name %>", :action => "activate").name(:<%= singular_name %>_activation)
9
- r.resources :users
10
+ <% end -%>
11
+ r.resources :<%= plural_name %>
12
+ r.resources :<%= controller_singular_name %>
10
13
  end
11
14
  end
12
15
  end
@@ -2,7 +2,7 @@ class MerbfulAuthenticationTestsGenerator < Merb::GeneratorBase
2
2
  attr_reader :name,
3
3
  :class_name,
4
4
  :class_path,
5
- :file_name,
5
+ :model_file_name,
6
6
  :class_nesting,
7
7
  :class_nesting_depth,
8
8
  :plural_name,
@@ -46,7 +46,7 @@ class MerbfulAuthenticationTestsGenerator < Merb::GeneratorBase
46
46
  :name => name,
47
47
  :class_name => class_name,
48
48
  :class_path => class_path,
49
- :file_name => file_name,
49
+ :model_file_name => model_file_name,
50
50
  :class_nesting => class_nesting,
51
51
  :class_nesting_depth => class_nesting_depth,
52
52
  :plural_name => plural_name,
@@ -3,7 +3,7 @@ class MerbfulAuthenticationTestsGenerator < Merb::GeneratorBase
3
3
  attr_reader :name,
4
4
  :class_name,
5
5
  :class_path,
6
- :file_name,
6
+ :model_file_name,
7
7
  :class_nesting,
8
8
  :class_nesting_depth,
9
9
  :plural_name,
@@ -55,7 +55,7 @@ class MerbfulAuthenticationTestsGenerator < Merb::GeneratorBase
55
55
  :name => name,
56
56
  :class_name => class_name,
57
57
  :class_path => class_path,
58
- :file_name => file_name,
58
+ :model_file_name => model_file_name,
59
59
  :class_nesting => class_nesting,
60
60
  :class_nesting_depth => class_nesting_depth,
61
61
  :plural_name => plural_name,
@@ -35,14 +35,14 @@ class <%= controller_class_name %>ControllerTest < Test::Unit::TestCase
35
35
  def test_should_fail_login_and_not_redirect
36
36
  @controller.params.merge!(:login => 'quentin', :password => 'bad password')
37
37
  @controller._dispatch(:create)
38
- assert_nil @controller.session[:<%= file_name %>]
38
+ assert_nil @controller.session[:<%= model_file_name %>]
39
39
  assert_response :success
40
40
  end
41
41
 
42
42
  def test_should_logout
43
43
  login_as :quentin
44
44
  @controller._dispatch(:destroy)
45
- assert_nil @controller.session[:<%= file_name %>]
45
+ assert_nil @controller.session[:<%= model_file_name %>]
46
46
  assert_response :redirect
47
47
  end
48
48
 
@@ -15,39 +15,39 @@ class <%= model_controller_class_name %>Test < Test::Unit::TestCase
15
15
 
16
16
  def test_should_allow_signup
17
17
  assert_difference '<%= class_name %>.count', 1 do
18
- create_<%= file_name %>
18
+ create_<%= model_file_name %>
19
19
  assert_equal 302, @controller.status
20
20
  end
21
21
  end
22
22
 
23
23
  def test_should_require_login_on_signup
24
24
  assert_no_difference '<%= class_name %>.count' do
25
- create_<%= file_name %>(:login => nil)
26
- assert @controller.assigns(:<%= file_name %>).errors.on(:login)
25
+ create_<%= model_file_name %>(:login => nil)
26
+ assert @controller.assigns(:<%= model_file_name %>).errors.on(:login)
27
27
  assert_response :success
28
28
  end
29
29
  end
30
30
 
31
31
  def test_should_require_password_on_signup
32
32
  assert_no_difference '<%= class_name %>.count' do
33
- create_<%= file_name %>(:password => nil)
34
- assert @controller.assigns(:<%= file_name %>).errors.on(:password)
33
+ create_<%= model_file_name %>(:password => nil)
34
+ assert @controller.assigns(:<%= model_file_name %>).errors.on(:password)
35
35
  assert_response :success
36
36
  end
37
37
  end
38
38
 
39
39
  def test_should_require_password_confirmation_on_signup
40
40
  assert_no_difference '<%= class_name %>.count' do
41
- create_<%= file_name %>(:password_confirmation => nil)
42
- assert @controller.assigns(:<%= file_name %>).errors.on(:password_confirmation)
41
+ create_<%= model_file_name %>(:password_confirmation => nil)
42
+ assert @controller.assigns(:<%= model_file_name %>).errors.on(:password_confirmation)
43
43
  assert_response :success
44
44
  end
45
45
  end
46
46
 
47
47
  def test_should_require_email_on_signup
48
48
  assert_no_difference '<%= class_name %>.count' do
49
- create_<%= file_name %>(:email => nil)
50
- assert @controller.assigns(:<%= file_name %>).errors.on(:email)
49
+ create_<%= model_file_name %>(:email => nil)
50
+ assert @controller.assigns(:<%= model_file_name %>).errors.on(:email)
51
51
  assert_response :success
52
52
  end
53
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.9.1
4
+ version: 0.9.2
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-03-05 00:00:00 +11:00
12
+ date: 2008-03-26 00:00:00 +11:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency