neetob 0.5.3 → 0.5.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +2 -2
- data/lib/neetob/cli/code/audit.rb +25 -0
- data/lib/neetob/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: 2e9f4f9a2ee60826478456769b0ec2e13822cefde51c5169281a30d1dceea6f4
|
4
|
+
data.tar.gz: 9266e85257bede98e0591aa16be29ca957728f6a83171645f99361a69066667d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 32214fd0f0ae2e81b4163a71f3a73e84402e76bb98fdbeb3be19d3ec415c62dc3a9ef792f2ddcecd0c67016fb262725814ba9419d487e7a56788068dd659f427
|
7
|
+
data.tar.gz: c78d355e36cefdb274ccd8b5820299c4a188343f10af7bf03c54c357bd1f4bfa70a1290135c80137f3d51392b8d2a9d35c4906f7840a2689506d2e085914b3da
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
neetob (0.5.
|
4
|
+
neetob (0.5.5)
|
5
5
|
brakeman (~> 5.0)
|
6
6
|
chronic
|
7
7
|
dotenv (~> 2.8.1)
|
@@ -364,7 +364,7 @@ GEM
|
|
364
364
|
io-console (~> 0.5)
|
365
365
|
request_store (1.7.0)
|
366
366
|
rack (>= 1.4)
|
367
|
-
rexml (3.3.
|
367
|
+
rexml (3.3.3)
|
368
368
|
strscan
|
369
369
|
rinku (2.0.6)
|
370
370
|
rubocop (1.39.0)
|
@@ -26,6 +26,7 @@ module Neetob
|
|
26
26
|
has_found_tables_without_uuid = true
|
27
27
|
print_app_and_tables(app, tables_without_uuid)
|
28
28
|
end
|
29
|
+
verify_unique_email_index(db_schema)
|
29
30
|
rescue Octokit::NotFound
|
30
31
|
ui.error("There is no \"db/schema.rb\" file in the \"#{app}\" app.")
|
31
32
|
rescue StandardError => e
|
@@ -44,6 +45,30 @@ module Neetob
|
|
44
45
|
end
|
45
46
|
end
|
46
47
|
|
48
|
+
def verify_unique_email_index(db_schema)
|
49
|
+
index_pattern = /
|
50
|
+
create_table\s+"users".*?
|
51
|
+
(
|
52
|
+
t\.index\s+\[
|
53
|
+
\s*"email"\s*
|
54
|
+
\],\s+
|
55
|
+
name:\s*"index_users_on_email"
|
56
|
+
|
|
57
|
+
t\.index\s+\[
|
58
|
+
\s*"email"\s*,\s*"organization_id"\s*
|
59
|
+
\],\s+
|
60
|
+
name:\s*"index_users_on_email_and_organization_id"\s*,\s+
|
61
|
+
unique:\s*true
|
62
|
+
)
|
63
|
+
/mx
|
64
|
+
|
65
|
+
if db_schema.match(index_pattern)
|
66
|
+
ui.success("\nUsers are indexed properly")
|
67
|
+
else
|
68
|
+
ui.error("\nUsers are not indexed")
|
69
|
+
end
|
70
|
+
end
|
71
|
+
|
47
72
|
def print_app_and_tables(app, tables)
|
48
73
|
ui.info("\n#{app}:-")
|
49
74
|
tables.each do |table|
|
data/lib/neetob/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: neetob
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Udai Gupta
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-08-
|
11
|
+
date: 2024-08-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: thor
|