metasploit-erd 3.0.0 → 4.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data.tar.gz.sig +0 -0
- data/.github/workflows/verify.yml +60 -0
- data/Gemfile +1 -7
- data/README.md +1 -1
- data/lib/metasploit/erd/entity/namespace.rb +2 -2
- data/lib/metasploit/erd/version.rb +1 -1
- data/metasploit-erd.gemspec +4 -5
- data/spec/metasploit/erd/relationship_spec.rb +1 -6
- data/spec/spec_helper.rb +1 -10
- data/spec/support/shared/contexts/active_record_base_connection.rb +2 -2
- data/spec/support/shared/contexts/active_record_base_descendants_cleaner.rb +8 -2
- metadata +25 -40
- metadata.gz.sig +0 -0
- data/.coveralls.yml +0 -1
- data/.travis.yml +0 -14
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1212aaa9765c6a39b0aad87dc4ebe3e2bc44cfd20c6c15dacf66c896683ea80a
|
4
|
+
data.tar.gz: 5f94a7a167093bdcf6f1c78356dddb7f7b7e3153148659100c1998cfb4807f4d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 366d6fc95e4ee9453a95217c6befaaccb4069803e202c3a3328c94596573dbbb0e7de56b8cbb57bda127438d1d7150cf6a477aa64f1c3635e4469d22e831c149
|
7
|
+
data.tar.gz: ddf90bfa51fb3297cd61cd0a26c1a0cd1ed5c0debe2ae22525054b2dc7e019092232ccf5de0986d67bd8b5de257c13c665c737a4f17f07877b260673e50bd1b5
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data.tar.gz.sig
CHANGED
Binary file
|
@@ -0,0 +1,60 @@
|
|
1
|
+
name: Verify
|
2
|
+
|
3
|
+
on:
|
4
|
+
push:
|
5
|
+
branches:
|
6
|
+
- '*'
|
7
|
+
pull_request:
|
8
|
+
branches:
|
9
|
+
- '*'
|
10
|
+
|
11
|
+
jobs:
|
12
|
+
test:
|
13
|
+
runs-on: ubuntu-16.04
|
14
|
+
timeout-minutes: 40
|
15
|
+
|
16
|
+
strategy:
|
17
|
+
fail-fast: true
|
18
|
+
matrix:
|
19
|
+
ruby:
|
20
|
+
- 2.5
|
21
|
+
- 2.6
|
22
|
+
- 2.7
|
23
|
+
- 3.0
|
24
|
+
|
25
|
+
env:
|
26
|
+
RAILS_ENV: test
|
27
|
+
|
28
|
+
name: Ruby ${{ matrix.ruby }}
|
29
|
+
steps:
|
30
|
+
- name: Install system dependencies
|
31
|
+
run: sudo apt-get install graphviz
|
32
|
+
|
33
|
+
- name: Checkout code
|
34
|
+
uses: actions/checkout@v2
|
35
|
+
|
36
|
+
- uses: actions/setup-ruby@v1
|
37
|
+
with:
|
38
|
+
ruby-version: ${{ matrix.ruby }}
|
39
|
+
|
40
|
+
- name: Setup bundler
|
41
|
+
run: |
|
42
|
+
gem install bundler
|
43
|
+
|
44
|
+
- name: Bundle install
|
45
|
+
run: |
|
46
|
+
bundle config path vendor/bundle
|
47
|
+
bundle install --jobs 4 --retry 3
|
48
|
+
|
49
|
+
- name: Test
|
50
|
+
run: |
|
51
|
+
bundle exec rake spec
|
52
|
+
bundle exec rake yard
|
53
|
+
|
54
|
+
- name: Upload coverage report
|
55
|
+
uses: actions/upload-artifact@v2
|
56
|
+
with:
|
57
|
+
name: coverage-${{ matrix.ruby }}
|
58
|
+
path: |
|
59
|
+
coverage/
|
60
|
+
retention-days: 1
|
data/Gemfile
CHANGED
@@ -8,16 +8,10 @@ group :development do
|
|
8
8
|
gem 'kramdown', platforms: :jruby
|
9
9
|
# markdown formatting for yard
|
10
10
|
gem 'redcarpet', platforms: :ruby
|
11
|
-
|
12
|
-
# 0.8.7.4 has a bug where setters are not documented when @!attribute is used
|
13
|
-
gem 'yard', '< 0.8.7.4'
|
11
|
+
gem 'yard'
|
14
12
|
end
|
15
13
|
|
16
14
|
group :test do
|
17
|
-
# blank?
|
18
|
-
gem 'activesupport', '~> 5.2.2'
|
19
|
-
# Upload coverage reports to coveralls.io
|
20
|
-
gem 'coveralls', require: false
|
21
15
|
# code coverage of tests
|
22
16
|
gem 'simplecov', :require => false
|
23
17
|
# in-memory database for ActiveRecord association traversal
|
data/README.md
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
# Metasploit::ERD [![Build Status](https://
|
1
|
+
# Metasploit::ERD [![Build Status](https://github.com/rapid7/metasploit-erd/actions/workflows/verify.yml/badge.svg)](https://github.com/rapid7/metasploit-erd/actions/workflows/verify.yml)[![Code Climate](https://codeclimate.com/github/rapid7/metasploit-erd.png)](https://codeclimate.com/github/rapid7/metasploit-erd)[![Coverage Status](https://coveralls.io/repos/rapid7/metasploit-erd/badge.png)](https://coveralls.io/r/rapid7/metasploit-erd)[![Dependency Status](https://gemnasium.com/rapid7/metasploit-erd.png)](https://gemnasium.com/rapid7/metasploit-erd)[![Gem Version](https://badge.fury.io/rb/metasploit-erd.png)](http://badge.fury.io/rb/metasploit-erd)
|
2
2
|
|
3
3
|
Traces the `belongs_to` associations on `ActiveRecord::Base.descendants` to find the minimum cluster in which all
|
4
4
|
foreign keys are fulfilled in the Entity-Relationship Diagram.'
|
@@ -31,7 +31,7 @@ class Metasploit::ERD::Entity::Namespace
|
|
31
31
|
# @return [Array<Class<ActiveRecord::Base>
|
32
32
|
def classes
|
33
33
|
ActiveRecord::Base.descendants.select { |klass|
|
34
|
-
klass.
|
34
|
+
klass.module_parents.any? { |parent|
|
35
35
|
parent.name == namespace_name
|
36
36
|
}
|
37
37
|
}
|
@@ -63,4 +63,4 @@ class Metasploit::ERD::Entity::Namespace
|
|
63
63
|
|
64
64
|
super(super_options)
|
65
65
|
end
|
66
|
-
end
|
66
|
+
end
|
data/metasploit-erd.gemspec
CHANGED
@@ -6,8 +6,8 @@ require 'metasploit/erd/version'
|
|
6
6
|
Gem::Specification.new do |spec|
|
7
7
|
spec.name = 'metasploit-erd'
|
8
8
|
spec.version = Metasploit::ERD::VERSION
|
9
|
-
spec.authors = ['
|
10
|
-
spec.email = ['
|
9
|
+
spec.authors = ['Metasploit Hackers']
|
10
|
+
spec.email = ['msfdev@metasploit.com']
|
11
11
|
spec.summary = 'Extensions to rails-erd to find clusters of models to generate subdomains specific to each model'
|
12
12
|
spec.description = 'Traces the belongs_to associations on ActiveRecord::Base descendants to find the minimum ' \
|
13
13
|
'cluster in which all foreign keys are fulfilled in the Entity-Relationship Diagram.'
|
@@ -21,12 +21,11 @@ Gem::Specification.new do |spec|
|
|
21
21
|
|
22
22
|
spec.required_ruby_version = '>= 2.2.0'
|
23
23
|
|
24
|
-
spec.add_development_dependency 'bundler'
|
25
24
|
spec.add_development_dependency 'metasploit-yard'
|
26
25
|
spec.add_development_dependency 'rake'
|
27
26
|
spec.add_development_dependency 'rspec'
|
28
27
|
|
29
|
-
spec.add_runtime_dependency 'activerecord', '~>
|
30
|
-
spec.add_runtime_dependency 'activesupport', '~>
|
28
|
+
spec.add_runtime_dependency 'activerecord', '~> 6.0'
|
29
|
+
spec.add_runtime_dependency 'activesupport', '~> 6.0'
|
31
30
|
spec.add_runtime_dependency 'rails-erd'
|
32
31
|
end
|
@@ -124,13 +124,10 @@ RSpec.describe Metasploit::ERD::Relationship do
|
|
124
124
|
|
125
125
|
ActiveRecord::Migration.create_table :owners do |t|
|
126
126
|
t.references :thing
|
127
|
-
|
128
|
-
t.timestamp
|
129
127
|
end
|
130
128
|
|
131
129
|
things.each do |thing|
|
132
130
|
ActiveRecord::Migration.create_table thing.table_name do |t|
|
133
|
-
t.timestamp
|
134
131
|
end
|
135
132
|
end
|
136
133
|
end
|
@@ -210,8 +207,6 @@ RSpec.describe Metasploit::ERD::Relationship do
|
|
210
207
|
group_names.each do |group_name|
|
211
208
|
t.references group_name.underscore.to_sym
|
212
209
|
end
|
213
|
-
|
214
|
-
t.timestamp
|
215
210
|
end
|
216
211
|
|
217
212
|
polymorphics_by_group_name.each do |group_name, polymorphics|
|
@@ -241,4 +236,4 @@ RSpec.describe Metasploit::ERD::Relationship do
|
|
241
236
|
end
|
242
237
|
end
|
243
238
|
end
|
244
|
-
end
|
239
|
+
end
|
data/spec/spec_helper.rb
CHANGED
@@ -2,17 +2,8 @@ require 'bundler/setup'
|
|
2
2
|
|
3
3
|
# require before 'metasploit/erd' so coverage is shown for files required by 'metasploit/erd'
|
4
4
|
require 'simplecov'
|
5
|
-
require 'coveralls'
|
6
5
|
|
7
|
-
|
8
|
-
# # don't generate local report as it is inaccessible on travis-ci, which is why coveralls is being used.
|
9
|
-
# SimpleCov.formatter = Coveralls::SimpleCov::Formatter
|
10
|
-
# else
|
11
|
-
SimpleCov.formatter = SimpleCov::Formatter::MultiFormatter.new(
|
12
|
-
# either generate the local report
|
13
|
-
SimpleCov::Formatter::HTMLFormatter
|
14
|
-
)
|
15
|
-
# end
|
6
|
+
SimpleCov.formatter = SimpleCov::Formatter::HTMLFormatter
|
16
7
|
|
17
8
|
#
|
18
9
|
# Project
|
@@ -6,6 +6,12 @@ RSpec.shared_context 'ActiveRecord::Base.descendants cleaner' do
|
|
6
6
|
after(:example) do
|
7
7
|
# `ActiveSupport::DescendantsTracker.clear` will not clear ActiveRecord::Base subclasses because
|
8
8
|
# ActiveSupport::Dependencies is loaded
|
9
|
-
ActiveRecord::
|
9
|
+
if ActiveRecord.version >= Gem::Version.new("6.0.0.rc1")
|
10
|
+
cv = ActiveSupport::DescendantsTracker.class_variable_get(:@@direct_descendants)
|
11
|
+
cv.delete(ActiveRecord::Base)
|
12
|
+
ActiveSupport::DescendantsTracker.class_variable_set(:@@direct_descendants, cv)
|
13
|
+
else
|
14
|
+
ActiveRecord::Base.direct_descendants.clear
|
15
|
+
end
|
10
16
|
end
|
11
|
-
end
|
17
|
+
end
|
metadata
CHANGED
@@ -1,10 +1,10 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: metasploit-erd
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 4.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
|
-
-
|
7
|
+
- Metasploit Hackers
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain:
|
@@ -64,20 +64,20 @@ cert_chain:
|
|
64
64
|
-----END CERTIFICATE-----
|
65
65
|
- |
|
66
66
|
-----BEGIN CERTIFICATE-----
|
67
|
-
|
67
|
+
MIIFIzCCBAugAwIBAgIQCMePMbkSxvnPeJhYXIfaxzANBgkqhkiG9w0BAQsFADBy
|
68
68
|
MQswCQYDVQQGEwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3
|
69
69
|
d3cuZGlnaWNlcnQuY29tMTEwLwYDVQQDEyhEaWdpQ2VydCBTSEEyIEFzc3VyZWQg
|
70
|
-
|
70
|
+
SUQgQ29kZSBTaWduaW5nIENBMB4XDTIwMTAwNzAwMDAwMFoXDTIzMTEwNjEyMDAw
|
71
71
|
MFowYDELMAkGA1UEBhMCVVMxFjAUBgNVBAgTDU1hc3NhY2h1c2V0dHMxDzANBgNV
|
72
72
|
BAcTBkJvc3RvbjETMBEGA1UEChMKUmFwaWQ3IExMQzETMBEGA1UEAxMKUmFwaWQ3
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
73
|
+
IExMQzCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBALNTz4zvAy7h/vQp
|
74
|
+
4dr1txXHlABAagkwYYwTMCtHs5PXsJITx/5SAjx5swuaLfze5kPBNF2YImvFlOXY
|
75
|
+
WaB+0PsOnXnaARsDZU683xFlj8izU6IN6VrAHzDLKFBzruJENrOJD/ikbEtbjO/q
|
76
|
+
gFbmS9J9v5ohG/pcRSS0t4ZPAwymf8eCp6QsvOKK/Aymp1RhlRaP8N6N5CIpkhz1
|
77
|
+
9p968iCE+DjOXVYxcWE+jE/7uB1dbgrXykNBujMSS3GULOvV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IJrk9TVs0
|
93
|
+
EknWpNgVhohbot1lfVAMmIhdtOVaRVcQQixWPwprDj/ydB8ryDMDosIMcw+fkoXU
|
94
|
+
9GJsSaSRRYQ9UUkVL27b64okU8D48m8=
|
95
95
|
-----END CERTIFICATE-----
|
96
|
-
date:
|
96
|
+
date: 2021-05-05 00:00:00.000000000 Z
|
97
97
|
dependencies:
|
98
|
-
- !ruby/object:Gem::Dependency
|
99
|
-
name: bundler
|
100
|
-
requirement: !ruby/object:Gem::Requirement
|
101
|
-
requirements:
|
102
|
-
- - ">="
|
103
|
-
- !ruby/object:Gem::Version
|
104
|
-
version: '0'
|
105
|
-
type: :development
|
106
|
-
prerelease: false
|
107
|
-
version_requirements: !ruby/object:Gem::Requirement
|
108
|
-
requirements:
|
109
|
-
- - ">="
|
110
|
-
- !ruby/object:Gem::Version
|
111
|
-
version: '0'
|
112
98
|
- !ruby/object:Gem::Dependency
|
113
99
|
name: metasploit-yard
|
114
100
|
requirement: !ruby/object:Gem::Requirement
|
@@ -157,28 +143,28 @@ dependencies:
|
|
157
143
|
requirements:
|
158
144
|
- - "~>"
|
159
145
|
- !ruby/object:Gem::Version
|
160
|
-
version:
|
146
|
+
version: '6.0'
|
161
147
|
type: :runtime
|
162
148
|
prerelease: false
|
163
149
|
version_requirements: !ruby/object:Gem::Requirement
|
164
150
|
requirements:
|
165
151
|
- - "~>"
|
166
152
|
- !ruby/object:Gem::Version
|
167
|
-
version:
|
153
|
+
version: '6.0'
|
168
154
|
- !ruby/object:Gem::Dependency
|
169
155
|
name: activesupport
|
170
156
|
requirement: !ruby/object:Gem::Requirement
|
171
157
|
requirements:
|
172
158
|
- - "~>"
|
173
159
|
- !ruby/object:Gem::Version
|
174
|
-
version:
|
160
|
+
version: '6.0'
|
175
161
|
type: :runtime
|
176
162
|
prerelease: false
|
177
163
|
version_requirements: !ruby/object:Gem::Requirement
|
178
164
|
requirements:
|
179
165
|
- - "~>"
|
180
166
|
- !ruby/object:Gem::Version
|
181
|
-
version:
|
167
|
+
version: '6.0'
|
182
168
|
- !ruby/object:Gem::Dependency
|
183
169
|
name: rails-erd
|
184
170
|
requirement: !ruby/object:Gem::Requirement
|
@@ -197,16 +183,15 @@ description: Traces the belongs_to associations on ActiveRecord::Base descendant
|
|
197
183
|
to find the minimum cluster in which all foreign keys are fulfilled in the Entity-Relationship
|
198
184
|
Diagram.
|
199
185
|
email:
|
200
|
-
-
|
186
|
+
- msfdev@metasploit.com
|
201
187
|
executables: []
|
202
188
|
extensions: []
|
203
189
|
extra_rdoc_files: []
|
204
190
|
files:
|
205
|
-
- ".
|
191
|
+
- ".github/workflows/verify.yml"
|
206
192
|
- ".gitignore"
|
207
193
|
- ".rspec"
|
208
194
|
- ".simplecov"
|
209
|
-
- ".travis.yml"
|
210
195
|
- ".yardopts"
|
211
196
|
- CHANGELOG.md
|
212
197
|
- CONTRIBUTING.md
|
metadata.gz.sig
CHANGED
Binary file
|
data/.coveralls.yml
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
service_name: travis-ci
|