metasploit-model 0.24.1 → 0.25.1.pre.metasploit.pre.model.pre.search.pre.operator.pre.and.pre.operation.pre.groups
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/app/models/metasploit/model/search/operation/{union.rb → group/base.rb} +2 -2
- data/app/models/metasploit/model/search/operation/group/intersection.rb +4 -0
- data/app/models/metasploit/model/search/operation/group/union.rb +4 -0
- data/app/models/metasploit/model/search/operator/deprecated/author.rb +2 -2
- data/app/models/metasploit/model/search/operator/deprecated/platform.rb +1 -1
- data/app/models/metasploit/model/search/operator/deprecated/ref.rb +1 -1
- data/app/models/metasploit/model/search/operator/deprecated/text.rb +2 -2
- data/app/models/metasploit/model/search/operator/group/base.rb +77 -0
- data/app/models/metasploit/model/search/operator/group/intersection.rb +5 -0
- data/app/models/metasploit/model/search/operator/group/union.rb +5 -0
- data/config/locales/en.yml +1 -1
- data/lib/metasploit/model/version.rb +3 -1
- data/metasploit-model.gemspec +2 -1
- data/spec/app/models/metasploit/model/search/operation/{union_spec.rb → group/base_spec.rb} +12 -12
- data/spec/app/models/metasploit/model/search/operation/group/intersection_spec.rb +5 -0
- data/spec/app/models/metasploit/model/search/operation/group/union_spec.rb +5 -0
- data/spec/app/models/metasploit/model/search/operator/deprecated/author_spec.rb +1 -1
- data/spec/app/models/metasploit/model/search/operator/deprecated/platform_spec.rb +2 -2
- data/spec/app/models/metasploit/model/search/operator/deprecated/ref_spec.rb +1 -1
- data/spec/app/models/metasploit/model/search/operator/deprecated/text_spec.rb +1 -1
- data/spec/app/models/metasploit/model/search/operator/{union_spec.rb → group/base_spec.rb} +2 -2
- data/spec/app/models/metasploit/model/search/operator/group/intersection_spec.rb +13 -0
- data/spec/app/models/metasploit/model/search/operator/group/union_spec.rb +13 -0
- data/spec/lib/metasploit/model/version_spec.rb +3 -3
- data/spec/support/shared/contexts/metasploit/model/search/operator/union/children.rb +1 -1
- metadata +26 -14
- data/app/models/metasploit/model/search/operator/union.rb +0 -33
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
NGRmNzk4ODM0OTMzZmUwMDYxNzc4NDcxZGVkODZlODI5YTliMDE3Mw==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
MWJjZGNlNDE3NjZiMGYyY2NmMDU1MzgwMmY4MzA0YzE4NTcyOGY5Yg==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
NTkwNThiYzNkZWU4NDIwZjNhNGE1NzJhM2EzMWI4NjczNmM0Yzg5MGYwZmE5
|
10
|
+
Y2YxNWQwODVlZGQyODE2YWMyY2FiNGYzNzU5NGJkZTI0NGFmYzhkNzI3NDUx
|
11
|
+
YThiMjZiNjJkMDNlNTRlNzkwNmZhMGYxNmViYzRiZTgzNzBkZDA=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
OTUyYmExODZjNzc4YTcyNTc3MzdmYjQxZmI5ODJjZDRjYjNhOTU2YzA0MGI3
|
14
|
+
OTVhOGVkODg3MWRjYzBmMTA3YjZhNmJkYTBlMTIxYTRjMDEwZWFiNDA1YmY0
|
15
|
+
MzQ1NjhhZTcwNThjOWU0ZGY5MGE2OTJiNWRmMjZlN2E4NjllNDg=
|
@@ -1,6 +1,6 @@
|
|
1
|
-
# A
|
1
|
+
# A group of one or more {#children child operations} from an operator's `#operate_on`, should be visited the same as
|
2
2
|
# {Metasploit::Model::Search::Group::Base}.
|
3
|
-
class Metasploit::Model::Search::Operation::
|
3
|
+
class Metasploit::Model::Search::Operation::Group::Base < Metasploit::Model::Search::Operation::Base
|
4
4
|
#
|
5
5
|
# Attributes
|
6
6
|
#
|
@@ -0,0 +1,4 @@
|
|
1
|
+
# An intersection of one or more {Metasploit::Model::Search::Operation::Group::Base#children child operations} from an
|
2
|
+
# operator's `#operate_on`, should be visited the same as {Metasploit::Model::Search::Group::Base}.
|
3
|
+
class Metasploit::Model::Search::Operation::Group::Intersection < Metasploit::Model::Search::Operation::Group::Base
|
4
|
+
end
|
@@ -0,0 +1,4 @@
|
|
1
|
+
# A union of one or more {Metasploit::Model::Search::Operation::Group::Base#children child operations} from an
|
2
|
+
# operator's `#operate_on`, should be visited the same as {Metasploit::Model::Search::Group::Base}.
|
3
|
+
class Metasploit::Model::Search::Operation::Group::Union < Metasploit::Model::Search::Operation::Group::Base
|
4
|
+
end
|
@@ -1,7 +1,7 @@
|
|
1
1
|
# Operator that emulates the behavior of 'author' operator that could search `Mdm::Module::Detail` by making
|
2
|
-
# {Metasploit::Model::Search::Operation::Union} between `authors.name`, `email_addresss.domain`, and
|
2
|
+
# {Metasploit::Model::Search::Operation::Group::Union} between `authors.name`, `email_addresss.domain`, and
|
3
3
|
# `email_addresses.local`.
|
4
|
-
class Metasploit::Model::Search::Operator::Deprecated::Author < Metasploit::Model::Search::Operator::Union
|
4
|
+
class Metasploit::Model::Search::Operator::Deprecated::Author < Metasploit::Model::Search::Operator::Group::Union
|
5
5
|
# Turns author:<formatted_value> into Array of authors.name:<formatted_value>,
|
6
6
|
# email_addresses.domain:<formatted_value>, and email_addresses.local:<formatted_value> operations. If there is an
|
7
7
|
# '@' in `formatted_value`, then the portion of `formatted_value` before the '@' is used for `email_addresses.local`
|
@@ -1,6 +1,6 @@
|
|
1
1
|
# Translates `<name>:<value>` to the union of `platforms.name:<value>` and `targets.name:<value>` in order to support
|
2
2
|
# the `os` and `platform` operators.
|
3
|
-
class Metasploit::Model::Search::Operator::Deprecated::Platform < Metasploit::Model::Search::Operator::Union
|
3
|
+
class Metasploit::Model::Search::Operator::Deprecated::Platform < Metasploit::Model::Search::Operator::Group::Union
|
4
4
|
#
|
5
5
|
# CONSTANTS
|
6
6
|
#
|
@@ -1,6 +1,6 @@
|
|
1
1
|
# Translates `ref:<value>` to union of `authorities.abbreviation:<value>`, `references.designation:<value>`, and
|
2
2
|
# `references.designation:<value>`.
|
3
|
-
class Metasploit::Model::Search::Operator::Deprecated::Ref < Metasploit::Model::Search::Operator::Union
|
3
|
+
class Metasploit::Model::Search::Operator::Deprecated::Ref < Metasploit::Model::Search::Operator::Group::Union
|
4
4
|
# Array of `authorities.abbreviation:<formatted_value>`, `references.designation:<formatted_value>`, and
|
5
5
|
# `references.url:<formatted_value>`. If `formatted_value` contains a '-' then the portion of `formatted_value`
|
6
6
|
# before '-' is treated is passed to `authorities.abbreviation` and the portion of `formatted_value` after '-' is
|
@@ -1,11 +1,11 @@
|
|
1
1
|
# Search the equivalent of the text fields from `Mdm::Module::Detail` and its associations, making a union of
|
2
2
|
# `description`, `name`, `actions.name`, `architectures.abbreviation`, `platform`, and `ref`.
|
3
|
-
class Metasploit::Model::Search::Operator::Deprecated::Text < Metasploit::Model::Search::Operator::Union
|
3
|
+
class Metasploit::Model::Search::Operator::Deprecated::Text < Metasploit::Model::Search::Operator::Group::Union
|
4
4
|
#
|
5
5
|
# CONSTANTS
|
6
6
|
#
|
7
7
|
|
8
|
-
# Names of operators that are unioned together for {Metasploit::Model::Search::Operator::Union#operate_on}.
|
8
|
+
# Names of operators that are unioned together for {Metasploit::Model::Search::Operator::Group::Union#operate_on}.
|
9
9
|
OPERATOR_NAMES = [
|
10
10
|
'description',
|
11
11
|
'name',
|
@@ -0,0 +1,77 @@
|
|
1
|
+
# Operator that {#operate_on produces} {Metasploit::Model::Search::Operation::Group::Base group operations}.
|
2
|
+
class Metasploit::Model::Search::Operator::Group::Base < Metasploit::Model::Search::Operator::Delegation
|
3
|
+
#
|
4
|
+
# Class Attributes
|
5
|
+
#
|
6
|
+
|
7
|
+
# @!method self.operation_class_name()
|
8
|
+
# The name of the {operation_class}.
|
9
|
+
#
|
10
|
+
# @return [String]
|
11
|
+
#
|
12
|
+
# @!method self.operation_class_name=(operation_class_name)
|
13
|
+
# Set the name of the {operation_class}.
|
14
|
+
#
|
15
|
+
# @param operation_class_name [String]
|
16
|
+
# @return [void]
|
17
|
+
class_attribute :operation_class_name
|
18
|
+
|
19
|
+
#
|
20
|
+
# Class Methods
|
21
|
+
#
|
22
|
+
|
23
|
+
# {Metasploit::Model::Search::Operation::Group::Base Group operation class} to wrap {#children} in and return from
|
24
|
+
# {#operate_on}.
|
25
|
+
#
|
26
|
+
# @return [Class<Metasploit::Model::Search::Operation::Group::Base>]
|
27
|
+
def self.operation_class
|
28
|
+
@operation_class ||= operation_class_name.constantize
|
29
|
+
end
|
30
|
+
|
31
|
+
# Sets the {operation_class_name} to the operation with same name as this operator, but with 'Operation' substituted
|
32
|
+
# for 'Operator'.
|
33
|
+
#
|
34
|
+
# @return (see operation_class_name=)
|
35
|
+
def self.operation_class_name!
|
36
|
+
self.operation_class_name = name.gsub('Operator', 'Operation')
|
37
|
+
end
|
38
|
+
|
39
|
+
operation_class_name!
|
40
|
+
|
41
|
+
#
|
42
|
+
# Instance Methods
|
43
|
+
#
|
44
|
+
|
45
|
+
# {Metasploit::Model::Search::Operation::Group::Base#children}.
|
46
|
+
#
|
47
|
+
# @param formatted_value [String] value parsed from formatted operation
|
48
|
+
# @return [Array<Metasploit::Model::Search::Operation::Base>]
|
49
|
+
def children(formatted_value)
|
50
|
+
raise NotImplementedError
|
51
|
+
end
|
52
|
+
|
53
|
+
# (see operation_class)
|
54
|
+
def operation_class
|
55
|
+
self.class.operation_class
|
56
|
+
end
|
57
|
+
|
58
|
+
# Group's children operating on `formatted_value`.
|
59
|
+
#
|
60
|
+
# @param formatted_value [String] value parsed from formatted operation.
|
61
|
+
# @return [Metasploit::Model::Search::Operation::Group::Base] {#operation_class} instance will not contain {#children}
|
62
|
+
# that are invalid.
|
63
|
+
def operate_on(formatted_value)
|
64
|
+
children = self.children(formatted_value)
|
65
|
+
|
66
|
+
# filter children for validity as valid values for one child won't necessarily be valid values for another child.
|
67
|
+
# this is specifically a problem with Metasploit::Model::Search::Operation::Set as no partial matching is allowed,
|
68
|
+
# but can also be a problem with string vs integer operations.
|
69
|
+
valid_children = children.select(&:valid?)
|
70
|
+
|
71
|
+
operation_class.new(
|
72
|
+
:children => valid_children,
|
73
|
+
:operator => self,
|
74
|
+
:value => formatted_value
|
75
|
+
)
|
76
|
+
end
|
77
|
+
end
|
@@ -0,0 +1,5 @@
|
|
1
|
+
# Operator that {Metasploit::Model::Search::Operator::Group::Base#operate_on produces}
|
2
|
+
# {Metasploit::Model::Search::Operation::Group::Intersection intersection operations}.
|
3
|
+
class Metasploit::Model::Search::Operator::Group::Intersection < Metasploit::Model::Search::Operator::Group::Base
|
4
|
+
operation_class_name!
|
5
|
+
end
|
@@ -0,0 +1,5 @@
|
|
1
|
+
# Operator that {Metasploit::Model::Search::Operator::Group::Base#operate_on produces}
|
2
|
+
# {Metasploit::Model::Search::Operation::Group::Union union operations}.
|
3
|
+
class Metasploit::Model::Search::Operator::Group::Union < Metasploit::Model::Search::Operator::Group::Base
|
4
|
+
operation_class_name!
|
5
|
+
end
|
data/config/locales/en.yml
CHANGED
@@ -5,9 +5,11 @@ 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 = 25
|
9
9
|
# The patch number, scoped to the {MINOR} version number.
|
10
10
|
PATCH = 1
|
11
|
+
# The prerelease version number, scoped to the {PATCH} version number.
|
12
|
+
PRERELEASE = 'metasploit-model-search-operator-and-operation-groups'
|
11
13
|
|
12
14
|
# The full version string, including the {MAJOR}, {MINOR}, {PATCH}, and optionally, the {PRERELEASE} in the
|
13
15
|
# {http://semver.org/spec/v2.0.0.html semantic versioning v2.0.0} format.
|
data/metasploit-model.gemspec
CHANGED
@@ -20,7 +20,8 @@ Gem::Specification.new do |spec|
|
|
20
20
|
spec.add_development_dependency 'rake'
|
21
21
|
|
22
22
|
# documentation
|
23
|
-
|
23
|
+
# 0.8.7.4 has a bug where attribute setters show up as undocumented
|
24
|
+
spec.add_development_dependency 'yard', '< 0.8.7.4'
|
24
25
|
|
25
26
|
# Dependency loading
|
26
27
|
spec.add_runtime_dependency 'activesupport'
|
@@ -1,7 +1,7 @@
|
|
1
1
|
require 'spec_helper'
|
2
2
|
|
3
|
-
describe Metasploit::Model::Search::Operation::
|
4
|
-
subject(:
|
3
|
+
describe Metasploit::Model::Search::Operation::Group::Base do
|
4
|
+
subject(:group) do
|
5
5
|
described_class.new
|
6
6
|
end
|
7
7
|
|
@@ -13,7 +13,7 @@ describe Metasploit::Model::Search::Operation::Union do
|
|
13
13
|
|
14
14
|
context '#children_valid' do
|
15
15
|
subject(:children_valid) do
|
16
|
-
|
16
|
+
group.send(:children_valid)
|
17
17
|
end
|
18
18
|
|
19
19
|
#
|
@@ -24,7 +24,7 @@ describe Metasploit::Model::Search::Operation::Union do
|
|
24
24
|
I18n.translate!(:'errors.messages.invalid')
|
25
25
|
end
|
26
26
|
|
27
|
-
let(:
|
27
|
+
let(:group) do
|
28
28
|
described_class.new(
|
29
29
|
children: children
|
30
30
|
)
|
@@ -53,9 +53,9 @@ describe Metasploit::Model::Search::Operation::Union do
|
|
53
53
|
end
|
54
54
|
|
55
55
|
it 'does not add error on :children' do
|
56
|
-
|
56
|
+
group.valid?
|
57
57
|
|
58
|
-
|
58
|
+
group.errors[:children].should_not include(error)
|
59
59
|
end
|
60
60
|
end
|
61
61
|
|
@@ -72,9 +72,9 @@ describe Metasploit::Model::Search::Operation::Union do
|
|
72
72
|
end
|
73
73
|
|
74
74
|
it 'should add error on :children' do
|
75
|
-
|
75
|
+
group.valid?
|
76
76
|
|
77
|
-
|
77
|
+
group.errors[:children].should include(error)
|
78
78
|
end
|
79
79
|
end
|
80
80
|
end
|
@@ -85,9 +85,9 @@ describe Metasploit::Model::Search::Operation::Union do
|
|
85
85
|
end
|
86
86
|
|
87
87
|
it 'does not add error on :children' do
|
88
|
-
|
88
|
+
group.valid?
|
89
89
|
|
90
|
-
|
90
|
+
group.errors[:children].should_not include(error)
|
91
91
|
end
|
92
92
|
end
|
93
93
|
end
|
@@ -96,7 +96,7 @@ describe Metasploit::Model::Search::Operation::Union do
|
|
96
96
|
|
97
97
|
context '#children' do
|
98
98
|
subject(:children) do
|
99
|
-
|
99
|
+
group.children
|
100
100
|
end
|
101
101
|
|
102
102
|
context 'default' do
|
@@ -110,7 +110,7 @@ describe Metasploit::Model::Search::Operation::Union do
|
|
110
110
|
]
|
111
111
|
end
|
112
112
|
|
113
|
-
let(:
|
113
|
+
let(:group) do
|
114
114
|
described_class.new(
|
115
115
|
children: expected_children
|
116
116
|
)
|
@@ -14,7 +14,7 @@ describe Metasploit::Model::Search::Operator::Deprecated::Author do
|
|
14
14
|
it { should be_a Metasploit::Model::Search::Operator::Delegation }
|
15
15
|
|
16
16
|
context '#children' do
|
17
|
-
include_context 'Metasploit::Model::Search::Operator::Union#children'
|
17
|
+
include_context 'Metasploit::Model::Search::Operator::Group::Union#children'
|
18
18
|
|
19
19
|
let(:author_class) do
|
20
20
|
Class.new
|
@@ -16,7 +16,7 @@ describe Metasploit::Model::Search::Operator::Deprecated::Platform do
|
|
16
16
|
['os', 'platform'].sample
|
17
17
|
end
|
18
18
|
|
19
|
-
it { should be_a Metasploit::Model::Search::Operator::Union }
|
19
|
+
it { should be_a Metasploit::Model::Search::Operator::Group::Union }
|
20
20
|
|
21
21
|
context 'CONSTANTS' do
|
22
22
|
context 'FORMATTED_OPERATORS' do
|
@@ -34,7 +34,7 @@ describe Metasploit::Model::Search::Operator::Deprecated::Platform do
|
|
34
34
|
end
|
35
35
|
|
36
36
|
context '#children' do
|
37
|
-
include_context 'Metasploit::Model::Search::Operator::Union#children'
|
37
|
+
include_context 'Metasploit::Model::Search::Operator::Group::Union#children'
|
38
38
|
|
39
39
|
let(:formatted_value) do
|
40
40
|
'platform_or_target'
|
@@ -12,7 +12,7 @@ describe Metasploit::Model::Search::Operator::Deprecated::Ref do
|
|
12
12
|
end
|
13
13
|
|
14
14
|
context '#children' do
|
15
|
-
include_context 'Metasploit::Model::Search::Operator::Union#children'
|
15
|
+
include_context 'Metasploit::Model::Search::Operator::Group::Union#children'
|
16
16
|
|
17
17
|
let(:abbreviation_operator) do
|
18
18
|
Metasploit::Model::Search::Operator::Attribute.new(
|
@@ -37,7 +37,7 @@ describe Metasploit::Model::Search::Operator::Deprecated::Text do
|
|
37
37
|
end
|
38
38
|
|
39
39
|
context '#children' do
|
40
|
-
include_context 'Metasploit::Model::Search::Operator::Union#children'
|
40
|
+
include_context 'Metasploit::Model::Search::Operator::Group::Union#children'
|
41
41
|
|
42
42
|
let(:action_name_operator) do
|
43
43
|
Metasploit::Model::Search::Operator::Attribute.new(
|
@@ -1,6 +1,6 @@
|
|
1
1
|
require 'spec_helper'
|
2
2
|
|
3
|
-
describe Metasploit::Model::Search::Operator::
|
3
|
+
describe Metasploit::Model::Search::Operator::Group::Base do
|
4
4
|
subject(:operator) do
|
5
5
|
described_class.new
|
6
6
|
end
|
@@ -53,7 +53,7 @@ describe Metasploit::Model::Search::Operator::Union do
|
|
53
53
|
operator.stub(:children => children)
|
54
54
|
end
|
55
55
|
|
56
|
-
it { should be_a Metasploit::Model::Search::Operation::
|
56
|
+
it { should be_a Metasploit::Model::Search::Operation::Group::Base }
|
57
57
|
|
58
58
|
context 'children' do
|
59
59
|
subject(:operation_children) do
|
@@ -0,0 +1,13 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe Metasploit::Model::Search::Operator::Group::Intersection do
|
4
|
+
it { should be_a Metasploit::Model::Search::Operator::Group::Base }
|
5
|
+
|
6
|
+
context 'operation_class_name' do
|
7
|
+
subject(:operation_class_name) {
|
8
|
+
described_class.operation_class_name
|
9
|
+
}
|
10
|
+
|
11
|
+
it { should == 'Metasploit::Model::Search::Operation::Group::Intersection' }
|
12
|
+
end
|
13
|
+
end
|
@@ -0,0 +1,13 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe Metasploit::Model::Search::Operator::Group::Union do
|
4
|
+
it { should be_a Metasploit::Model::Search::Operator::Group::Base }
|
5
|
+
|
6
|
+
context 'operation_class_name' do
|
7
|
+
subject(:operation_class_name) {
|
8
|
+
described_class.operation_class_name
|
9
|
+
}
|
10
|
+
|
11
|
+
it { should == 'Metasploit::Model::Search::Operation::Group::Union' }
|
12
|
+
end
|
13
|
+
end
|
@@ -60,7 +60,7 @@ describe Metasploit::Model::Version do
|
|
60
60
|
expect(prerelease).to eq(match[:prerelease])
|
61
61
|
end
|
62
62
|
else
|
63
|
-
tag_regex = /\Av(?<major>\d+).(?<minor>\d+).(?<patch>\d+)(
|
63
|
+
tag_regex = /\Av(?<major>\d+).(?<minor>\d+).(?<patch>\d+)(\.pre\.(?<prerelease>.*))?\z/
|
64
64
|
# travis-ci sets TRAVIS_BRANCH to the tag name for tag builds
|
65
65
|
match = branch.match(tag_regex)
|
66
66
|
|
@@ -68,8 +68,8 @@ describe Metasploit::Model::Version do
|
|
68
68
|
tag_prerelease = match[:prerelease]
|
69
69
|
|
70
70
|
if tag_prerelease
|
71
|
-
it 'matches the tag prerelease' do
|
72
|
-
expect(prerelease).to eq(tag_prerelease)
|
71
|
+
it 'matches the tag prerelease converted from a gem version to a VERSION' do
|
72
|
+
expect(prerelease).to eq(tag_prerelease.gsub('.pre.', '-'))
|
73
73
|
end
|
74
74
|
else
|
75
75
|
it 'does not have a PRERELEASE' do
|
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.25.1.pre.metasploit.pre.model.pre.search.pre.operator.pre.and.pre.operation.pre.groups
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Luke Imhoff
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-06-
|
11
|
+
date: 2014-06-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -42,16 +42,16 @@ dependencies:
|
|
42
42
|
name: yard
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
|
-
- -
|
45
|
+
- - <
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version:
|
47
|
+
version: 0.8.7.4
|
48
48
|
type: :development
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
|
-
- -
|
52
|
+
- - <
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version:
|
54
|
+
version: 0.8.7.4
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: activesupport
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
@@ -108,13 +108,15 @@ files:
|
|
108
108
|
- app/models/metasploit/model/search/operation/base.rb
|
109
109
|
- app/models/metasploit/model/search/operation/boolean.rb
|
110
110
|
- app/models/metasploit/model/search/operation/date.rb
|
111
|
+
- app/models/metasploit/model/search/operation/group/base.rb
|
112
|
+
- app/models/metasploit/model/search/operation/group/intersection.rb
|
113
|
+
- app/models/metasploit/model/search/operation/group/union.rb
|
111
114
|
- app/models/metasploit/model/search/operation/integer.rb
|
112
115
|
- app/models/metasploit/model/search/operation/null.rb
|
113
116
|
- app/models/metasploit/model/search/operation/set.rb
|
114
117
|
- app/models/metasploit/model/search/operation/set/integer.rb
|
115
118
|
- app/models/metasploit/model/search/operation/set/string.rb
|
116
119
|
- app/models/metasploit/model/search/operation/string.rb
|
117
|
-
- app/models/metasploit/model/search/operation/union.rb
|
118
120
|
- app/models/metasploit/model/search/operator/association.rb
|
119
121
|
- app/models/metasploit/model/search/operator/attribute.rb
|
120
122
|
- app/models/metasploit/model/search/operator/base.rb
|
@@ -125,9 +127,11 @@ files:
|
|
125
127
|
- app/models/metasploit/model/search/operator/deprecated/platform.rb
|
126
128
|
- app/models/metasploit/model/search/operator/deprecated/ref.rb
|
127
129
|
- app/models/metasploit/model/search/operator/deprecated/text.rb
|
130
|
+
- app/models/metasploit/model/search/operator/group/base.rb
|
131
|
+
- app/models/metasploit/model/search/operator/group/intersection.rb
|
132
|
+
- app/models/metasploit/model/search/operator/group/union.rb
|
128
133
|
- app/models/metasploit/model/search/operator/null.rb
|
129
134
|
- app/models/metasploit/model/search/operator/single.rb
|
130
|
-
- app/models/metasploit/model/search/operator/union.rb
|
131
135
|
- app/models/metasploit/model/search/query.rb
|
132
136
|
- app/models/metasploit/model/spec/template.rb
|
133
137
|
- app/models/metasploit/model/visitation/visitor.rb
|
@@ -221,13 +225,15 @@ files:
|
|
221
225
|
- spec/app/models/metasploit/model/search/operation/base_spec.rb
|
222
226
|
- spec/app/models/metasploit/model/search/operation/boolean_spec.rb
|
223
227
|
- spec/app/models/metasploit/model/search/operation/date_spec.rb
|
228
|
+
- spec/app/models/metasploit/model/search/operation/group/base_spec.rb
|
229
|
+
- spec/app/models/metasploit/model/search/operation/group/intersection_spec.rb
|
230
|
+
- spec/app/models/metasploit/model/search/operation/group/union_spec.rb
|
224
231
|
- spec/app/models/metasploit/model/search/operation/integer_spec.rb
|
225
232
|
- spec/app/models/metasploit/model/search/operation/null_spec.rb
|
226
233
|
- spec/app/models/metasploit/model/search/operation/set/integer_spec.rb
|
227
234
|
- spec/app/models/metasploit/model/search/operation/set/string_spec.rb
|
228
235
|
- spec/app/models/metasploit/model/search/operation/set_spec.rb
|
229
236
|
- spec/app/models/metasploit/model/search/operation/string_spec.rb
|
230
|
-
- spec/app/models/metasploit/model/search/operation/union_spec.rb
|
231
237
|
- spec/app/models/metasploit/model/search/operator/association_spec.rb
|
232
238
|
- spec/app/models/metasploit/model/search/operator/attribute_spec.rb
|
233
239
|
- spec/app/models/metasploit/model/search/operator/base_spec.rb
|
@@ -238,9 +244,11 @@ files:
|
|
238
244
|
- spec/app/models/metasploit/model/search/operator/deprecated/platform_spec.rb
|
239
245
|
- spec/app/models/metasploit/model/search/operator/deprecated/ref_spec.rb
|
240
246
|
- spec/app/models/metasploit/model/search/operator/deprecated/text_spec.rb
|
247
|
+
- spec/app/models/metasploit/model/search/operator/group/base_spec.rb
|
248
|
+
- spec/app/models/metasploit/model/search/operator/group/intersection_spec.rb
|
249
|
+
- spec/app/models/metasploit/model/search/operator/group/union_spec.rb
|
241
250
|
- spec/app/models/metasploit/model/search/operator/null_spec.rb
|
242
251
|
- spec/app/models/metasploit/model/search/operator/single_spec.rb
|
243
|
-
- spec/app/models/metasploit/model/search/operator/union_spec.rb
|
244
252
|
- spec/app/models/metasploit/model/search/query_spec.rb
|
245
253
|
- spec/app/models/metasploit/model/spec/template_spec.rb
|
246
254
|
- spec/app/models/metasploit/model/visitation/visitor_spec.rb
|
@@ -480,9 +488,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
480
488
|
version: '0'
|
481
489
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
482
490
|
requirements:
|
483
|
-
- - ! '
|
491
|
+
- - ! '>'
|
484
492
|
- !ruby/object:Gem::Version
|
485
|
-
version:
|
493
|
+
version: 1.3.1
|
486
494
|
requirements: []
|
487
495
|
rubyforge_project:
|
488
496
|
rubygems_version: 2.2.2
|
@@ -500,13 +508,15 @@ test_files:
|
|
500
508
|
- spec/app/models/metasploit/model/search/operation/base_spec.rb
|
501
509
|
- spec/app/models/metasploit/model/search/operation/boolean_spec.rb
|
502
510
|
- spec/app/models/metasploit/model/search/operation/date_spec.rb
|
511
|
+
- spec/app/models/metasploit/model/search/operation/group/base_spec.rb
|
512
|
+
- spec/app/models/metasploit/model/search/operation/group/intersection_spec.rb
|
513
|
+
- spec/app/models/metasploit/model/search/operation/group/union_spec.rb
|
503
514
|
- spec/app/models/metasploit/model/search/operation/integer_spec.rb
|
504
515
|
- spec/app/models/metasploit/model/search/operation/null_spec.rb
|
505
516
|
- spec/app/models/metasploit/model/search/operation/set/integer_spec.rb
|
506
517
|
- spec/app/models/metasploit/model/search/operation/set/string_spec.rb
|
507
518
|
- spec/app/models/metasploit/model/search/operation/set_spec.rb
|
508
519
|
- spec/app/models/metasploit/model/search/operation/string_spec.rb
|
509
|
-
- spec/app/models/metasploit/model/search/operation/union_spec.rb
|
510
520
|
- spec/app/models/metasploit/model/search/operator/association_spec.rb
|
511
521
|
- spec/app/models/metasploit/model/search/operator/attribute_spec.rb
|
512
522
|
- spec/app/models/metasploit/model/search/operator/base_spec.rb
|
@@ -517,9 +527,11 @@ test_files:
|
|
517
527
|
- spec/app/models/metasploit/model/search/operator/deprecated/platform_spec.rb
|
518
528
|
- spec/app/models/metasploit/model/search/operator/deprecated/ref_spec.rb
|
519
529
|
- spec/app/models/metasploit/model/search/operator/deprecated/text_spec.rb
|
530
|
+
- spec/app/models/metasploit/model/search/operator/group/base_spec.rb
|
531
|
+
- spec/app/models/metasploit/model/search/operator/group/intersection_spec.rb
|
532
|
+
- spec/app/models/metasploit/model/search/operator/group/union_spec.rb
|
520
533
|
- spec/app/models/metasploit/model/search/operator/null_spec.rb
|
521
534
|
- spec/app/models/metasploit/model/search/operator/single_spec.rb
|
522
|
-
- spec/app/models/metasploit/model/search/operator/union_spec.rb
|
523
535
|
- spec/app/models/metasploit/model/search/query_spec.rb
|
524
536
|
- spec/app/models/metasploit/model/spec/template_spec.rb
|
525
537
|
- spec/app/models/metasploit/model/visitation/visitor_spec.rb
|
@@ -1,33 +0,0 @@
|
|
1
|
-
# Operator that {#operate_on produces} {Metasploit::Model::Search::Operation::Union union operations}.
|
2
|
-
class Metasploit::Model::Search::Operator::Union < Metasploit::Model::Search::Operator::Delegation
|
3
|
-
#
|
4
|
-
# Methods
|
5
|
-
#
|
6
|
-
|
7
|
-
# {Metasploit::Model::Search::Operation::Union#children}.
|
8
|
-
#
|
9
|
-
# @param formatted_value [String] value parsed from formatted operation
|
10
|
-
# @return [Array<Metasploit::Model::Search::Operation::Base>]
|
11
|
-
def children(formatted_value)
|
12
|
-
raise NotImplementedError
|
13
|
-
end
|
14
|
-
|
15
|
-
# Unions children operating on `formatted_value`.
|
16
|
-
#
|
17
|
-
# @param formatted_value [String] value parsed from formatted operation.
|
18
|
-
# @return [Metasploit::Model::Search::Operation::Union] Union will not contain {#children} that are invalid.
|
19
|
-
def operate_on(formatted_value)
|
20
|
-
children = self.children(formatted_value)
|
21
|
-
|
22
|
-
# filter children for validity as valid values for one child won't necessarily be valid values for another child.
|
23
|
-
# this is specifically a problem with Metasploit::Model::Search::Operation::Set as no partial matching is allowed,
|
24
|
-
# but can also be a problem with string vs integer operations.
|
25
|
-
valid_children = children.select(&:valid?)
|
26
|
-
|
27
|
-
Metasploit::Model::Search::Operation::Union.new(
|
28
|
-
:children => valid_children,
|
29
|
-
:operator => self,
|
30
|
-
:value => formatted_value
|
31
|
-
)
|
32
|
-
end
|
33
|
-
end
|