metasploit-model 0.27.0.pre.dep.pre.railties → 0.27.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (120) hide show
  1. checksums.yaml +13 -5
  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 +1 -0
  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 +0 -1
  98. data/lib/metasploit/model/visitation.rb +2 -0
  99. data/spec/app/models/metasploit/model/module/ancestor/spec/template_spec.rb +1 -1
  100. data/spec/lib/metasploit/model/engine_spec.rb +1 -1
  101. data/spec/lib/metasploit/model/login/status_spec.rb +83 -0
  102. data/spec/lib/metasploit/model/spec_spec.rb +3 -3
  103. data/spec/spec_helper.rb +4 -6
  104. metadata +22 -36
  105. data/lib/metasploit/model/configuration.rb +0 -72
  106. data/lib/metasploit/model/configuration/autoload.rb +0 -109
  107. data/lib/metasploit/model/configuration/child.rb +0 -12
  108. data/lib/metasploit/model/configuration/error.rb +0 -4
  109. data/lib/metasploit/model/configuration/i18n.rb +0 -54
  110. data/lib/metasploit/model/configuration/parent.rb +0 -50
  111. data/lib/metasploit/model/configured.rb +0 -46
  112. data/spec/lib/metasploit/model/configuration/autoload_spec.rb +0 -165
  113. data/spec/lib/metasploit/model/configuration/child_spec.rb +0 -24
  114. data/spec/lib/metasploit/model/configuration/error_spec.rb +0 -5
  115. data/spec/lib/metasploit/model/configuration/i18n_spec.rb +0 -103
  116. data/spec/lib/metasploit/model/configuration_spec.rb +0 -106
  117. data/spec/lib/metasploit/model/configured_spec.rb +0 -41
  118. data/spec/lib/metasploit/model_spec.rb +0 -68
  119. data/spec/support/shared/contexts/metasploit/model/configuration.rb +0 -11
  120. data/spec/support/shared/examples/metasploit/model/configuration/parent/child.rb +0 -60
checksums.yaml CHANGED
@@ -1,7 +1,15 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 7926985bb0bcac362243970eb42db559a1e2d1a1
4
- data.tar.gz: 2d0c3a6b77fabd8a40285933f00bc0c4a43b0aaa
2
+ !binary "U0hBMQ==":
3
+ metadata.gz: !binary |-
4
+ ZTllYjkwYzQwZjcyZjEyYmZkMGM1MDY1YTFmNDkxZjk1NzdiOTc0MA==
5
+ data.tar.gz: !binary |-
6
+ YjM2NDBkZjlkMmRmZTY3ZWY4MGEzNzM0ZjVmMDI4YTA1ZTVjYTc2Nw==
5
7
  SHA512:
6
- metadata.gz: 6846770b940b19e3d9ac67fa34d84341b132edee34ccd5aff39c9150bb229b5ed3c31b14522825e6566e1bf64a18a7a8cbd1be7c050059491df9b8f14eabab66
7
- data.tar.gz: 143967683de5189b9090a81cef7bf19250b6b463f18422321b74f4acbd1a7a228f938ab5ee6a5a461ee052c878b5cf7d3bc1fe87aa5b38bba46386228eff07a8
8
+ metadata.gz: !binary |-
9
+ ZjFmZmYyYjExZjQ0ZTE4OWE0NmRjMzY0NzUzYWI5ODdlMmRhZDEwYzFiMjZk
10
+ OTQxZTJkMDc0MWRmOWVkNTMwMzRkMzdmZTlhMDZkNjk3MWNhOGM4Y2I3YTUw
11
+ MTdjMWM2Zjc1NTg2ZmI1Y2Y1NGVhZGEzOTk2MmQ4YTFjZDljZWU=
12
+ data.tar.gz: !binary |-
13
+ M2VmNjZkZThhMTY2YWExNTVhZTJlMDgwYmJhNDM2M2ZlOTBmYThlODM3Yzdk
14
+ MDFlYTEzOTM2MDcxZDVhY2JlZjJiZGFjM2Y1MjY1YmIzMzA3MmYyY2EyNWUy
15
+ NGNjMWNkMzEyN2QxMTRmZmJhMDI5ZmM1ZDFlODM3MmZkN2QyNTM=
@@ -1,3 +1,6 @@
1
+ require 'metasploit/model/association'
2
+ require 'metasploit/model/base'
3
+
1
4
  # Reflection of the call to {Metasploit::Model::Association::ClassMethods#association}.
