hero_generator 0.0.1.alpha5 → 0.0.1.alpha6

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.
Files changed (48) hide show
  1. data/lib/generators/hero/authentication/USAGE +8 -0
  2. data/lib/generators/hero/authentication/authentication_generator.rb +107 -0
  3. data/lib/generators/hero/authentication/templates/config/config.yml +22 -0
  4. data/lib/generators/hero/authentication/templates/config/initializers/action_mailer.rb +60 -0
  5. data/lib/generators/hero/authentication/templates/config/initializers/load_config.rb +3 -0
  6. data/lib/generators/hero/authentication/templates/config/locales/en.yml +52 -0
  7. data/lib/generators/hero/authentication/templates/config/routes.rb +29 -0
  8. data/lib/generators/hero/authentication/templates/controllers/application_controller.rb +9 -0
  9. data/lib/generators/hero/authentication/templates/controllers/confirmation_controller.rb +80 -0
  10. data/lib/generators/hero/authentication/templates/controllers/sessions_controller.rb +24 -0
  11. data/lib/generators/hero/authentication/templates/controllers/settings_controller.rb +33 -0
  12. data/lib/generators/hero/authentication/templates/controllers/users_controller.rb +32 -0
  13. data/lib/generators/hero/authentication/templates/mailers/confirmation_mailer.rb +30 -0
  14. data/lib/generators/hero/authentication/templates/migrations/20120213162337_create_users.rb +15 -0
  15. data/lib/generators/hero/authentication/templates/models/authentication.rb +33 -0
  16. data/lib/generators/hero/authentication/templates/models/user.rb +144 -0
  17. data/lib/generators/hero/authentication/templates/tests/spec/controllers/sessions_controller_spec.rb +6 -0
  18. data/lib/generators/hero/authentication/templates/tests/spec/controllers/users_controller_spec.rb +6 -0
  19. data/lib/generators/hero/authentication/templates/tests/spec/factories.rb +20 -0
  20. data/lib/generators/hero/authentication/templates/tests/spec/models/user_spec.rb +154 -0
  21. data/lib/generators/hero/authentication/templates/tests/spec/requests/new_email_request_spec.rb +69 -0
  22. data/lib/generators/hero/authentication/templates/tests/spec/requests/password_resets_spec.rb +58 -0
  23. data/lib/generators/hero/authentication/templates/tests/spec/requests/user_confirmation_spec.rb +61 -0
  24. data/lib/generators/hero/authentication/templates/tests/spec/requests/user_sign_in_spec.rb +13 -0
  25. data/lib/generators/hero/authentication/templates/tests/spec/requests/user_sign_up_spec.rb +55 -0
  26. data/lib/generators/hero/authentication/templates/tests/spec/routing/confirmation_mailer_spec.rb +49 -0
  27. data/lib/generators/hero/authentication/templates/tests/spec/spec_helper.rb +34 -0
  28. data/lib/generators/hero/authentication/templates/tests/spec/support/mailer_macros.rb +10 -0
  29. data/lib/generators/hero/authentication/templates/views/confirmation/new_email_token.html.haml +11 -0
  30. data/lib/generators/hero/authentication/templates/views/confirmation/order_new_password.html.haml +11 -0
  31. data/lib/generators/hero/authentication/templates/views/confirmation/password_token.html.haml +11 -0
  32. data/lib/generators/hero/authentication/templates/views/confirmation/recover_password.html.haml +15 -0
  33. data/lib/generators/hero/authentication/templates/views/confirmation/registration.html.haml +10 -0
  34. data/lib/generators/hero/authentication/templates/views/confirmation/resend_signup_token.html.haml +13 -0
  35. data/lib/generators/hero/authentication/templates/views/confirmation/user_email.html.haml +0 -0
  36. data/lib/generators/hero/authentication/templates/views/confirmation_mailer/new_email_request.text.haml +9 -0
  37. data/lib/generators/hero/authentication/templates/views/confirmation_mailer/registration.text.haml +11 -0
  38. data/lib/generators/hero/authentication/templates/views/confirmation_mailer/resend_signup_token.text.haml +11 -0
  39. data/lib/generators/hero/authentication/templates/views/confirmation_mailer/send_password_reset.text.haml +9 -0
  40. data/lib/generators/hero/authentication/templates/views/sessions/new.html.haml +16 -0
  41. data/lib/generators/hero/authentication/templates/views/settings/index.html.haml +28 -0
  42. data/lib/generators/hero/authentication/templates/views/users/new.html.haml +35 -0
  43. data/lib/generators/hero/hero.rb +28 -0
  44. data/lib/hero_generator/engine.rb +6 -0
  45. data/lib/hero_generator/version.rb +1 -1
  46. metadata +53 -11
  47. data/.gitignore +0 -4
  48. data/hero_generator.gemspec +0 -28
