hmvc-rails 1.0.1 → 1.0.2
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 +4 -4
- data/Gemfile.lock +35 -32
- data/README.md +1 -1
- data/hmvc-rails-1.0.1.gem +0 -0
- data/lib/generators/hmvc_rails/templates/extras/error_resource.rb.tt +2 -2
- data/lib/generators/hmvc_rails/templates/extras/exception.rb.tt +1 -1
- data/lib/generators/hmvc_rails/templates/validators/uniqueness_validator.rb.tt +2 -0
- data/lib/hmvc/rails/version.rb +1 -1
- data/lib/rubocop/cop/hmvc_rails/operating_style.rb +24 -3
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4e3f63d6d0eb0bd3e58b943f771c4226e1eb3a0b7f351be4b9b5cefd3adcc0a5
|
4
|
+
data.tar.gz: 9284eb6d94ada3f6a1c239d6e6d88e4aeaf40ec1fc76dbe4698979251425c95b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 34d91c54b4c92ca4081c43c000ed57a115caf69daaf99284011d264f8af0ab97008a785c7e25e309624dbf288091852d3d3f624ca87a3e69313e40a2a18ac238
|
7
|
+
data.tar.gz: ccaf73cd1843f383418dbfcb7c2a1ab52bc931d7736472d029fa5119e400aa3e3b94207e70bad1a51ba307058689bd575c3ab2e9bea157f928f2fbe34ea0be65
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
hmvc-rails (1.0.
|
4
|
+
hmvc-rails (1.0.2)
|
5
5
|
|
6
6
|
GEM
|
7
7
|
remote: https://rubygems.org/
|
@@ -67,17 +67,17 @@ GEM
|
|
67
67
|
tzinfo (~> 2.0)
|
68
68
|
ast (2.4.2)
|
69
69
|
builder (3.2.4)
|
70
|
-
concurrent-ruby (1.2.
|
70
|
+
concurrent-ruby (1.2.2)
|
71
71
|
crass (1.0.6)
|
72
|
-
date (3.3.
|
72
|
+
date (3.3.4)
|
73
73
|
erubi (1.12.0)
|
74
|
-
globalid (1.1
|
75
|
-
activesupport (>=
|
76
|
-
i18n (1.
|
74
|
+
globalid (1.2.1)
|
75
|
+
activesupport (>= 6.1)
|
76
|
+
i18n (1.14.1)
|
77
77
|
concurrent-ruby (~> 1.0)
|
78
|
-
loofah (2.
|
78
|
+
loofah (2.22.0)
|
79
79
|
crass (~> 1.0.2)
|
80
|
-
nokogiri (>= 1.
|
80
|
+
nokogiri (>= 1.12.0)
|
81
81
|
mail (2.8.1)
|
82
82
|
mini_mime (>= 0.1.1)
|
83
83
|
net-imap
|
@@ -85,26 +85,27 @@ GEM
|
|
85
85
|
net-smtp
|
86
86
|
marcel (1.0.2)
|
87
87
|
method_source (1.0.0)
|
88
|
-
mini_mime (1.1.
|
88
|
+
mini_mime (1.1.5)
|
89
89
|
minitest (5.17.0)
|
90
|
-
net-imap (0.3.
|
90
|
+
net-imap (0.3.7)
|
91
91
|
date
|
92
92
|
net-protocol
|
93
93
|
net-pop (0.1.2)
|
94
94
|
net-protocol
|
95
|
-
net-protocol (0.2.
|
95
|
+
net-protocol (0.2.2)
|
96
96
|
timeout
|
97
|
-
net-smtp (0.
|
97
|
+
net-smtp (0.4.0)
|
98
98
|
net-protocol
|
99
|
-
nio4r (2.
|
100
|
-
nokogiri (1.
|
99
|
+
nio4r (2.7.0)
|
100
|
+
nokogiri (1.15.5-x86_64-darwin)
|
101
101
|
racc (~> 1.4)
|
102
|
-
parallel (1.
|
103
|
-
parser (3.2.
|
102
|
+
parallel (1.24.0)
|
103
|
+
parser (3.2.2.4)
|
104
104
|
ast (~> 2.4.1)
|
105
|
-
|
106
|
-
|
107
|
-
rack
|
105
|
+
racc
|
106
|
+
racc (1.7.3)
|
107
|
+
rack (2.2.8)
|
108
|
+
rack-test (2.1.0)
|
108
109
|
rack (>= 1.3)
|
109
110
|
rails (7.0.0)
|
110
111
|
actioncable (= 7.0.0)
|
@@ -120,11 +121,13 @@ GEM
|
|
120
121
|
activesupport (= 7.0.0)
|
121
122
|
bundler (>= 1.15.0)
|
122
123
|
railties (= 7.0.0)
|
123
|
-
rails-dom-testing (2.0
|
124
|
-
activesupport (>=
|
124
|
+
rails-dom-testing (2.2.0)
|
125
|
+
activesupport (>= 5.0.0)
|
126
|
+
minitest
|
125
127
|
nokogiri (>= 1.6)
|
126
|
-
rails-html-sanitizer (1.
|
127
|
-
loofah (~> 2.
|
128
|
+
rails-html-sanitizer (1.6.0)
|
129
|
+
loofah (~> 2.21)
|
130
|
+
nokogiri (~> 1.14)
|
128
131
|
railties (7.0.0)
|
129
132
|
actionpack (= 7.0.0)
|
130
133
|
activesupport (= 7.0.0)
|
@@ -134,8 +137,8 @@ GEM
|
|
134
137
|
zeitwerk (~> 2.5)
|
135
138
|
rainbow (3.1.1)
|
136
139
|
rake (13.0.0)
|
137
|
-
regexp_parser (2.
|
138
|
-
rexml (3.2.
|
140
|
+
regexp_parser (2.8.3)
|
141
|
+
rexml (3.2.6)
|
139
142
|
rubocop (1.21.0)
|
140
143
|
parallel (~> 1.10)
|
141
144
|
parser (>= 3.0.0.0)
|
@@ -145,18 +148,18 @@ GEM
|
|
145
148
|
rubocop-ast (>= 1.9.1, < 2.0)
|
146
149
|
ruby-progressbar (~> 1.7)
|
147
150
|
unicode-display_width (>= 1.4.0, < 3.0)
|
148
|
-
rubocop-ast (1.
|
151
|
+
rubocop-ast (1.30.0)
|
149
152
|
parser (>= 3.2.1.0)
|
150
|
-
ruby-progressbar (1.
|
151
|
-
thor (1.
|
152
|
-
timeout (0.
|
153
|
+
ruby-progressbar (1.13.0)
|
154
|
+
thor (1.3.0)
|
155
|
+
timeout (0.4.1)
|
153
156
|
tzinfo (2.0.6)
|
154
157
|
concurrent-ruby (~> 1.0)
|
155
|
-
unicode-display_width (2.
|
156
|
-
websocket-driver (0.7.
|
158
|
+
unicode-display_width (2.5.0)
|
159
|
+
websocket-driver (0.7.6)
|
157
160
|
websocket-extensions (>= 0.1.0)
|
158
161
|
websocket-extensions (0.1.5)
|
159
|
-
zeitwerk (2.6.
|
162
|
+
zeitwerk (2.6.12)
|
160
163
|
|
161
164
|
PLATFORMS
|
162
165
|
x86_64-darwin-19
|
data/README.md
CHANGED
Binary file
|
@@ -23,8 +23,8 @@ module Extras
|
|
23
23
|
private
|
24
24
|
|
25
25
|
def field_errors
|
26
|
-
JSON.parse(message).map do |
|
27
|
-
messages.map { |message_detail| { name: field, message: message_detail } }
|
26
|
+
JSON.parse(message).map do |messages|
|
27
|
+
messages.map { |field, message_detail| { name: field, message: message_detail } }
|
28
28
|
end.flatten
|
29
29
|
end
|
30
30
|
end
|
@@ -7,6 +7,7 @@ class UniquenessValidator < ActiveModel::EachValidator
|
|
7
7
|
@klass = options[:model] if options[:model]
|
8
8
|
end
|
9
9
|
|
10
|
+
# rubocop:disable Metrics/AbcSize
|
10
11
|
def validate_each(record, attribute)
|
11
12
|
record_org = record
|
12
13
|
attribute_org = attribute
|
@@ -26,4 +27,5 @@ class UniquenessValidator < ActiveModel::EachValidator
|
|
26
27
|
|
27
28
|
record_org.errors.add(attribute_org, :taken) if record
|
28
29
|
end
|
30
|
+
# rubocop:enable Metrics/AbcSize
|
29
31
|
end
|
data/lib/hmvc/rails/version.rb
CHANGED
@@ -15,14 +15,35 @@ module RuboCop
|
|
15
15
|
return unless node.children.first == :call
|
16
16
|
|
17
17
|
node.body.to_a.compact.each do |ast|
|
18
|
-
next if
|
18
|
+
next if special_node?(ast.class)
|
19
19
|
|
20
|
-
next if ast.is_a?(
|
21
|
-
|
20
|
+
next if ast.is_a?(Symbol) && valid?(ast.to_s)
|
21
|
+
|
22
|
+
next if ast.is_a?(RuboCop::AST::SendNode) && valid?(ast.children.last.to_s)
|
22
23
|
|
23
24
|
add_offense(node, message: "Method works in \"call\" without prefix \"step_\"")
|
24
25
|
end
|
25
26
|
end
|
27
|
+
|
28
|
+
private
|
29
|
+
|
30
|
+
def special_node?(node_name)
|
31
|
+
[
|
32
|
+
RuboCop::AST::Node,
|
33
|
+
RuboCop::AST::IfNode,
|
34
|
+
RuboCop::AST::IntNode,
|
35
|
+
RuboCop::AST::ArgsNode,
|
36
|
+
RuboCop::AST::BlockNode,
|
37
|
+
RuboCop::AST::YieldNode,
|
38
|
+
RuboCop::AST::SuperNode,
|
39
|
+
RuboCop::AST::ReturnNode,
|
40
|
+
RuboCop::AST::ResbodyNode
|
41
|
+
].include?(node_name)
|
42
|
+
end
|
43
|
+
|
44
|
+
def valid?(text)
|
45
|
+
%w[step_ transaction].any? { |keyword| text.start_with?(keyword) }
|
46
|
+
end
|
26
47
|
end
|
27
48
|
end
|
28
49
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: hmvc-rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- thucpt
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-
|
11
|
+
date: 2023-12-19 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: hmvc-rails is a high-level model for the Rails MVC architecture
|
14
14
|
email:
|
@@ -26,6 +26,7 @@ files:
|
|
26
26
|
- README.md
|
27
27
|
- Rakefile
|
28
28
|
- hmvc-rails-1.0.0.gem
|
29
|
+
- hmvc-rails-1.0.1.gem
|
29
30
|
- lib/generators/hmvc_rails/hmvc_rails_generator.rb
|
30
31
|
- lib/generators/hmvc_rails/install_generator.rb
|
31
32
|
- lib/generators/hmvc_rails/templates/configures/hmvc_rails.rb.tt
|