2
5
  class Metasploit::Model::Association::Reflection < Metasploit::Model::Base
3
6
  #
@@ -1,3 +1,6 @@
1
+ require 'metasploit/model/module/ancestor/spec'
2
+ require 'metasploit/model/spec/template/write'
3
+
1
4
  # Writes templates for the {#module_ancestor} to disk.
2
5
  #
3
6
  # @example Update files after changing
@@ -1,3 +1,7 @@
1
+ require 'metasploit/model/base'
2
+ require 'metasploit/model/module/class/spec'
3
+ require 'metasploit/model/spec/template/write'
4
+
1
5
  # Writes templates for the {#module_class #module_class's} {Metasploit::Model::Module::Class#ancestors} to disk.
2
6
  #
3
7
  # @example Update files after changing associations
@@ -1,3 +1,7 @@
1
+ require 'metasploit/model/base'
2
+ require 'metasploit/model/module/instance/spec'
3
+ require 'metasploit/model/spec/template/write'
4
+
1
5
  # Writes templates for the {#module_instance #module_instance's}
2
6
  # {Metasploit::Model::Module::Instance#module_class #module_class's} {Metasploit::Model::Module::Class#ancestors} to
3
7
  # disk.
@@ -1,3 +1,6 @@
1
+ require 'metasploit/model/base'
2
+ require 'metasploit/model/search/group'
3
+
1
4
  # Groups together {Metasploit::Model::Search::Operation::Base operations} and/or or nested groups.
2
5
  class Metasploit::Model::Search::Group::Base < Metasploit::Model::Base
3
6
  #
@@ -1,3 +1,5 @@
1
+ require 'metasploit/model/search/group'
2
+
1
3
  # The intersection (ANDing) of {Metasploit::Model::Search::Operation::Base operations} and/or or nested groups.
2
4
  class Metasploit::Model::Search::Group::Intersection < Metasploit::Model::Search::Group::Base
3
5
 
@@ -1,3 +1,5 @@
1
+ require 'metasploit/model/search/group'
2
+
1
3
  # The union (ORing) of {Metasploit::Model::Search::Operation::Base operations} and/or or nested groups.
2
4
  class Metasploit::Model::Search::Group::Union < Metasploit::Model::Search::Group::Base
3
5
 
@@ -1,3 +1,5 @@
1
+ require 'metasploit/model/search/operation'
2
+
1
3
  # An operation with a {Metasploit::Model::Search::Operator::Association} for
2
4
  # {Metasploit::Model::Search::Operation::Base#operator} that wraps a {#source_operation} produced by the
3
5
  # {Metasploit::Model::Search::Operator::Association#source_operator}. This allows an arbitrary number of associations
@@ -1,3 +1,6 @@
1
+ require 'metasploit/model/base'
2
+ require 'metasploit/model/search/operation'
3
+
1
4
  # Base of all search operations that combine an {#operator} with the {#value} it is operating on. Subclasses allow
2
5
  # validations specific to the {#operator} {Metasploit::Model::Search::Operator::Single#type type}.
3
6
  class Metasploit::Model::Search::Operation::Base < Metasploit::Model::Base
@@ -1,3 +1,5 @@
1
+ require 'metasploit/model/search/operation'
2
+
1
3
  # Search operation with {Metasploit::Model::Search::Operation::Base#operator} with `#type` `:boolean`. Validates that
2
4
  # value is a proper boolean (`false` or `true`) or the `String` version of either.
3
5
  class Metasploit::Model::Search::Operation::Boolean < Metasploit::Model::Search::Operation::Base
@@ -1,3 +1,5 @@
1
+ require 'metasploit/model/search/operation'
2
+
1
3
  # Search operation with {Metasploit::Model::Search::Operation::Base#operator} with `#type` ':date'. Validates that
2
4
  # value is `String` that can parsed with `Date.parse` or already a `Date`.
3
5
  class Metasploit::Model::Search::Operation::Date < Metasploit::Model::Search::Operation::Base
