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.
Files changed (121) hide show
  1. checksums.yaml +4 -4
  2. data/app/models/metasploit/model/association/reflection.rb +3 -0
  3. data/app/models/metasploit/model/module/ancestor/spec/template.rb +3 -0
  4. data/app/models/metasploit/model/module/class/spec/template.rb +4 -0
  5. data/app/models/metasploit/model/module/instance/spec/template.rb +4 -0
  6. data/app/models/metasploit/model/search/group/base.rb +3 -0
  7. data/app/models/metasploit/model/search/group/intersection.rb +2 -0
  8. data/app/models/metasploit/model/search/group/union.rb +2 -0
  9. data/app/models/metasploit/model/search/operation/association.rb +2 -0
  10. data/app/models/metasploit/model/search/operation/base.rb +3 -0
  11. data/app/models/metasploit/model/search/operation/boolean.rb +2 -0
  12. data/app/models/metasploit/model/search/operation/date.rb +2 -0
  13. data/app/models/metasploit/model/search/operation/group/base.rb +2 -0
  14. data/app/models/metasploit/model/search/operation/group/intersection.rb +2 -0
  15. data/app/models/metasploit/model/search/operation/group/union.rb +2 -0
  16. data/app/models/metasploit/model/search/operation/integer.rb +4 -0
  17. data/app/models/metasploit/model/search/operation/null.rb +2 -0
  18. data/app/models/metasploit/model/search/operation/set.rb +2 -0
  19. data/app/models/metasploit/model/search/operation/set/integer.rb +2 -0
  20. data/app/models/metasploit/model/search/operation/set/string.rb +2 -0
  21. data/app/models/metasploit/model/search/operation/string.rb +4 -0
  22. data/app/models/metasploit/model/search/operator/association.rb +2 -0
  23. data/app/models/metasploit/model/search/operator/attribute.rb +2 -0
  24. data/app/models/metasploit/model/search/operator/base.rb +4 -0
  25. data/app/models/metasploit/model/search/operator/delegation.rb +2 -0
  26. data/app/models/metasploit/model/search/operator/deprecated/app.rb +2 -0
  27. data/app/models/metasploit/model/search/operator/deprecated/author.rb +2 -0
  28. data/app/models/metasploit/model/search/operator/deprecated/authority.rb +2 -0
  29. data/app/models/metasploit/model/search/operator/deprecated/platform.rb +2 -0
  30. data/app/models/metasploit/model/search/operator/deprecated/ref.rb +2 -0
  31. data/app/models/metasploit/model/search/operator/deprecated/text.rb +2 -0
  32. data/app/models/metasploit/model/search/operator/group/base.rb +2 -0
  33. data/app/models/metasploit/model/search/operator/group/intersection.rb +2 -0
  34. data/app/models/metasploit/model/search/operator/group/union.rb +2 -0
  35. data/app/models/metasploit/model/search/operator/null.rb +2 -0
  36. data/app/models/metasploit/model/search/operator/single.rb +2 -0
  37. data/app/models/metasploit/model/search/query.rb +3 -0
  38. data/app/models/metasploit/model/spec/template.rb +9 -2
  39. data/app/models/metasploit/model/visitation/visitor.rb +3 -0
  40. data/lib/metasploit/model.rb +24 -15
  41. data/lib/metasploit/model/architecture.rb +2 -0
  42. data/lib/metasploit/model/association.rb +4 -0
  43. data/lib/metasploit/model/author.rb +2 -0
  44. data/lib/metasploit/model/authority.rb +14 -0
  45. data/lib/metasploit/model/authority/bid.rb +2 -0
  46. data/lib/metasploit/model/authority/cve.rb +2 -0
  47. data/lib/metasploit/model/authority/msb.rb +2 -0
  48. data/lib/metasploit/model/authority/osvdb.rb +2 -0
  49. data/lib/metasploit/model/authority/pmasa.rb +2 -0
  50. data/lib/metasploit/model/authority/secunia.rb +2 -0
  51. data/lib/metasploit/model/authority/us_cert_vu.rb +2 -0
  52. data/lib/metasploit/model/authority/waraxe.rb +2 -0
  53. data/lib/metasploit/model/authority/zdi.rb +2 -0
  54. data/lib/metasploit/model/base.rb +2 -0
  55. data/lib/metasploit/model/derivation.rb +4 -1
  56. data/lib/metasploit/model/email_address.rb +2 -0
  57. data/lib/metasploit/model/engine.rb +21 -27
  58. data/lib/metasploit/model/invalid.rb +2 -0
  59. data/lib/metasploit/model/login.rb +10 -0
  60. data/lib/metasploit/model/login/status.rb +2 -0
  61. data/lib/metasploit/model/module.rb +16 -0
  62. data/lib/metasploit/model/module/action.rb +2 -0
  63. data/lib/metasploit/model/module/ancestor.rb +6 -0
  64. data/lib/metasploit/model/module/ancestor/spec.rb +5 -0
  65. data/lib/metasploit/model/module/architecture.rb +2 -0
  66. data/lib/metasploit/model/module/author.rb +2 -0
  67. data/lib/metasploit/model/module/class.rb +5 -0
  68. data/lib/metasploit/model/module/class/spec.rb +5 -0
  69. data/lib/metasploit/model/module/instance.rb +6 -0
  70. data/lib/metasploit/model/module/instance/spec.rb +5 -0
  71. data/lib/metasploit/model/module/path.rb +3 -0
  72. data/lib/metasploit/model/module/platform.rb +2 -0
  73. data/lib/metasploit/model/module/rank.rb +2 -0
  74. data/lib/metasploit/model/module/reference.rb +2 -0
  75. data/lib/metasploit/model/module/target.rb +6 -0
  76. data/lib/metasploit/model/module/target/architecture.rb +2 -0
  77. data/lib/metasploit/model/module/target/platform.rb +2 -0
  78. data/lib/metasploit/model/platform.rb +2 -0
  79. data/lib/metasploit/model/real_pathname.rb +2 -0
  80. data/lib/metasploit/model/realm.rb +9 -0
  81. data/lib/metasploit/model/realm/key.rb +2 -0
  82. data/lib/metasploit/model/reference.rb +2 -0
  83. data/lib/metasploit/model/search.rb +9 -0
  84. data/lib/metasploit/model/search/attribute.rb +2 -0
  85. data/lib/metasploit/model/search/group.rb +6 -0
  86. data/lib/metasploit/model/search/operation.rb +4 -0
  87. data/lib/metasploit/model/search/operation/group.rb +5 -0
  88. data/lib/metasploit/model/search/operator.rb +4 -0
  89. data/lib/metasploit/model/search/operator/deprecated.rb +6 -0
  90. data/lib/metasploit/model/search/operator/group.rb +5 -0
  91. data/lib/metasploit/model/spec.rb +7 -0
  92. data/lib/metasploit/model/spec/i18n_exception_handler.rb +2 -0
  93. data/lib/metasploit/model/spec/pathname_collision.rb +2 -0
  94. data/lib/metasploit/model/spec/template/write.rb +2 -0
  95. data/lib/metasploit/model/spec/temporary_pathname.rb +3 -0
  96. data/lib/metasploit/model/translation.rb +2 -0
  97. data/lib/metasploit/model/version.rb +2 -2
  98. data/lib/metasploit/model/visitation.rb +2 -0
  99. data/metasploit-model.gemspec +1 -0
  100. data/spec/app/models/metasploit/model/module/ancestor/spec/template_spec.rb +1 -1
  101. data/spec/lib/metasploit/model/engine_spec.rb +1 -1
  102. data/spec/lib/metasploit/model/login/status_spec.rb +83 -0
  103. data/spec/lib/metasploit/model/spec_spec.rb +3 -3
  104. data/spec/spec_helper.rb +4 -6
  105. metadata +28 -28
  106. data/lib/metasploit/model/configuration.rb +0 -72
  107. data/lib/metasploit/model/configuration/autoload.rb +0 -109
  108. data/lib/metasploit/model/configuration/child.rb +0 -12
  109. data/lib/metasploit/model/configuration/error.rb +0 -4
  110. data/lib/metasploit/model/configuration/i18n.rb +0 -54
  111. data/lib/metasploit/model/configuration/parent.rb +0 -50
  112. data/lib/metasploit/model/configured.rb +0 -46
  113. data/spec/lib/metasploit/model/configuration/autoload_spec.rb +0 -165
  114. data/spec/lib/metasploit/model/configuration/child_spec.rb +0 -24
  115. data/spec/lib/metasploit/model/configuration/error_spec.rb +0 -5
  116. data/spec/lib/metasploit/model/configuration/i18n_spec.rb +0 -103
  117. data/spec/lib/metasploit/model/configuration_spec.rb +0 -106
  118. data/spec/lib/metasploit/model/configured_spec.rb +0 -41
  119. data/spec/lib/metasploit/model_spec.rb +0 -68
  120. data/spec/support/shared/contexts/metasploit/model/configuration.rb +0 -11
  121. data/spec/support/shared/examples/metasploit/model/configuration/parent/child.rb +0 -60
