registration_generator 0.2.3 → 0.3.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2a2a35d84abdf9d03faa0a14b04d5d1f0406a07f528f802208c4c6fe284a81e3
4
- data.tar.gz: 24a081cf173a4a5d666e6a49ec1a059732b82d587961d50c1c8f3f0f63f25a0b
3
+ metadata.gz: 94904540bd185fcff1ca6e6ce29bca6cbb12a24a19f8e40af9e6a88bf5c1d393
4
+ data.tar.gz: e2b854ed675921de2338e1b3d88170d7ba19a626c93f15821ec105e9c79fa8b9
5
5
  SHA512:
6
- metadata.gz: be7d79e45664805538ea908ac7a83e12d159ca785466154be8e1f8c0ebf202205cd633f15be3b8e9ec2cbdabda3b3aba5bea09ccf053ccc11925dd49745b7a0f
7
- data.tar.gz: 959bf0d36ddd803c952eda88f70b89661775950c29b66762262ea68bf370e0aa4edcb4c57af07364bfe281cebee8e67501a22fecdf9b5eab2bf025b018c652cf
6
+ metadata.gz: 97c5e15965347378ab9c66dabaa836b631d1a28fc0de99130dc5884a45df7ba47f46baddc2039d0ee7ce04042364b0cef681cc30eca1eae10b2a21afccdaa176
7
+ data.tar.gz: c40a5b269e783a0c5f917d75fbc64e72f363a1593423bb62701719e44442365c332dee94917c5d1733f43beac57ac0f5e51b48a0191280a266d3b0657ab356da
@@ -22,41 +22,41 @@ module Registration
22
22
  route "get 'sign_in', to: 'session#new', as :sign_in"
23
23
  route "delete 'sign_out', to: 'session#destroy', as :sign_out"
24
24
  end
25
- end
26
-
27
- def create_helper
28
- create_file "app/helpers/authentication_helper.rb", <<-RUBY
29
- module AuthenticationHelper
30
- def link_to_sign_in_or_out(show_user: false)
31
- if authenticated?
32
- button_to "Sign Out", sign_out_path, method: :delete
33
- else
34
- link_to "Sign In", sign_in_path
25
+
26
+ def create_helper
27
+ create_file "app/helpers/authentication_helper.rb", <<-RUBY
28
+ module AuthenticationHelper
29
+ def link_to_sign_in_or_out(show_user: false)
30
+ if authenticated?
31
+ button_to "Sign Out", sign_out_path, method: :delete
32
+ else
33
+ link_to "Sign In", sign_in_path
34
+ end
35
+ end
36
+
37
+ def show_username_if_signed_in(text="Signed in as")
38
+ if authenticated?
39
+ content = "#{text} #{Current.user.name}"
40
+ content.html_safe
41
+ end
42
+ end
35
43
  end
44
+ RUBY
45
+
46
+ inject_into_class "app/controllers/application_controller.rb", ApplicationController, <<-RUBY
47
+
48
+ include AuthenticationHelper
49
+ RUBY
36
50
  end
37
51
 
38
- def show_username_if_signed_in(text="Signed in as")
39
- if authenticated?
40
- content = "#{text} #{Current.user.name}"
41
- content.html_safe
52
+ def add_name_method_to_user
53
+ inject_into_class "app/models/user.rb", User, <<-RUBY
54
+
55
+ def name
56
+ email_address
42
57
  end
58
+
59
+ RUBY
43
60
  end
44
61
  end
45
- RUBY
46
-
47
- inject_into_class "app/controllers/application_controller.rb", ApplicationController, <<-RUBY
48
-
49
- include AuthenticationHelper
50
- RUBY
51
- end
52
-
53
- def add_name_method_to_user
54
- inject_into_class "app/models/user.rb", User, <<-RUBY
55
-
56
- def name
57
- email_address
58
- end
59
-
60
- RUBY
61
- end
62
62
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module RegistrationGenerator
4
- VERSION = "0.2.3"
4
+ VERSION = "0.3.1"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: registration_generator
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.3
4
+ version: 0.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - DAZ