@@ -0,0 +1,11 @@
1
+ %h1 Verify new email request
2
+
3
+ = form_tag new_email_path, {:id => "new_email_token"} do
4
+ %p
5
+ = label_tag :token
6
+ %br
7
+ = text_field_tag :token
8
+
9
+ %p.button
10
+ = submit_tag t( "fe.common.button.send" ), :id => "new_email_token_button"
11
+
@@ -0,0 +1,11 @@
1
+ %h1 Send new Password
2
+
3
+ = form_tag order_new_password_path do
4
+ %p
5
+ = label_tag :email
6
+ %br
7
+ = text_field_tag :email
8
+
9
+ %p.button
10
+ = submit_tag t( "fe.common.button.send" ), :id => "send_new_password_button"
11
+
@@ -0,0 +1,11 @@
1
+ %h1 Recover Password
2
+
3
+ = form_tag recover_password_path do
4
+ %p
5
+ = label_tag :token
6
+ %br
7
+ = text_field_tag :token
8
+
9
+ %p.button
10
+ = submit_tag t( "fe.common.button.send" ), :id => "password_token_button"
11
+
@@ -0,0 +1,15 @@
1
+ %h1 Recover Password
2
+
3
+ = form_tag recover_password_path(@token) do
4
+ %p
5
+ = label_tag :recover_password
6
+ %br
7
+ = password_field_tag :recover_password
8
+ %p
9
+ = label_tag :recover_password_confirmation
10
+ %br
11
+ = password_field_tag :recover_password_confirmation
12
+
13
+ %p.button
14
+ = submit_tag t( "fe.common.button.send" ), :id => "recover_password_button"
15
+
@@ -0,0 +1,10 @@
1
+ = form_tag confirm_path(:registration) do
2
+ %p
3
+ = label_tag :token
4
+ %br
5
+ = text_field_tag :token
6
+ %p
7
+ = submit_tag t( "fe.common.button.send" ), :id => "token_button"
8
+ %p
9
+ = link_to t('fe.confirmation.registration.view.resend_signup_token_link'), resend_signup_token_path, :id => 'resend_signup_token'
10
+
@@ -0,0 +1,13 @@
1
+ %h1 Resend Confirmation
2
+
3
+ = form_tag resend_signup_token_path do
4
+ %p
5
+ = label_tag :email
6
+ %br
7
+ = text_field_tag :email, params[:email]
8
+ %p
9
+ = label_tag :password
10
+ %br
11
+ = password_field_tag :password
12
+ %p.button
13
+ = submit_tag t( "fe.common.button.send" ), :id => "resend_signup_token_button"
@@ -0,0 +1,9 @@
1
+ = t '.greeting'
2
+
3
+ = t '.body'
4
+
5
+ = t '.tokeninfo'
6
+
7
+ = @confirmation_url
8
+
9
+ = t'.footer'
@@ -0,0 +1,11 @@
1
+ = t '.greeting'
2
+
3
+ = t '.body'
4
+
5
+ = @confirmation_url
6
+
7
+ = t '.tokeninfo'
8
+
9
+ = @user.signup_token
10
+
11
+ = t'.footer'
@@ -0,0 +1,11 @@
1
+ = t '.greeting'
2
+
3
+ = t '.body'
4
+
5
+ = @confirmation_url
6
+
7
+ = t '.tokeninfo'
8
+
9
+ = @user.signup_token
10
+
11
+ = t'.footer'
@@ -0,0 +1,9 @@
1
+ = t '.greeting'
2
+
3
+ = t '.body'
4
+
5
+ = t '.tokeninfo'
6
+
7
+ = @confirmation_url
8
+
9
+ = t'.footer'
@@ -0,0 +1,16 @@
1
+ %h1 Login
2
+
3
+ = form_tag sessions_path do
4
+ %p
5
+ = label_tag t( 'fe.session.new.label_email' )
6
+ %br
7
+ = text_field_tag :email, params[:email]
8
+ %p
9
+ = label_tag t( 'fe.session.new.label_password' )
10
+ %br
11
+ = password_field_tag :password
12
+ %p{:class =>"button"}
13
+ = submit_tag t( 'fe.common.button.send' ), :id => 'log_in_button'
14
+
15
+ %p
16
+ = link_to "Passwort vergessen?", order_new_password_path, :id => 'password_forgotten_link'
@@ -0,0 +1,28 @@
1
+ %h2 Email
2
+
3
+ = form_tag(:controller => "settings", :action => "change_user_email") do
4
+
5
+ - if @user.errors.any?
6
+ .error_messages
7
+ %h2
8
+ = "Form is invalid"
9
+ %ul
10
+ - for message in @user.errors.full_messages
11
+ %li
12
+ = message
13
+
14
+ = fields_for @user do |f|
15
+ %p
16
+ = f.label :new_email
17
+ %br
18
+ = f.text_field :new_email
19
+ %p
20
+ = f.label :email_confirmation
21
+ %br
22
+ = f.text_field :new_email_confirmation
23
+ %p
24
+ = f.label :password
25
+ %br
26
+ = f.password_field :password
27
+ %p.button
28
+ = submit_tag t( 'fe.common.button.send' ), :id => 'change_email_button'
@@ -0,0 +1,35 @@
1
+ %h1
2
+ = t( 'fe.user.new.title' )
3
+
4
+
5
+ = form_for @user do |f|
6
+ - if @user.errors.any?
7
+ .error_messages
8
+ %h2
9
+ = "Form is invalid"
10
+ %ul
11
+ - for message in @user.errors.full_messages
12
+ %li
13
+ = message
14
+ %p
15
+ = f.label t( 'fe.user.new.label_email')
16
+ %br
17
+ = f.text_field :email
18
+ %p
19
+ = f.label t( 'fe.user.new.label_password' )
20
+ %br
21
+ = f.password_field :password
22
+ %p
23
+ = f.label t( 'fe.user.new.label_password_confirmation' )
24
+ %br
25
+ = f.password_field :password_confirmation
26
+ %p.button
27
+ = f.submit t( 'fe.common.button.send' ), :id => 'sign_up_button'
28
+
29
+
30
+
31
+
32
+
33
+
34
+
35
+
@@ -0,0 +1,28 @@
1
+ require 'rails/generators/base'
2
+
3
+ module Hero
4
+ module Generators
5
+ class Base < Rails::Generators::Base #:nodoc:
6
+ def self.source_root
7
+ @_hero_source_root ||= File.expand_path(File.join(File.dirname(__FILE__), 'hero', generator_name, 'templates'))
8
+ end
9
+
10
+ def self.banner
11
+ "rails generate hero:#{generator_name} #{self.arguments.map{ |a| a.usage }.join(' ')} [options]"
12
+ end
13
+
14
+ private
15
+
16
+ def add_gem(name, options = {})
17
+ gemfile_content = File.read(destination_path("Gemfile"))
18
+ File.open(destination_path("Gemfile"), 'a') { |f| f.write("\n") } unless gemfile_content =~ /\n\Z/
19
+ gem name, options unless gemfile_content.include? name
20
+ end
21
+
22
+ def print_usage
23
+ self.class.help(Thor::Base.shell.new)
24
+ exit
25
+ end
26
+ end
27
+ end
28
+ end
@@ -0,0 +1,6 @@
1
+ #/lib/gemname/engine.rb
2
+ require 'rails'
3
+ module HeroGenerator
4
+ class Engine < Rails::Engine
5
+ end
6
+ end
@@ -1,3 +1,3 @@
1
1
  module HeroGenerator