@@ -55,7 +55,11 @@ module Metasploit
55
55
  #
56
56
  # {include:Metasploit::Model::Search::Operator::Single}
57
57
  module Operator
58
+ extend ActiveSupport::Autoload
58
59
 
60
+ autoload :Deprecated
61
+ autoload :Group
62
+ autoload :Help
59
63
  end
60
64
  end
61
65
  end
@@ -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
@@ -0,0 +1,5 @@
1
+ require 'metasploit/model/search/operator'
2
+
3
+ # Namespace for operators that produce group operations.
4
+ module Metasploit::Model::Search::Operator::Group
5
+ 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/spec'
2
+
1
3
  # Raises all I18n errors as exceptions so that missing translations (or other errors) with en.yml are caught by the
2
4
  # specs.
3
5
  #
@@ -1,3 +1,5 @@
1
+ require 'metasploit/model/spec/error'
2
+
1
3
  module Metasploit
2
4
  module Model
3
5
  module Spec
@@ -1,3 +1,5 @@
1
+ require 'metasploit/model/spec/template'
2
+
1
3
  # Extend to add a class method to create a new template and write it only if valid.
2
4
  #
3
5
  # @example extend and write
@@ -1,3 +1,6 @@
1
+ # to ensure Metasploit::Model::Spec::Error is setup for autoloading
2
+ require 'metasploit/model/spec'
3
+
1
4
  module Metasploit
