hmvc-rails 1.0.0 → 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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 4dd3f8480d396c51dc8d60cc16c5df9596f66d246079db510e41847f8cc10140
4
- data.tar.gz: 6318242634c8b11060724147d7b28f0e7dbecce9338e08a18c5dd041784ad515
3
+ metadata.gz: 4e3f63d6d0eb0bd3e58b943f771c4226e1eb3a0b7f351be4b9b5cefd3adcc0a5
4
+ data.tar.gz: 9284eb6d94ada3f6a1c239d6e6d88e4aeaf40ec1fc76dbe4698979251425c95b
5
5
  SHA512:
6
- metadata.gz: c905bd1b4a55b56c4c0265e21f4d4dfed4526a3d07d571c414475291f3f51ef105ba6c756860212924e3516ce076023449607f8be4846613d401060f1a80e94a
7
- data.tar.gz: be42b1a104ff76ac32fbb8b12e21862094f64fab70b88f5a5915fffb78baf74fc25716d0fb865ef4b6aed9b4afadaf8d370511600f8c74170556777680857b09
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.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.0)
70
+ concurrent-ruby (1.2.2)
71
71
  crass (1.0.6)
72
- date (3.3.3)
72
+ date (3.3.4)
73
73
  erubi (1.12.0)
74
- globalid (1.1.0)
75
- activesupport (>= 5.0)
76
- i18n (1.12.0)
74
+ globalid (1.2.1)
75
+ activesupport (>= 6.1)
76
+ i18n (1.14.1)
77
77
  concurrent-ruby (~> 1.0)
78
- loofah (2.19.1)
78
+ loofah (2.22.0)
79
79
  crass (~> 1.0.2)
80
- nokogiri (>= 1.5.9)
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.2)
88
+ mini_mime (1.1.5)
89
89
  minitest (5.17.0)
90
- net-imap (0.3.4)
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.1)
95
+ net-protocol (0.2.2)
96
96
  timeout
97
- net-smtp (0.3.3)
97
+ net-smtp (0.4.0)
98
98
  net-protocol
99
- nio4r (2.5.8)
100
- nokogiri (1.14.2-x86_64-darwin)
99
+ nio4r (2.7.0)
100
+ nokogiri (1.15.5-x86_64-darwin)
101
101
  racc (~> 1.4)
102
- parallel (1.22.1)
103
- parser (3.2.1.0)
102
+ parallel (1.24.0)
103
+ parser (3.2.2.4)
104
104
  ast (~> 2.4.1)
105
- racc (1.6.2)
106
- rack (2.2.6.2)
107
- rack-test (2.0.2)
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.3)
124
- activesupport (>= 4.2.0)
124
+ rails-dom-testing (2.2.0)
125
+ activesupport (>= 5.0.0)
126
+ minitest
125
127
  nokogiri (>= 1.6)
126
- rails-html-sanitizer (1.5.0)
127
- loofah (~> 2.19, >= 2.19.1)
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.7.0)
138
- rexml (3.2.5)
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.26.0)
151
+ rubocop-ast (1.30.0)
149
152
  parser (>= 3.2.1.0)
150
- ruby-progressbar (1.11.0)
151
- thor (1.2.1)
152
- timeout (0.3.2)
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.4.2)
156
- websocket-driver (0.7.5)
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.7)
162
+ zeitwerk (2.6.12)
160
163
 
161
164
  PLATFORMS
162
165
  x86_64-darwin-19
data/README.md CHANGED
@@ -19,9 +19,7 @@
19
19
  Add this line to your application's Gemfile
20
20
 
21
21
  ```ruby
22
- group :development do
23
- gem 'hmvc-rails', git: 'git@github.com:TOMOSIA-VIETNAM/hmvc-rails.git'
24
- end
22
+ gem 'hmvc-rails', '1.0.2', group: :development
25
23
  ```
26
24
 
27
25
  Then execute
Binary file
Binary file
@@ -23,8 +23,8 @@ module Extras
23
23
  private
24
24
 
25
25
  def field_errors
26
- JSON.parse(message).map do |field, messages|
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
@@ -50,7 +50,7 @@ module Extras
50
50
 
51
51
  class Conflict < StandardError; end
52
52
 
53
- class UnprocessableEntity < ActiveRecord::RecordInvalid; end
53
+ class UnprocessableEntity < StandardError; end
54
54
 
55
55
  class InternalServerError < StandardError; end
56
56
 
@@ -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
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Hmvc
4
4
  module Rails
5
- VERSION = "1.0.0"
5
+ VERSION = "1.0.2"
6
6
  end
7
7
  end
@@ -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 ast.is_a?(Symbol) && (ast.to_s.start_with?("step_") || ats.to_s == "super")
18
+ next if special_node?(ast.class)
19
19
 
20
- next if ast.is_a?(RuboCop::AST::SendNode) &&
21
- (ast.children.last.to_s.start_with?("step_") || ast.children.last.to_s == "super")
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.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-03-24 00:00:00.000000000 Z
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:
@@ -25,6 +25,8 @@ files:
25
25
  - LICENSE.txt
26
26
  - README.md
27
27
  - Rakefile
28
+ - hmvc-rails-1.0.0.gem
29
+ - hmvc-rails-1.0.1.gem
28
30
  - lib/generators/hmvc_rails/hmvc_rails_generator.rb
29
31
  - lib/generators/hmvc_rails/install_generator.rb
30
32
  - lib/generators/hmvc_rails/templates/configures/hmvc_rails.rb.tt
@@ -67,7 +69,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
67
69
  - !ruby/object:Gem::Version
68
70
  version: '0'
69
71
  requirements: []
70
- rubygems_version: 3.3.25
72
+ rubygems_version: 3.4.13
71
73
  signing_key:
72
74
  specification_version: 4
73
75
  summary: hmvc-rails is a high-level model for the Rails MVC architecture