@@ -1,3 +1,5 @@
1
+ require 'metasploit/model/search/operation/group'
2
+
1
3
  # A group of one or more {#children child operations} from an operator's `#operate_on`, should be visited the same as
2
4
  # {Metasploit::Model::Search::Group::Base}.
3
5
  class Metasploit::Model::Search::Operation::Group::Base < Metasploit::Model::Search::Operation::Base
@@ -1,3 +1,5 @@
1
+ require 'metasploit/model/search/operation/group'
2
+
1
3
  # An intersection of one or more {Metasploit::Model::Search::Operation::Group::Base#children child operations} from an
2
4
  # operator's `#operate_on`, should be visited the same as {Metasploit::Model::Search::Group::Base}.
3
5
  class Metasploit::Model::Search::Operation::Group::Intersection < Metasploit::Model::Search::Operation::Group::Base
@@ -1,3 +1,5 @@
1
+ require 'metasploit/model/search/operation/group'
2
+
1
3
  # A union of one or more {Metasploit::Model::Search::Operation::Group::Base#children child operations} from an
2
4
  # operator's `#operate_on`, should be visited the same as {Metasploit::Model::Search::Group::Base}.
3
5
  class Metasploit::Model::Search::Operation::Group::Union < Metasploit::Model::Search::Operation::Group::Base
@@ -1,6 +1,10 @@
1
+ require 'metasploit/model/search/operation'
2
+
1
3
  # Search operation with {Metasploit::Model::Search::Operation::Base#operator} with `#type` `:integer`. Validates that
2
4
  # value is an integer.
3
5
  class Metasploit::Model::Search::Operation::Integer < Metasploit::Model::Search::Operation::Base
6
+ require 'metasploit/model/search/operation/integer/value'
7
+
4
8
  include Metasploit::Model::Search::Operation::Integer::Value
5
9
 
6
10
  #
@@ -1,3 +1,5 @@
1
+ require 'metasploit/model/search/operation'
2
+
1
3
  # Operation that uses a {Metasploit::Model::Search::Operation::Null null operator}.
2
4
  class Metasploit::Model::Search::Operation::Null < Metasploit::Model::Search::Operation::Base
3
5
  #
@@ -1,3 +1,5 @@
1
+ require 'metasploit/model/search/operation'
2
+
1
3
  # Operation on an attribute that has a constrained Set of valid
2
4
  # {Metasploit::Model::Search::Operation::Base#value values}.
3
5
  class Metasploit::Model::Search::Operation::Set < Metasploit::Model::Search::Operation::Base
@@ -1,3 +1,5 @@
1
+ require 'metasploit/model/search/operation/integer'
2
+
1
3
  # Search operation on an attribute that has a `Set<Integer>` for acceptable
2
4
  # {Metasploit::Model::Search::Operation::Base values}.
3
5
  class Metasploit::Model::Search::Operation::Set::Integer < Metasploit::Model::Search::Operation::Set
@@ -1,3 +1,5 @@
1
+ require 'metasploit/model/search/operation/string'
2
+
1
3
  # Search operation on an attribute that has a `Set<String>` for acceptable
2
4
  # {Metasploit::Model::Search::Operation::Base values}.
3
5
  class Metasploit::Model::Search::Operation::Set::String < Metasploit::Model::Search::Operation::Set
@@ -1,5 +1,9 @@
1
+ require 'metasploit/model/search/operation'
2
+
1
3
  # Search operation with {Metasploit::Model::Search::Operation::Base#operator} with `#type` `:string`.
2
4
  class Metasploit::Model::Search::Operation::String < Metasploit::Model::Search::Operation::Base
5
+ require 'metasploit/model/search/operation/string/value'
6
+
3
7
  include Metasploit::Model::Search::Operation::String::Value
4
8
 
5
9
  #
@@ -1,3 +1,5 @@
1
+ require 'metasploit/model/search/operator'
2
+
1
3
  # A search operator declared with
2
4
  # {Metasploit::Model::Search::Association::ClassMethods#search_association search_association}.
3
5
  class Metasploit::Model::Search::Operator::Association < Metasploit::Model::Search::Operator::Base
@@ -1,3 +1,5 @@
1
+ require 'metasploit/model/search/operator'
2
+
1
3
  # A search operator declared with