2
- VERSION = "0.0.1.alpha5"
2
+ VERSION = "0.0.1.alpha6"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hero_generator
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1.alpha5
4
+ version: 0.0.1.alpha6
5
5
  prerelease: 6
6
6
  platform: ruby
7
7
  authors:
@@ -13,7 +13,7 @@ date: 2012-02-24 00:00:00.000000000Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rspec-rails
16
- requirement: &76926080 !ruby/object:Gem::Requirement
16
+ requirement: &78214100 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ~>
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: '2.6'
22
22
  type: :development
23
23
  prerelease: false
24
- version_requirements: *76926080
24
+ version_requirements: *78214100
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: bcrypt-ruby
27
- requirement: &76925810 !ruby/object:Gem::Requirement
27
+ requirement: &78213840 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ~>
@@ -32,10 +32,10 @@ dependencies:
32
32
  version: 2.1.2
33
33
  type: :development
34
34
  prerelease: false
35
- version_requirements: *76925810
35
+ version_requirements: *78213840
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: rails
38
- requirement: &76925560 !ruby/object:Gem::Requirement
38
+ requirement: &78213590 !ruby/object:Gem::Requirement
39
39
  none: false
40
40
  requirements:
41
41
  - - ~>
@@ -43,7 +43,7 @@ dependencies:
43
43
  version: 3.0.0
