orthodox 0.3.0 → 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: 616ba8695069097dae8c09c0912d366b2491ea1747d683e91fce2ee86bc91456
4
- data.tar.gz: 05b4176b9a0c81b779ab5ac0490e21437eb3eaec6daad9fa98ce503de0481b4a
3
+ metadata.gz: 3c740d0d444bd2896b459d0bda364d38cef3b9bbe943fe1a012e7deb0114d816
4
+ data.tar.gz: 63d17b2215420e68e9fc7510dad4adeaa4d188017b2c2330349c178d52118328
5
5
  SHA512:
6
- metadata.gz: 436f151edd60aa7a0b8437aa7652d4406f95a78ae9d26aa4b05e0dd5948c86c71baf08225a58162cd50039e62688594ea8a57e433eef4b4459dea42f6b3de0a6
7
- data.tar.gz: da50fc10b1b96d2a1f6b34d5ae13a57b5c9aa25b2cef9c8f9a8e719d7afa4d25595d6261493c913732fd8da36bc7f546cf9791fffe7a1080943ca975b1d361db
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
- private
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
- private :"current_#{model_name}"
95
- private :"current_#{model_name}?"
96
- private :"#{model_name}_signed_in?"
97
- private :"authenticate_#{model_name}"
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
@@ -65,7 +65,7 @@ class <%= class_name %>Session
65
65
  def password_matches
66
66
  return unless <%= singular_name %>
67
67
  unless <%= singular_name %>.authenticate(password)
68
- errors.add(:password, INVALID_CREDENTIALS)
68
+ errors.add(:base, INVALID_CREDENTIALS)
69
69
  end
70
70
  end
71
71
 
@@ -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", plural_file_name, "base_controller.rb")
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.to_s.split("/").first.classify.pluralize
19
+ file_name.camelize
20
20
  end
21
21
 
22
22
  end
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal
2
2
  class <%= namespace_module %>::BaseController < ApplicationController
3
3
 
4
- # layout "<%= plural_file_name %>"
4
+ # layout "<%= file_name %>"
5
5
 
6
6
  # Define methods common to all <%= file_name %> controllers here.
7
7
  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/assets/javascripts/packs",
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
- window.<%= function_name %> = do ->
1
+ init = ->
2
+ # Write your code here...
2
3
 
3
- init = ->
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)
@@ -1,3 +1,3 @@
1
1
  module Orthodox
2
- VERSION = "0.3.0"
2
+ VERSION = "0.3.1"
3
3
  end
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.0
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-11-27 00:00:00.000000000 Z
12
+ date: 2019-12-04 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rails