2
4
  # {Metasploit::Model::Search::Attribute::ClassMethods#search_attribute search_attribute}.
3
5
  class Metasploit::Model::Search::Operator::Attribute < Metasploit::Model::Search::Operator::Single
@@ -1,3 +1,7 @@
1
+ require 'metasploit/model/base'
2
+ require 'metasploit/model/search/operator'
3
+ require 'metasploit/model/search/operator/help'
4
+
1
5
  # Instead of writing an operator completely from scratch, you can subclass
2
6
  # {Metasploit::Model::Search::Operator::Base}.
3
7
  #
@@ -1,3 +1,5 @@
1
+ require 'metasploit/model/search/operator'
2
+
1
3
  # An operator that delegates to another operator(s).
2
4
  class Metasploit::Model::Search::Operator::Delegation < Metasploit::Model::Search::Operator::Base
3
5
  #
@@ -1,3 +1,5 @@
1
+ require 'metasploit/model/search/operator/deprecated'
2
+
1
3
  # Emulates the deprecated `app` operator by converting it to the union of `authors.name:<value>`,
2
4
  # `email_addresses.local<value before '@'>`, and `email_addresses.domain:<value before '@'>` in {#operate_on}.
3
5
  class Metasploit::Model::Search::Operator::Deprecated::App < Metasploit::Model::Search::Operator::Delegation
@@ -1,3 +1,5 @@
1
+ require 'metasploit/model/search/operator/deprecated'
2
+
1
3
  # Operator that emulates the behavior of 'author' operator that could search `Mdm::Module::Detail` by making
2
4
  # {Metasploit::Model::Search::Operation::Group::Union} between `authors.name`, `email_addresss.domain`, and
3
5
  # `email_addresses.local`.
@@ -1,3 +1,5 @@
1
+ require 'metasploit/model/search/operator/deprecated'
2
+
1
3
  # Operator for the direct, single authority reference search. Translates `<abbreviation>:<designation>` to
2
4
  # `authorities.abbreviation:<abbreviation> references.designation:<designation>`.
3
5
  class Metasploit::Model::Search::Operator::Deprecated::Authority < Metasploit::Model::Search::Operator::Delegation
@@ -1,3 +1,5 @@
1
+ require 'metasploit/model/search/operator/deprecated'
2
+
1
3
  # Translates `<name>:<value>` to the union of `platforms.name:<value>` and `targets.name:<value>` in order to support
2
4
  # the `os` and `platform` operators.
3
5
  class Metasploit::Model::Search::Operator::Deprecated::Platform < Metasploit::Model::Search::Operator::Group::Union
@@ -1,3 +1,5 @@
1
+ require 'metasploit/model/search/operator/deprecated'
2
+
1
3
  # Translates `ref:<value>` to union of `authorities.abbreviation:<value>`, `references.designation:<value>`, and
2
4
  # `references.designation:<value>`.
3
5
  class Metasploit::Model::Search::Operator::Deprecated::Ref < Metasploit::Model::Search::Operator::Group::Union
@@ -1,3 +1,5 @@
1
+ require 'metasploit/model/search/operator/deprecated'
2
+
1
3
  # Search the equivalent of the text fields from `Mdm::Module::Detail` and its associations, making a union of
2
4
  # `description`, `name`, `actions.name`, `architectures.abbreviation`, `platform`, and `ref`.
3
5
  class Metasploit::Model::Search::Operator::Deprecated::Text < Metasploit::Model::Search::Operator::Group::Union
@@ -1,3 +1,5 @@
1
+ require 'metasploit/model/search/operator/group'
2
+
1
3
  # Operator that {#operate_on produces} {Metasploit::Model::Search::Operation::Group::Base group operations}.
2
4
  class Metasploit::Model::Search::Operator::Group::Base < Metasploit::Model::Search::Operator::Delegation
3
5
  #
@@ -1,3 +1,5 @@
1
+ require 'metasploit/model/search/operator/group'
2
+
1
3
  # Operator that {Metasploit::Model::Search::Operator::Group::Base#operate_on produces}
2
4
  # {Metasploit::Model::Search::Operation::Group::Intersection intersection operations}.