44
44
  type: :development
45
45
  prerelease: false
46
- version_requirements: *76925560
46
+ version_requirements: *78213590
47
47
  description: Write a gem description
48
48
  email:
49
49
  - guido@boyke.de
@@ -51,12 +51,54 @@ executables: []
51
51
  extensions: []
52
52
  extra_rdoc_files: []
53
53
  files:
54
- - .gitignore
54
+ - lib/hero_generator/version.rb
55
+ - lib/hero_generator/engine.rb
56
+ - lib/hero_generator.rb
57
+ - lib/generators/hero/authentication/USAGE
58
+ - lib/generators/hero/authentication/authentication_generator.rb
59
+ - lib/generators/hero/authentication/templates/views/sessions/new.html.haml
60
+ - lib/generators/hero/authentication/templates/views/settings/index.html.haml
61
+ - lib/generators/hero/authentication/templates/views/confirmation_mailer/new_email_request.text.haml
62
+ - lib/generators/hero/authentication/templates/views/confirmation_mailer/resend_signup_token.text.haml
63
+ - lib/generators/hero/authentication/templates/views/confirmation_mailer/send_password_reset.text.haml
64
+ - lib/generators/hero/authentication/templates/views/confirmation_mailer/registration.text.haml
65
+ - lib/generators/hero/authentication/templates/views/users/new.html.haml
66
+ - lib/generators/hero/authentication/templates/views/confirmation/password_token.html.haml
67
+ - lib/generators/hero/authentication/templates/views/confirmation/user_email.html.haml
68
+ - lib/generators/hero/authentication/templates/views/confirmation/resend_signup_token.html.haml
69
+ - lib/generators/hero/authentication/templates/views/confirmation/recover_password.html.haml
70
+ - lib/generators/hero/authentication/templates/views/confirmation/order_new_password.html.haml
71
+ - lib/generators/hero/authentication/templates/views/confirmation/new_email_token.html.haml
72
+ - lib/generators/hero/authentication/templates/views/confirmation/registration.html.haml
73
+ - lib/generators/hero/authentication/templates/tests/spec/requests/user_sign_in_spec.rb
74
+ - lib/generators/hero/authentication/templates/tests/spec/requests/user_confirmation_spec.rb
75
+ - lib/generators/hero/authentication/templates/tests/spec/requests/password_resets_spec.rb
76
+ - lib/generators/hero/authentication/templates/tests/spec/requests/new_email_request_spec.rb
77
+ - lib/generators/hero/authentication/templates/tests/spec/requests/user_sign_up_spec.rb
78
+ - lib/generators/hero/authentication/templates/tests/spec/factories.rb
79
+ - lib/generators/hero/authentication/templates/tests/spec/models/user_spec.rb
80
+ - lib/generators/hero/authentication/templates/tests/spec/support/mailer_macros.rb
81
+ - lib/generators/hero/authentication/templates/tests/spec/routing/confirmation_mailer_spec.rb
82
+ - lib/generators/hero/authentication/templates/tests/spec/spec_helper.rb
83
+ - lib/generators/hero/authentication/templates/tests/spec/controllers/sessions_controller_spec.rb
84
+ - lib/generators/hero/authentication/templates/tests/spec/controllers/users_controller_spec.rb
85
+ - lib/generators/hero/authentication/templates/mailers/confirmation_mailer.rb
86
+ - lib/generators/hero/authentication/templates/models/user.rb
87
+ - lib/generators/hero/authentication/templates/models/authentication.rb
88
+ - lib/generators/hero/authentication/templates/config/initializers/action_mailer.rb
89
+ - lib/generators/hero/authentication/templates/config/initializers/load_config.rb
90
+ - lib/generators/hero/authentication/templates/config/config.yml
91
+ - lib/generators/hero/authentication/templates/config/locales/en.yml
92
+ - lib/generators/hero/authentication/templates/config/routes.rb
93
+ - lib/generators/hero/authentication/templates/migrations/20120213162337_create_users.rb
94
+ - lib/generators/hero/authentication/templates/controllers/confirmation_controller.rb
95
+ - lib/generators/hero/authentication/templates/controllers/users_controller.rb
96
+ - lib/generators/hero/authentication/templates/controllers/settings_controller.rb
97
+ - lib/generators/hero/authentication/templates/controllers/application_controller.rb
98
+ - lib/generators/hero/authentication/templates/controllers/sessions_controller.rb
99
+ - lib/generators/hero/hero.rb
55
100
  - Gemfile
