orthodox 0.3.0 → 0.3.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/generators/authentication/authentication_generator.rb +4 -1
- data/lib/generators/authentication/templates/controllers/concerns/authentication.rb.erb +5 -5
- data/lib/generators/authentication/templates/models/session.rb.erb +1 -1
- data/lib/generators/base_controller/base_controller_generator.rb +2 -2
- data/lib/generators/base_controller/templates/base_controller.rb.erb +1 -1
- data/lib/generators/coffeescript/coffeescript_generator.rb +2 -8
- data/lib/generators/coffeescript/templates/coffeescript.coffee.erb +3 -14
- data/lib/orthodox/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3c740d0d444bd2896b459d0bda364d38cef3b9bbe943fe1a012e7deb0114d816
|
4
|
+
data.tar.gz: 63d17b2215420e68e9fc7510dad4adeaa4d188017b2c2330349c178d52118328
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 891bdc496f65fb89d4731384fac358a1d0b928da22f44dc046a08d0a79743261613872d4a561c9c8cfb879667e89ea33384e93692d2806060f6294a06f510b02
|
7
|
+
data.tar.gz: 37a7304318cefc33c5a110a3744b5333d1973fd0d94341be24b0fade681602cb0071e6eed7b21ccc83499488807738e4082a3ca2201229528436cf7c6581f4b8
|
@@ -9,6 +9,9 @@ class AuthenticationGenerator < Rails::Generators::NamedBase
|
|
9
9
|
|
10
10
|
class_option :two_factor, type: :boolean, default: false
|
11
11
|
|
12
|
+
class_option :js, type: :boolean, default: false
|
13
|
+
|
14
|
+
|
12
15
|
def create_controllers
|
13
16
|
generate "base_controller", class_name
|
14
17
|
template "controllers/sessions_controller.rb.erb",
|
@@ -40,7 +43,7 @@ class AuthenticationGenerator < Rails::Generators::NamedBase
|
|
40
43
|
end
|
41
44
|
|
42
45
|
def ensure_js
|
43
|
-
if options[:two_factor]
|
46
|
+
if options[:two_factor] && options[:js]
|
44
47
|
copy_file "javascript/tfa_forms.js", "app/javascript/packs/tfa_forms.js"
|
45
48
|
end
|
46
49
|
end
|
@@ -8,7 +8,7 @@ module Authentication
|
|
8
8
|
|
9
9
|
extend ActiveSupport::Concern
|
10
10
|
|
11
|
-
|
11
|
+
protected
|
12
12
|
|
13
13
|
# Sign in a given record as a given type
|
14
14
|
#
|
@@ -91,10 +91,10 @@ module Authentication
|
|
91
91
|
helper_method :"current_#{model_name}?"
|
92
92
|
helper_method :"#{model_name}_signed_in?"
|
93
93
|
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
94
|
+
protected :"current_#{model_name}"
|
95
|
+
protected :"current_#{model_name}?"
|
96
|
+
protected :"#{model_name}_signed_in?"
|
97
|
+
protected :"authenticate_#{model_name}"
|
98
98
|
|
99
99
|
<%- if options[:two_factor] -%>
|
100
100
|
# This is included if the authentication generator is run with --two-factor=true
|
@@ -9,14 +9,14 @@ class BaseControllerGenerator < Rails::Generators::NamedBase
|
|
9
9
|
|
10
10
|
def ensure_file
|
11
11
|
template "base_controller.rb.erb",
|
12
|
-
File.join("app", "controllers",
|
12
|
+
File.join("app", "controllers", file_name, "base_controller.rb")
|
13
13
|
end
|
14
14
|
|
15
15
|
private
|
16
16
|
|
17
17
|
|
18
18
|
def namespace_module
|
19
|
-
file_name.
|
19
|
+
file_name.camelize
|
20
20
|
end
|
21
21
|
|
22
22
|
end
|
@@ -3,8 +3,7 @@ class CoffeescriptGenerator < Rails::Generators::NamedBase
|
|
3
3
|
|
4
4
|
source_root File.expand_path('../templates', __FILE__)
|
5
5
|
|
6
|
-
desc "This generator creates a coffee script file at"
|
7
|
-
" app/assets/javascripts/partials"
|
6
|
+
desc "This generator creates a coffee script file at app/javascript/packs"
|
8
7
|
|
9
8
|
argument :functions, type: :array, default: [],
|
10
9
|
banner: "functionOne functionTwo"
|
@@ -24,13 +23,8 @@ class CoffeescriptGenerator < Rails::Generators::NamedBase
|
|
24
23
|
file_name.camelize(:lower)
|
25
24
|
end
|
26
25
|
|
27
|
-
def partial_file_name
|
28
|
-
"_#{file_name}"
|
29
|
-
end
|
30
|
-
|
31
26
|
def file_path
|
32
|
-
Rails.root.join("app/
|
33
|
-
partial_file_name + ".coffee")
|
27
|
+
Rails.root.join("app/javascript/packs", namespace_path, "#{file_name}.coffee")
|
34
28
|
end
|
35
29
|
|
36
30
|
def namespace_path
|
@@ -1,15 +1,4 @@
|
|
1
|
-
|
1
|
+
init = ->
|
2
|
+
# Write your code here...
|
2
3
|
|
3
|
-
|
4
|
-
# Write your code here...
|
5
|
-
|
6
|
-
<%- functions.each do |functionName| %>
|
7
|
-
<%= functionName.camelize(:lower) %> = ->
|
8
|
-
# Write your function here...
|
9
|
-
<%- end -%>
|
10
|
-
|
11
|
-
# Add any functions you'd like to make public here:
|
12
|
-
return { init }
|
13
|
-
|
14
|
-
# Optionally: Call init on jQuery load
|
15
|
-
# jQuery <%= function_name %>.init
|
4
|
+
jQuery(init)
|
data/lib/orthodox/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: orthodox
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Bodacious
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: exe
|
11
11
|
cert_chain: []
|
12
|
-
date: 2019-
|
12
|
+
date: 2019-12-04 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rails
|