3
5
  class Metasploit::Model::Search::Operator::Group::Intersection < Metasploit::Model::Search::Operator::Group::Base
@@ -1,3 +1,5 @@
1
+ require 'metasploit/model/search/operator/group'
2
+
1
3
  # Operator that {Metasploit::Model::Search::Operator::Group::Base#operate_on produces}
2
4
  # {Metasploit::Model::Search::Operation::Group::Union union operations}.
3
5
  class Metasploit::Model::Search::Operator::Group::Union < Metasploit::Model::Search::Operator::Group::Base
@@ -1,3 +1,5 @@
1
+ require 'metasploit/model/search/operator'
2
+
1
3
  # Operator used when the formatted operator name does not match a class's operators.
2
4
  class Metasploit::Model::Search::Operator::Null < Metasploit::Model::Search::Operator::Single
3
5
  #
@@ -1,3 +1,5 @@
1
+ require 'metasploit/model/search/operator/single'
2
+
1
3
  # If all you want do is customize the name and operation `Class` that your custom operator class returns from
2
4
  # `#operate_on`, then you can subclass {Metasploit::Model::Search::Operator::Single} instead of
3
5
  # {Metasploit::Model::Search::Operator::Base}.
@@ -1,3 +1,6 @@
1
+ require 'metasploit/model/base'
2
+ require 'metasploit/model/search'
3
+
1
4
  # Once {Metasploit::Model::Search::Operator search operators} are {Metasploit::Model::Search defined}, a formatted
2
5
  # query, composed of space separated formatted operation, `<operator.name>:<formatted_value>`, can be parsed to
3
6
  # produce a validatable query.
@@ -1,12 +1,19 @@
1
+ require 'metasploit/model/base'
2
+ require 'metasploit/model/spec'
3
+
1
4
  # Processes {EXTENSION '.rb.erb'} templates to create {Metasploit::Model::Module::Ancestor#contents} that contain the
2
5
  # same metadata as the {Metasploit::Model::Module::Ancestor},
3
6
  # {Metasploit::Model::Module::Class}, {Metasploit::Model::Module::Instance} and associations for those contents. This
4
7
  # ensures that when the {Metasploit::Model::Module::Ancestor#contents} are loaded in metasploit-framework, the same
5
8
  # metadata instances are derived from the contents ensuring idempotency of the contents and metadata parsing loop.
6
9
  class Metasploit::Model::Spec::Template < Metasploit::Model::Base
10
+ extend ActiveSupport::Autoload
7
11
  extend ActiveModel::Callbacks
12
+
8
13
  include ActiveModel::Validations::Callbacks
9
14
 
15
+ autoload :Write
16
+
10
17
  #
11
18
  # CONSTANTS
12
19
  #
@@ -193,10 +200,10 @@ class Metasploit::Model::Spec::Template < Metasploit::Model::Base
193
200
  #
194
201
  # @return [Pathname] Defaults to 'spec/support/templates/metasploit/model' under Metasploit::Model.root.
195
202
  def root
196
- @@root ||= Metasploit::Model.root.join('spec', 'support', 'templates', 'metasploit', 'model')
203
+ @@root ||= Metasploit::Model::Engine.root.join('spec', 'support', 'templates', 'metasploit', 'model')
197
204
  end
198
205
 
199
- # Sets the {#root} pathname for all {#search_pathnames}, including those on subclasses.
206
+ # Sets the {root} pathname for all {#search_pathnames}, including those on subclasses.
200
207
  #
201
208
  # @param root [Pathname]
202
209
  # @return [Pathname]
@@ -1,3 +1,6 @@
1
+ require 'metasploit/model/base'
2
+ require 'metasploit/model/visitation'
3
+
1
4
  # Visits node in a {http://en.wikipedia.org/wiki/Tree_(data_structure) tree}, such as
2
5
  # {Metasploit::Model::Search::Query#tree}.
3
6
  class Metasploit::Model::Visitation::Visitor < Metasploit::Model::Base
@@ -9,13 +9,9 @@ require 'active_support/dependencies'
9
9
  #
10
10
  # Project
11
11
  #
12
- require 'metasploit/model/version'
13
12
 