56
101
  - Rakefile
57
- - hero_generator.gemspec
58
- - lib/hero_generator.rb
59
- - lib/hero_generator/version.rb
60
102
  homepage: ''
61
103
  licenses: []
62
104
  post_install_message:
data/.gitignore DELETED
@@ -1,4 +0,0 @@
1
- *.gem
2
- .bundle
3
- Gemfile.lock
4
- pkg/*
@@ -1,28 +0,0 @@
1
- # -*- encoding: utf-8 -*-
2
- $:.push File.expand_path("../lib", __FILE__)
3
- require "hero_generator/version"
4
-
5
- Gem::Specification.new do |s|
6
- s.name = "hero_generator"
7
- s.version = HeroGenerator::VERSION
8
- s.authors = ["Guido Boyke"]
9
- s.email = ["guido@boyke.de"]
10
- s.homepage = ""
11
- s.summary = %q{Authentication for new projects}
12
- s.description = %q{Write a gem description}
13
-
14
- s.rubyforge_project = "hero_generator"
15
-
16
- s.files = Dir["{lib}/**/*", "[A-Z]*"]
17
- s.require_path = "lib"
18
-
19
- s.files = `git ls-files`.split("\n")
20
- s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
21
- s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
22
- s.require_paths = ["lib"]
23
-
24
- s.add_development_dependency "rspec-rails", "~> 2.6"
25
- s.add_development_dependency 'bcrypt-ruby', '~> 2.1.2'
26
- s.add_development_dependency 'rails', '~> 3.0.0'
27
-
28
- end