2
5
  module Model
3
6
  module Spec
@@ -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 = 26
8
+ MINOR = 27
9
9
  # The patch number, scoped to the {MINOR} version number.
10
- PATCH = 1
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.
@@ -3,7 +3,9 @@ module Metasploit
3
3
  # Namespace for `metasploit-model`'s implementation of the {http://en.wikipedia.org/wiki/Visitor_pattern visitor
4
4
  # pattern}.
5
5
  module Visitation
6
+ extend ActiveSupport::Autoload
6
7
 
8
+ autoload :Visit
7
9
  end
8
10
  end
9
11
  end
@@ -25,6 +25,7 @@ Gem::Specification.new do |spec|
25
25
 
26
26
  # Dependency loading
27
27
  spec.add_runtime_dependency 'activesupport'
28
+ spec.add_runtime_dependency 'railties', '< 4.0.0'
28
29
 
29
30
  if RUBY_PLATFORM =~ /java/
30
31
  # markdown formatting for yard
@@ -83,7 +83,7 @@ describe Metasploit::Model::Module::Ancestor::Spec::Template do
83
83
  end
84
84
  end
85
85
 
86
- context '#metapsloit_module_relative_name' do
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
@@ -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
- # Requires supporting ruby files with custom matchers and macros, etc,
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.glob(support_glob) do |path|
27
- require path
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 = Metasploit::Model.root.join('spec', 'tmp')
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.26.1
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-07-29 00:00:00.000000000 Z
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.2.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