14
- # Only include the Rails engine when using Rails. This allows the non-Rails projects, like metasploit-framework to use
15
- # the validators by calling Metasploit::Model.require_validators.
16
- if defined? Rails
17
- require 'metasploit/model/engine'
18
- end
13
+ require 'metasploit/model/engine'
14
+ require 'metasploit/model/version'
19
15
 
20
16
  # Top-level namespace shared between metasploit-model, metasploit-framework, and Pro.
21
17
  module Metasploit
@@ -24,15 +20,28 @@ module Metasploit
24
20
  # separate gem for this shard code outside of metasploit_data_models is necessary as metasploit_data_models is an
25
21
  # optional dependency for metasploit-framework as metasploit-framework can work without a database.
26
22
  module Model
27
- require 'metasploit/model/configured'
28
- extend Metasploit::Model::Configured
23
+ extend ActiveSupport::Autoload
29
24
 
30
- lib_metasploit_pathname = Pathname.new(__FILE__).dirname
31
- lib_pathname = lib_metasploit_pathname.parent
32
- configuration.root = lib_pathname.parent
33
-
34
- configuration.autoload.relative_paths << File.join('app', 'validators')
25
+ autoload :Architecture
26
+ autoload :Association
27
+ autoload :Author
28
+ autoload :Authority
29
+ autoload :Base
30
+ autoload :Derivation
31
+ autoload :EmailAddress
32
+ autoload :Error
33
+ autoload :File
34
+ autoload :Invalid
35
+ autoload :Login
36
+ autoload :Module
37
+ autoload :NilifyBlanks
38
+ autoload :Platform
39
+ autoload :RealPathname
40
+ autoload :Realm
41
+ autoload :Reference
42
+ autoload :Search
43
+ autoload :Spec
44
+ autoload :Translation
45
+ autoload :Visitation
35
46
  end
36
47
  end
37
-
38
- Metasploit::Model.setup
@@ -1,3 +1,5 @@
1
+ require 'metasploit/model/translation'
2
+
1
3
  module Metasploit
2
4
  module Model
3
5
  # Code shared between `Mdm::Architecture` and `Metasploit::Framework::Architecture`.
@@ -3,8 +3,12 @@ module Metasploit
3
3
  # Allows registering the class name of assocations similar to ActiveRecord associations, so that ActiveModel
4
4
  # associations can be reflected with the same API as ActiveRecord associations.
5
5
  module Association
6
+ extend ActiveSupport::Autoload
6
7
  extend ActiveSupport::Concern
7
8
 
9
+ autoload :Error
10
+ autoload :Tree
11
+
8
12
  # Defines DSL for define associations on ActiveModels with {#association}, which can then be retrieved in bulk
9
13
  # with {#association_by_name} or a single association's reflection by name with {#reflect_on_association}.
10
14
  module ClassMethods
@@ -1,3 +1,5 @@
1
+ require 'metasploit/model/translation'
2
+
1
3
  module Metasploit
2
4
  module Model
3
5
  # Code shared between `Mdm::Author` and `Metasploit::Framework::Author`.
@@ -1,12 +1,26 @@
1
+ require 'metasploit/model/search'
2
+ require 'metasploit/model/translation'
3
+
1
4
  module Metasploit
2
5
  module Model
3
6
  # Code shared between `Mdm::Authority` and `Metasploit::Framework::Authority`.
4
7
  module Authority
5
8
  extend ActiveModel::Naming
9
+ extend ActiveSupport::Autoload
6
10
  extend ActiveSupport::Concern
7
11
 
8
12
  include Metasploit::Model::Translation
9
13
 
14
+ autoload :Bid
15
+ autoload :Cve
16
+ autoload :Msb
17
+ autoload :Osvdb
18
+ autoload :Pmasa
19
+ autoload :Secunia
20
+ autoload :UsCertVu
21
+ autoload :Waraxe
22
+ autoload :Zdi
23
+
10
24
  included do
11
25
  include ActiveModel::MassAssignmentSecurity
12
26
  include ActiveModel::Validations
@@ -1,3 +1,5 @@
1
+ require 'metasploit/model/authority'
2
+
1
3
  # BugTraq ID authority-specific code.
2
4
  module Metasploit::Model::Authority::Bid
3
5
  # Returns URL to {Metasploit::Model::Reference#designation BugTraq ID's} page on SecurityFocus' site.