metasploit-model 0.26.1-java → 0.27.0-java
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/models/metasploit/model/association/reflection.rb +3 -0
- data/app/models/metasploit/model/module/ancestor/spec/template.rb +3 -0
- data/app/models/metasploit/model/module/class/spec/template.rb +4 -0
- data/app/models/metasploit/model/module/instance/spec/template.rb +4 -0
- data/app/models/metasploit/model/search/group/base.rb +3 -0
- data/app/models/metasploit/model/search/group/intersection.rb +2 -0
- data/app/models/metasploit/model/search/group/union.rb +2 -0
- data/app/models/metasploit/model/search/operation/association.rb +2 -0
- data/app/models/metasploit/model/search/operation/base.rb +3 -0
- data/app/models/metasploit/model/search/operation/boolean.rb +2 -0
- data/app/models/metasploit/model/search/operation/date.rb +2 -0
- data/app/models/metasploit/model/search/operation/group/base.rb +2 -0
- data/app/models/metasploit/model/search/operation/group/intersection.rb +2 -0
- data/app/models/metasploit/model/search/operation/group/union.rb +2 -0
- data/app/models/metasploit/model/search/operation/integer.rb +4 -0
- data/app/models/metasploit/model/search/operation/null.rb +2 -0
- data/app/models/metasploit/model/search/operation/set.rb +2 -0
- data/app/models/metasploit/model/search/operation/set/integer.rb +2 -0
- data/app/models/metasploit/model/search/operation/set/string.rb +2 -0
- data/app/models/metasploit/model/search/operation/string.rb +4 -0
- data/app/models/metasploit/model/search/operator/association.rb +2 -0
- data/app/models/metasploit/model/search/operator/attribute.rb +2 -0
- data/app/models/metasploit/model/search/operator/base.rb +4 -0
- data/app/models/metasploit/model/search/operator/delegation.rb +2 -0
- data/app/models/metasploit/model/search/operator/deprecated/app.rb +2 -0
- data/app/models/metasploit/model/search/operator/deprecated/author.rb +2 -0
- data/app/models/metasploit/model/search/operator/deprecated/authority.rb +2 -0
- data/app/models/metasploit/model/search/operator/deprecated/platform.rb +2 -0
- data/app/models/metasploit/model/search/operator/deprecated/ref.rb +2 -0
- data/app/models/metasploit/model/search/operator/deprecated/text.rb +2 -0
- data/app/models/metasploit/model/search/operator/group/base.rb +2 -0
- data/app/models/metasploit/model/search/operator/group/intersection.rb +2 -0
- data/app/models/metasploit/model/search/operator/group/union.rb +2 -0
- data/app/models/metasploit/model/search/operator/null.rb +2 -0
- data/app/models/metasploit/model/search/operator/single.rb +2 -0
- data/app/models/metasploit/model/search/query.rb +3 -0
- data/app/models/metasploit/model/spec/template.rb +9 -2
- data/app/models/metasploit/model/visitation/visitor.rb +3 -0
- data/lib/metasploit/model.rb +24 -15
- data/lib/metasploit/model/architecture.rb +2 -0
- data/lib/metasploit/model/association.rb +4 -0
- data/lib/metasploit/model/author.rb +2 -0
- data/lib/metasploit/model/authority.rb +14 -0
- data/lib/metasploit/model/authority/bid.rb +2 -0
- data/lib/metasploit/model/authority/cve.rb +2 -0
- data/lib/metasploit/model/authority/msb.rb +2 -0
- data/lib/metasploit/model/authority/osvdb.rb +2 -0
- data/lib/metasploit/model/authority/pmasa.rb +2 -0
- data/lib/metasploit/model/authority/secunia.rb +2 -0
- data/lib/metasploit/model/authority/us_cert_vu.rb +2 -0
- data/lib/metasploit/model/authority/waraxe.rb +2 -0
- data/lib/metasploit/model/authority/zdi.rb +2 -0
- data/lib/metasploit/model/base.rb +2 -0
- data/lib/metasploit/model/derivation.rb +4 -1
- data/lib/metasploit/model/email_address.rb +2 -0
- data/lib/metasploit/model/engine.rb +21 -27
- data/lib/metasploit/model/invalid.rb +2 -0
- data/lib/metasploit/model/login.rb +10 -0
- data/lib/metasploit/model/login/status.rb +2 -0
- data/lib/metasploit/model/module.rb +16 -0
- data/lib/metasploit/model/module/action.rb +2 -0
- data/lib/metasploit/model/module/ancestor.rb +6 -0
- data/lib/metasploit/model/module/ancestor/spec.rb +5 -0
- data/lib/metasploit/model/module/architecture.rb +2 -0
- data/lib/metasploit/model/module/author.rb +2 -0
- data/lib/metasploit/model/module/class.rb +5 -0
- data/lib/metasploit/model/module/class/spec.rb +5 -0
- data/lib/metasploit/model/module/instance.rb +6 -0
- data/lib/metasploit/model/module/instance/spec.rb +5 -0
- data/lib/metasploit/model/module/path.rb +3 -0
- data/lib/metasploit/model/module/platform.rb +2 -0
- data/lib/metasploit/model/module/rank.rb +2 -0
- data/lib/metasploit/model/module/reference.rb +2 -0
- data/lib/metasploit/model/module/target.rb +6 -0
- data/lib/metasploit/model/module/target/architecture.rb +2 -0
- data/lib/metasploit/model/module/target/platform.rb +2 -0
- data/lib/metasploit/model/platform.rb +2 -0
- data/lib/metasploit/model/real_pathname.rb +2 -0
- data/lib/metasploit/model/realm.rb +9 -0
- data/lib/metasploit/model/realm/key.rb +2 -0
- data/lib/metasploit/model/reference.rb +2 -0
- data/lib/metasploit/model/search.rb +9 -0
- data/lib/metasploit/model/search/attribute.rb +2 -0
- data/lib/metasploit/model/search/group.rb +6 -0
- data/lib/metasploit/model/search/operation.rb +4 -0
- data/lib/metasploit/model/search/operation/group.rb +5 -0
- data/lib/metasploit/model/search/operator.rb +4 -0
- data/lib/metasploit/model/search/operator/deprecated.rb +6 -0
- data/lib/metasploit/model/search/operator/group.rb +5 -0
- data/lib/metasploit/model/spec.rb +7 -0
- data/lib/metasploit/model/spec/i18n_exception_handler.rb +2 -0
- data/lib/metasploit/model/spec/pathname_collision.rb +2 -0
- data/lib/metasploit/model/spec/template/write.rb +2 -0
- data/lib/metasploit/model/spec/temporary_pathname.rb +3 -0
- data/lib/metasploit/model/translation.rb +2 -0
- data/lib/metasploit/model/version.rb +2 -2
- data/lib/metasploit/model/visitation.rb +2 -0
- data/metasploit-model.gemspec +1 -0
- data/spec/app/models/metasploit/model/module/ancestor/spec/template_spec.rb +1 -1
- data/spec/lib/metasploit/model/engine_spec.rb +1 -1
- data/spec/lib/metasploit/model/login/status_spec.rb +83 -0
- data/spec/lib/metasploit/model/spec_spec.rb +3 -3
- data/spec/spec_helper.rb +4 -6
- metadata +28 -28
- data/lib/metasploit/model/configuration.rb +0 -72
- data/lib/metasploit/model/configuration/autoload.rb +0 -109
- data/lib/metasploit/model/configuration/child.rb +0 -12
- data/lib/metasploit/model/configuration/error.rb +0 -4
- data/lib/metasploit/model/configuration/i18n.rb +0 -54
- data/lib/metasploit/model/configuration/parent.rb +0 -50
- data/lib/metasploit/model/configured.rb +0 -46
- data/spec/lib/metasploit/model/configuration/autoload_spec.rb +0 -165
- data/spec/lib/metasploit/model/configuration/child_spec.rb +0 -24
- data/spec/lib/metasploit/model/configuration/error_spec.rb +0 -5
- data/spec/lib/metasploit/model/configuration/i18n_spec.rb +0 -103
- data/spec/lib/metasploit/model/configuration_spec.rb +0 -106
- data/spec/lib/metasploit/model/configured_spec.rb +0 -41
- data/spec/lib/metasploit/model_spec.rb +0 -68
- data/spec/support/shared/contexts/metasploit/model/configuration.rb +0 -11
- data/spec/support/shared/examples/metasploit/model/configuration/parent/child.rb +0 -60
@@ -0,0 +1,6 @@
|
|
1
|
+
require 'metasploit/model/search/operator'
|
2
|
+
|
3
|
+
# Namespace for search operators that mimic behavior of the msfconsole search operators prior to the search operator
|
4
|
+
# generalization introduced by {Metasploit::Model::Search}.
|
5
|
+
module Metasploit::Model::Search::Operator::Deprecated
|
6
|
+
end
|
@@ -4,11 +4,18 @@ module Metasploit
|
|
4
4
|
module Model
|
5
5
|
# Helper methods for running specs for metasploit-model.
|
6
6
|
module Spec
|
7
|
+
require 'metasploit/model/spec/temporary_pathname'
|
8
|
+
|
9
|
+
extend ActiveSupport::Autoload
|
7
10
|
extend Metasploit::Model::Spec::TemporaryPathname
|
8
11
|
# without this, Module.shared_examples_for will be used and RSpec will count shared_examples created with
|
9
12
|
# {shared_examples_for} to not be declared at the top-level.
|
10
13
|
extend RSpec::Core::SharedExampleGroup::TopLevelDSL
|
11
14
|
|
15
|
+
autoload :Error
|
16
|
+
autoload :I18nExceptionHandler
|
17
|
+
autoload :PathnameCollision
|
18
|
+
|
12
19
|
# Defines a shared examples for a `Module` under the {Metasploit::Model} namespace. This `Module` is assumed to
|
13
20
|
# be a mixin that can be mixed into an ActiveModel in metasploit-framework or an ActiveRecord in
|
14
21
|
# metasploit_data_models. Shared examples declared using this method get access to boiler plate methods used
|
@@ -1,3 +1,5 @@
|
|
1
|
+
require 'metasploit/model'
|
2
|
+
|
1
3
|
# ActiveRecord::Translation is a dirty bastard and overrides `ActiveModel::Translation#lookup_ancestors`, so that it
|
2
4
|
# will only count superclasses, and not all ancestors. Metasploit::Model needs the original behavior so that its
|
3
5
|
# {Metasploit::Model::Module} modules can supply translations to both `ActiveRecord::Base` descendants in `Mdm` and
|
@@ -5,9 +5,9 @@ module Metasploit
|
|
5
5
|
# The major version number.
|
6
6
|
MAJOR = 0
|
7
7
|
# The minor version number, scoped to the {MAJOR} version number.
|
8
|
-
MINOR =
|
8
|
+
MINOR = 27
|
9
9
|
# The patch number, scoped to the {MINOR} version number.
|
10
|
-
PATCH =
|
10
|
+
PATCH = 0
|
11
11
|
|
12
12
|
# The full version string, including the {MAJOR}, {MINOR}, {PATCH}, and optionally, the {PRERELEASE} in the
|
13
13
|
# {http://semver.org/spec/v2.0.0.html semantic versioning v2.0.0} format.
|
data/metasploit-model.gemspec
CHANGED
@@ -83,7 +83,7 @@ describe Metasploit::Model::Module::Ancestor::Spec::Template do
|
|
83
83
|
end
|
84
84
|
end
|
85
85
|
|
86
|
-
context '#
|
86
|
+
context '#metasploit_module_relative_name' do
|
87
87
|
subject(:metasploit_module_relative_name) do
|
88
88
|
template.metasploit_module_relative_name
|
89
89
|
end
|
@@ -71,7 +71,7 @@ describe Metasploit::Model::Engine do
|
|
71
71
|
|
72
72
|
context 'with FactoryGirl defined' do
|
73
73
|
it 'should prepend full path to spec/factories to FactoryGirl.definition_file_paths' do
|
74
|
-
definition_file_path = Metasploit::Model.root.join('spec', 'factories')
|
74
|
+
definition_file_path = Metasploit::Model::Engine.root.join('spec', 'factories')
|
75
75
|
|
76
76
|
FactoryGirl.definition_file_paths.should_receive(:unshift).with(definition_file_path)
|
77
77
|
|
@@ -0,0 +1,83 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe Metasploit::Model::Login::Status do
|
4
|
+
context 'CONSTANTS' do
|
5
|
+
context 'ALL' do
|
6
|
+
subject(:all) {
|
7
|
+
described_class::ALL
|
8
|
+
}
|
9
|
+
|
10
|
+
it { is_expected.to include('Denied Access') }
|
11
|
+
it { is_expected.to include('Disabled') }
|
12
|
+
it { is_expected.to include('Locked Out') }
|
13
|
+
it { is_expected.to include('No Auth Required') }
|
14
|
+
it { is_expected.to include('Successful') }
|
15
|
+
it { is_expected.to include('Unable to Connect') }
|
16
|
+
it { is_expected.to include('Untried') }
|
17
|
+
end
|
18
|
+
|
19
|
+
context 'DENIED_ACCESS' do
|
20
|
+
subject(:denied_access) {
|
21
|
+
described_class::DENIED_ACCESS
|
22
|
+
}
|
23
|
+
|
24
|
+
it { is_expected.to eq('Denied Access') }
|
25
|
+
end
|
26
|
+
|
27
|
+
context 'DISABLED' do
|
28
|
+
subject(:disabled) {
|
29
|
+
described_class::DISABLED
|
30
|
+
}
|
31
|
+
|
32
|
+
it { is_expected.to eq('Disabled') }
|
33
|
+
end
|
34
|
+
|
35
|
+
context 'INCORRECT' do
|
36
|
+
subject(:incorrect) {
|
37
|
+
described_class::INCORRECT
|
38
|
+
}
|
39
|
+
|
40
|
+
it { is_expected.to eq('Incorrect') }
|
41
|
+
end
|
42
|
+
|
43
|
+
context 'LOCKED_OUT' do
|
44
|
+
subject(:locked_out) {
|
45
|
+
described_class::LOCKED_OUT
|
46
|
+
}
|
47
|
+
|
48
|
+
it { is_expected.to eq('Locked Out') }
|
49
|
+
end
|
50
|
+
|
51
|
+
context 'NO_AUTH_REQUIRED' do
|
52
|
+
subject(:no_auth_required) {
|
53
|
+
described_class::NO_AUTH_REQUIRED
|
54
|
+
}
|
55
|
+
|
56
|
+
it { is_expected.to eq('No Auth Required') }
|
57
|
+
end
|
58
|
+
|
59
|
+
context 'SUCCESSFUL' do
|
60
|
+
subject(:successful) {
|
61
|
+
described_class::SUCCESSFUL
|
62
|
+
}
|
63
|
+
|
64
|
+
it { is_expected.to eq('Successful') }
|
65
|
+
end
|
66
|
+
|
67
|
+
context 'UNABLE_TO_CONNECT' do
|
68
|
+
subject(:unable_to_connect) {
|
69
|
+
described_class::UNABLE_TO_CONNECT
|
70
|
+
}
|
71
|
+
|
72
|
+
it { is_expected.to eq('Unable to Connect') }
|
73
|
+
end
|
74
|
+
|
75
|
+
context 'UNTRIED' do
|
76
|
+
subject(:untried) {
|
77
|
+
described_class::UNTRIED
|
78
|
+
}
|
79
|
+
|
80
|
+
it { is_expected.to eq('Untried') }
|
81
|
+
end
|
82
|
+
end
|
83
|
+
end
|
@@ -15,7 +15,7 @@ describe Metasploit::Model::Spec do
|
|
15
15
|
end
|
16
16
|
|
17
17
|
let(:pathname) do
|
18
|
-
Metasploit::Model.root.join('spec', 'pathname')
|
18
|
+
Metasploit::Model::Engine.root.join('spec', 'pathname')
|
19
19
|
end
|
20
20
|
|
21
21
|
context 'with temporary_pathname set' do
|
@@ -68,7 +68,7 @@ describe Metasploit::Model::Spec do
|
|
68
68
|
|
69
69
|
context 'with @temporary_pathname defined' do
|
70
70
|
let(:pathname) do
|
71
|
-
Metasploit::Model.root.join('spec', 'pathname')
|
71
|
+
Metasploit::Model::Engine.root.join('spec', 'pathname')
|
72
72
|
end
|
73
73
|
|
74
74
|
before(:each) do
|
@@ -100,7 +100,7 @@ describe Metasploit::Model::Spec do
|
|
100
100
|
|
101
101
|
context 'temporary_pathname=' do
|
102
102
|
let(:temporary_pathname) do
|
103
|
-
Metasploit::Model.root.join('spec', 'temporary_pathname')
|
103
|
+
Metasploit::Model::Engine.root.join('spec', 'temporary_pathname')
|
104
104
|
end
|
105
105
|
|
106
106
|
it 'should set @temporary_pathname' do
|
data/spec/spec_helper.rb
CHANGED
@@ -19,19 +19,17 @@ require 'rspec/autorun'
|
|
19
19
|
# full backtrace in logs so its easier to trace errors
|
20
20
|
Rails.backtrace_cleaner.remove_silencers!
|
21
21
|
|
22
|
-
|
23
|
-
# in spec/support/ and its subdirectories.
|
24
|
-
support_glob = Metasploit::Model.root.join('spec', 'support', '**', '*.rb')
|
22
|
+
spec_pathname = Metasploit::Model::Engine.root.join('spec')
|
25
23
|
|
26
|
-
Dir.
|
27
|
-
require
|
24
|
+
Dir[spec_pathname.join('support', '**', '*.rb')].each do |f|
|
25
|
+
require f
|
28
26
|
end
|
29
27
|
|
30
28
|
RSpec.configure do |config|
|
31
29
|
config.before(:suite) do
|
32
30
|
# this must be explicitly set here because it should always be spec/tmp for w/e project is using
|
33
31
|
# Metasploit::Model::Spec to handle file system clean up.
|
34
|
-
Metasploit::Model::Spec.temporary_pathname =
|
32
|
+
Metasploit::Model::Spec.temporary_pathname = spec_pathname.join('tmp')
|
35
33
|
# Clean up any left over files from a previously aborted suite
|
36
34
|
Metasploit::Model::Spec.remove_temporary_pathname
|
37
35
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: metasploit-model
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.27.0
|
5
5
|
platform: java
|
6
6
|
authors:
|
7
7
|
- Luke Imhoff
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-09-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -66,6 +66,20 @@ dependencies:
|
|
66
66
|
version: '0'
|
67
67
|
prerelease: false
|
68
68
|
type: :runtime
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: railties
|
71
|
+
version_requirements: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - <
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: 4.0.0
|
76
|
+
requirement: !ruby/object:Gem::Requirement
|
77
|
+
requirements:
|
78
|
+
- - <
|
79
|
+
- !ruby/object:Gem::Version
|
80
|
+
version: 4.0.0
|
81
|
+
prerelease: false
|
82
|
+
type: :runtime
|
69
83
|
- !ruby/object:Gem::Dependency
|
70
84
|
name: kramdown
|
71
85
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -160,13 +174,6 @@ files:
|
|
160
174
|
- lib/metasploit/model/authority/waraxe.rb
|
161
175
|
- lib/metasploit/model/authority/zdi.rb
|
162
176
|
- lib/metasploit/model/base.rb
|
163
|
-
- lib/metasploit/model/configuration.rb
|
164
|
-
- lib/metasploit/model/configuration/autoload.rb
|
165
|
-
- lib/metasploit/model/configuration/child.rb
|
166
|
-
- lib/metasploit/model/configuration/error.rb
|
167
|
-
- lib/metasploit/model/configuration/i18n.rb
|
168
|
-
- lib/metasploit/model/configuration/parent.rb
|
169
|
-
- lib/metasploit/model/configured.rb
|
170
177
|
- lib/metasploit/model/derivation.rb
|
171
178
|
- lib/metasploit/model/derivation/full_name.rb
|
172
179
|
- lib/metasploit/model/email_address.rb
|
@@ -174,15 +181,19 @@ files:
|
|
174
181
|
- lib/metasploit/model/error.rb
|
175
182
|
- lib/metasploit/model/file.rb
|
176
183
|
- lib/metasploit/model/invalid.rb
|
184
|
+
- lib/metasploit/model/login.rb
|
177
185
|
- lib/metasploit/model/login/status.rb
|
178
186
|
- lib/metasploit/model/module.rb
|
179
187
|
- lib/metasploit/model/module/action.rb
|
180
188
|
- lib/metasploit/model/module/ancestor.rb
|
189
|
+
- lib/metasploit/model/module/ancestor/spec.rb
|
181
190
|
- lib/metasploit/model/module/architecture.rb
|
182
191
|
- lib/metasploit/model/module/author.rb
|
183
192
|
- lib/metasploit/model/module/class.rb
|
193
|
+
- lib/metasploit/model/module/class/spec.rb
|
184
194
|
- lib/metasploit/model/module/handler.rb
|
185
195
|
- lib/metasploit/model/module/instance.rb
|
196
|
+
- lib/metasploit/model/module/instance/spec.rb
|
186
197
|
- lib/metasploit/model/module/path.rb
|
187
198
|
- lib/metasploit/model/module/platform.rb
|
188
199
|
- lib/metasploit/model/module/rank.rb
|
@@ -195,15 +206,20 @@ files:
|
|
195
206
|
- lib/metasploit/model/nilify_blanks.rb
|
196
207
|
- lib/metasploit/model/platform.rb
|
197
208
|
- lib/metasploit/model/real_pathname.rb
|
209
|
+
- lib/metasploit/model/realm.rb
|
198
210
|
- lib/metasploit/model/realm/key.rb
|
199
211
|
- lib/metasploit/model/reference.rb
|
200
212
|
- lib/metasploit/model/search.rb
|
201
213
|
- lib/metasploit/model/search/association.rb
|
202
214
|
- lib/metasploit/model/search/attribute.rb
|
215
|
+
- lib/metasploit/model/search/group.rb
|
203
216
|
- lib/metasploit/model/search/operation.rb
|
217
|
+
- lib/metasploit/model/search/operation/group.rb
|
204
218
|
- lib/metasploit/model/search/operation/integer/value.rb
|
205
219
|
- lib/metasploit/model/search/operation/string/value.rb
|
206
220
|
- lib/metasploit/model/search/operator.rb
|
221
|
+
- lib/metasploit/model/search/operator/deprecated.rb
|
222
|
+
- lib/metasploit/model/search/operator/group.rb
|
207
223
|
- lib/metasploit/model/search/operator/help.rb
|
208
224
|
- lib/metasploit/model/search/with.rb
|
209
225
|
- lib/metasploit/model/spec.rb
|
@@ -369,18 +385,13 @@ files:
|
|
369
385
|
- spec/lib/metasploit/model/authority/zdi_spec.rb
|
370
386
|
- spec/lib/metasploit/model/authority_spec.rb
|
371
387
|
- spec/lib/metasploit/model/base_spec.rb
|
372
|
-
- spec/lib/metasploit/model/configuration/autoload_spec.rb
|
373
|
-
- spec/lib/metasploit/model/configuration/child_spec.rb
|
374
|
-
- spec/lib/metasploit/model/configuration/error_spec.rb
|
375
|
-
- spec/lib/metasploit/model/configuration/i18n_spec.rb
|
376
|
-
- spec/lib/metasploit/model/configuration_spec.rb
|
377
|
-
- spec/lib/metasploit/model/configured_spec.rb
|
378
388
|
- spec/lib/metasploit/model/derivation/full_name_spec.rb
|
379
389
|
- spec/lib/metasploit/model/derivation_spec.rb
|
380
390
|
- spec/lib/metasploit/model/email_address_spec.rb
|
381
391
|
- spec/lib/metasploit/model/engine_spec.rb
|
382
392
|
- spec/lib/metasploit/model/file_spec.rb
|
383
393
|
- spec/lib/metasploit/model/invalid_spec.rb
|
394
|
+
- spec/lib/metasploit/model/login/status_spec.rb
|
384
395
|
- spec/lib/metasploit/model/module/action_spec.rb
|
385
396
|
- spec/lib/metasploit/model/module/ancestor_spec.rb
|
386
397
|
- spec/lib/metasploit/model/module/architecture_spec.rb
|
@@ -417,9 +428,7 @@ files:
|
|
417
428
|
- spec/lib/metasploit/model/translation_spec.rb
|
418
429
|
- spec/lib/metasploit/model/version_spec.rb
|
419
430
|
- spec/lib/metasploit/model/visitation/visit_spec.rb
|
420
|
-
- spec/lib/metasploit/model_spec.rb
|
421
431
|
- spec/spec_helper.rb
|
422
|
-
- spec/support/shared/contexts/metasploit/model/configuration.rb
|
423
432
|
- spec/support/shared/contexts/metasploit/model/module/ancestor/contents/metasploit_module.rb
|
424
433
|
- spec/support/shared/contexts/metasploit/model/module/ancestor/factory/contents.rb
|
425
434
|
- spec/support/shared/contexts/metasploit/model/module/ancestor/factory/contents/metasploit_module.rb
|
@@ -430,7 +439,6 @@ files:
|
|
430
439
|
- spec/support/shared/examples/metasploit/model/author.rb
|
431
440
|
- spec/support/shared/examples/metasploit/model/authority.rb
|
432
441
|
- spec/support/shared/examples/metasploit/model/authority/seed.rb
|
433
|
-
- spec/support/shared/examples/metasploit/model/configuration/parent/child.rb
|
434
442
|
- spec/support/shared/examples/metasploit/model/email_address.rb
|
435
443
|
- spec/support/shared/examples/metasploit/model/module/action.rb
|
436
444
|
- spec/support/shared/examples/metasploit/model/module/ancestor.rb
|
@@ -500,7 +508,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
500
508
|
version: '0'
|
501
509
|
requirements: []
|
502
510
|
rubyforge_project:
|
503
|
-
rubygems_version: 2.
|
511
|
+
rubygems_version: 2.1.9
|
504
512
|
signing_key:
|
505
513
|
specification_version: 4
|
506
514
|
summary: Metasploit Model Mixins and Validators
|
@@ -655,18 +663,13 @@ test_files:
|
|
655
663
|
- spec/lib/metasploit/model/authority/zdi_spec.rb
|
656
664
|
- spec/lib/metasploit/model/authority_spec.rb
|
657
665
|
- spec/lib/metasploit/model/base_spec.rb
|
658
|
-
- spec/lib/metasploit/model/configuration/autoload_spec.rb
|
659
|
-
- spec/lib/metasploit/model/configuration/child_spec.rb
|
660
|
-
- spec/lib/metasploit/model/configuration/error_spec.rb
|
661
|
-
- spec/lib/metasploit/model/configuration/i18n_spec.rb
|
662
|
-
- spec/lib/metasploit/model/configuration_spec.rb
|
663
|
-
- spec/lib/metasploit/model/configured_spec.rb
|
664
666
|
- spec/lib/metasploit/model/derivation/full_name_spec.rb
|
665
667
|
- spec/lib/metasploit/model/derivation_spec.rb
|
666
668
|
- spec/lib/metasploit/model/email_address_spec.rb
|
667
669
|
- spec/lib/metasploit/model/engine_spec.rb
|
668
670
|
- spec/lib/metasploit/model/file_spec.rb
|
669
671
|
- spec/lib/metasploit/model/invalid_spec.rb
|
672
|
+
- spec/lib/metasploit/model/login/status_spec.rb
|
670
673
|
- spec/lib/metasploit/model/module/action_spec.rb
|
671
674
|
- spec/lib/metasploit/model/module/ancestor_spec.rb
|
672
675
|
- spec/lib/metasploit/model/module/architecture_spec.rb
|
@@ -703,9 +706,7 @@ test_files:
|
|
703
706
|
- spec/lib/metasploit/model/translation_spec.rb
|
704
707
|
- spec/lib/metasploit/model/version_spec.rb
|
705
708
|
- spec/lib/metasploit/model/visitation/visit_spec.rb
|
706
|
-
- spec/lib/metasploit/model_spec.rb
|
707
709
|
- spec/spec_helper.rb
|
708
|
-
- spec/support/shared/contexts/metasploit/model/configuration.rb
|
709
710
|
- spec/support/shared/contexts/metasploit/model/module/ancestor/contents/metasploit_module.rb
|
710
711
|
- spec/support/shared/contexts/metasploit/model/module/ancestor/factory/contents.rb
|
711
712
|
- spec/support/shared/contexts/metasploit/model/module/ancestor/factory/contents/metasploit_module.rb
|
@@ -716,7 +717,6 @@ test_files:
|
|
716
717
|
- spec/support/shared/examples/metasploit/model/author.rb
|
717
718
|
- spec/support/shared/examples/metasploit/model/authority.rb
|
718
719
|
- spec/support/shared/examples/metasploit/model/authority/seed.rb
|
719
|
-
- spec/support/shared/examples/metasploit/model/configuration/parent/child.rb
|
720
720
|
- spec/support/shared/examples/metasploit/model/email_address.rb
|
721
721
|
- spec/support/shared/examples/metasploit/model/module/action.rb
|
722
722
|
- spec/support/shared/examples/metasploit/model/module/ancestor.rb
|
@@ -1,72 +0,0 @@
|
|
1
|
-
# @note This can't be a model in app/models because it is used to setup the autoload_path to app/models.
|
2
|
-
#
|
3
|
-
# Configuration for a gem's autoload and i18n load paths that works outside of the railties or rails engines systems.
|
4
|
-
class Metasploit::Model::Configuration
|
5
|
-
# no autoload paths yet, so have to explicitly require
|
6
|
-
require 'metasploit/model/configuration/parent'
|
7
|
-
extend Metasploit::Model::Configuration::Parent
|
8
|
-
|
9
|
-
#
|
10
|
-
# Attributes
|
11
|
-
#
|
12
|
-
|
13
|
-
# @!attribute [rw] root
|
14
|
-
# The root of the gem. All relative paths are resolved relative to {#root}.
|
15
|
-
#
|
16
|
-
# @return [Pathname]
|
17
|
-
|
18
|
-
#
|
19
|
-
# Children
|
20
|
-
#
|
21
|
-
|
22
|
-
# @!macro [attach] child
|
23
|
-
# @!attribute [rw] $1_class
|
24
|
-
# The `Class` used to create {#$1}.
|
25
|
-
#
|
26
|
-
# @return [Class]
|
27
|
-
#
|
28
|
-
# @!method $1
|
29
|
-
# The $1 configuration.
|
30
|
-
#
|
31
|
-
# @return [Object] an instance of {#$1_class}
|
32
|
-
#
|
33
|
-
# @!method $1_class
|
34
|
-
# The `Class` used to create {#$1}.
|
35
|
-
#
|
36
|
-
# @return [Class]
|
37
|
-
child :autoload
|
38
|
-
child :i18n
|
39
|
-
|
40
|
-
#
|
41
|
-
# Methods
|
42
|
-
#
|
43
|
-
|
44
|
-
# The root of the gem.
|
45
|
-
#
|
46
|
-
# @return [Pathname] root of gem
|
47
|
-
# @raise [Metasploit::Model::Configuration::Error] if {#root=} is not called prior to calling {#root}.
|
48
|
-
def root
|
49
|
-
unless instance_variable_defined?(:@root)
|
50
|
-
raise Metasploit::Model::Configuration::Error, "#{self.class}.root not set prior to use"
|
51
|
-
end
|
52
|
-
|
53
|
-
@root
|
54
|
-
end
|
55
|
-
|
56
|
-
# Sets root of this gem.
|
57
|
-
#
|
58
|
-
# @param root [Pathname, String]
|
59
|
-
# @return [String]
|
60
|
-
def root=(root)
|
61
|
-
@root = Pathname.new root
|
62
|
-
end
|
63
|
-
|
64
|
-
# Sets up {#autoload} and {#i18n}
|
65
|
-
#
|
66
|
-
# @return [void]
|
67
|
-
# @raise [Metasploit::Model::Invalid] if {#configuration} {Metasploit::Model::Configuration#root} is not set.
|
68
|
-
def setup
|
69
|
-
autoload.setup
|
70
|
-
i18n.setup
|
71
|
-
end
|
72
|
-
end
|