metasploit-concern 0.3.0 → 0.3.1.pre.autoload.pre.compatibility
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -7
- data/CONTRIBUTING.md +2 -2
- data/app/models/metasploit/concern/loader.rb +24 -9
- data/lib/metasploit/concern/version.rb +4 -2
- metadata +49 -43
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
|
-
---
|
2
|
-
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
5
|
-
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 017a7fc1d13a3b124f775b749720d67838082476
|
4
|
+
data.tar.gz: 75025bd466c12c546998f4e1138ed22202c630d5
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: ad9abfc720058eaa4be0d285ea012c39372c5858a0cc190ada8d640011f96c0e78141b77954c0ba78ba841ebab30434e8ca9acd4e2542ad37092264efde1301c
|
7
|
+
data.tar.gz: 27d08e1d509e2677818f88f4b3121d508ecbea809b664b4e8e98bbc2e4e1ce04a712e7deaee11cdaf76d02532096ba1d5e7cc171f52e84904df431cd7cc2c6b2
|
data/CONTRIBUTING.md
CHANGED
@@ -139,7 +139,7 @@ If your changes are incompatible with the previous branch's API, then increment
|
|
139
139
|
- [ ] Following the rules for [semantic versioning 2.0](http://semver.org/spec/v2.0.0.html), update [`MINOR`](lib/metasploit/concern/version.rb) and [`PATCH`](lib/metasploit/concern/version.rb) and commit the changes.
|
140
140
|
|
141
141
|
## MRI Ruby
|
142
|
-
- [ ] `rvm use ruby-1
|
142
|
+
- [ ] `rvm use ruby-2.1@metasploit-concern`
|
143
143
|
- [ ] `rm Gemfile.lock`
|
144
144
|
- [ ] `bundle install`
|
145
145
|
- [ ] `rake release`
|
@@ -154,4 +154,4 @@ When releasing new versions, the following projects may need to be updated:
|
|
154
154
|
* [metasploit-framework](https://github.com/rapid7/metasploit-framework)
|
155
155
|
* [metasploit-pro-ui](https://github.com/rapid7/pro/tree/master/ui)
|
156
156
|
* [metasploit-pro-engine](https://github.com/rapid7/pro/tree/master/engine)
|
157
|
-
* [firewall_egress](https://github.com/rapid7/pro/tree/master/metamodules/firewall_egress)
|
157
|
+
* [firewall_egress](https://github.com/rapid7/pro/tree/master/metamodules/firewall_egress)
|
@@ -25,14 +25,19 @@ class Metasploit::Concern::Loader
|
|
25
25
|
|
26
26
|
# Yields each constant under `parent_pathname`.
|
27
27
|
#
|
28
|
+
# @param mechanism [:constantize, :require] `:require` if child pathname should be required so that the constant
|
29
|
+
# cannot be unloaded by `ActiveSupport::Dependencies.clear`.
|
28
30
|
# @param parent_pathname [Pathname]
|
29
31
|
# @yield [constant]
|
30
32
|
# @yieldparam constant [Module] constant declared under `parent_pathname`.
|
31
33
|
# @yieldreturn [void]
|
32
34
|
# @return [void]
|
33
|
-
def each_pathname_constant(parent_pathname)
|
35
|
+
def each_pathname_constant(mechanism:, parent_pathname:)
|
34
36
|
parent_pathname.each_child do |child_pathname|
|
35
|
-
constant = constantize_pathname(
|
37
|
+
constant = constantize_pathname(
|
38
|
+
mechanism: mechanism,
|
39
|
+
pathname: child_pathname
|
40
|
+
)
|
36
41
|
|
37
42
|
if constant
|
38
43
|
yield constant
|
@@ -82,12 +87,14 @@ class Metasploit::Concern::Loader
|
|
82
87
|
loader = self
|
83
88
|
|
84
89
|
ActiveSupport.on_load(on_load_name) do
|
85
|
-
|
86
|
-
|
90
|
+
if ActiveSupport::Dependencies.autoloaded? self
|
91
|
+
mechanism = :constantize
|
92
|
+
else
|
93
|
+
mechanism = :require
|
87
94
|
end
|
88
95
|
|
89
|
-
|
90
|
-
|
96
|
+
loader.each_pathname_constant(mechanism: mechanism, parent_pathname: module_pathname) do |concern|
|
97
|
+
include concern
|
91
98
|
end
|
92
99
|
end
|
93
100
|
end
|
@@ -97,15 +104,23 @@ class Metasploit::Concern::Loader
|
|
97
104
|
|
98
105
|
# Converts `descendant_pathname`, which should be under {#root}, into a constant.
|
99
106
|
#
|
100
|
-
# @param
|
107
|
+
# @param mechanism [:constantize, :require] `:require` if pathname should be required so that the constant cannot be
|
108
|
+
# unloaded by `ActiveSupport::Dependencies.clear`.
|
109
|
+
# @param pathname [Pathname] a Pathname under {#root}.
|
101
110
|
# @return [Object] if {#pathname_to_constant_name} returns a constant name
|
102
111
|
# @return [nil] otherwise
|
103
|
-
def constantize_pathname(
|
104
|
-
constant_name = pathname_to_constant_name(
|
112
|
+
def constantize_pathname(mechanism:, pathname:)
|
113
|
+
constant_name = pathname_to_constant_name(pathname)
|
105
114
|
|
106
115
|
constant = nil
|
107
116
|
|
108
117
|
if constant_name
|
118
|
+
# require before calling constantize so that the constant isn't recorded as unloadable.
|
119
|
+
if mechanism == :require
|
120
|
+
require pathname
|
121
|
+
end
|
122
|
+
|
123
|
+
# constantize either way as the the constant_name still needs to be converted to Module
|
109
124
|
constant = constant_name.constantize
|
110
125
|
end
|
111
126
|
|
@@ -6,8 +6,10 @@ module Metasploit
|
|
6
6
|
MAJOR = 0
|
7
7
|
# The minor version number, scoped to the {MAJOR} version number.
|
8
8
|
MINOR = 3
|
9
|
-
# The patch number, scoped to the {MINOR} version
|
10
|
-
PATCH =
|
9
|
+
# The patch number, scoped to the {MAJOR} and {MINOR} version numbers.
|
10
|
+
PATCH = 1
|
11
|
+
# The prerelease version, scoped to the {MAJOR}, {MINOR}, and {PATCH} version numbers.
|
12
|
+
PRERELEASE = 'autoload-compatibility'
|
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.
|
metadata
CHANGED
@@ -1,49 +1,58 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: metasploit-concern
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.3.1.pre.autoload.pre.compatibility
|
5
5
|
platform: ruby
|
6
|
-
authors:
|
6
|
+
authors:
|
7
7
|
- Luke Imhoff
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
- !ruby/object:Gem::Dependency
|
11
|
+
date: 2015-04-08 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
15
14
|
name: activesupport
|
16
|
-
requirement:
|
17
|
-
requirements:
|
18
|
-
- - ~>
|
19
|
-
- !ruby/object:Gem::Version
|
20
|
-
version:
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '3.0'
|
21
20
|
- - ">="
|
22
|
-
- !ruby/object:Gem::Version
|
21
|
+
- !ruby/object:Gem::Version
|
23
22
|
version: 3.0.0
|
24
23
|
type: :runtime
|
25
24
|
prerelease: false
|
26
|
-
version_requirements:
|
27
|
-
|
25
|
+
version_requirements: !ruby/object:Gem::Requirement
|
26
|
+
requirements:
|
27
|
+
- - "~>"
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
version: '3.0'
|
30
|
+
- - ">="
|
31
|
+
- !ruby/object:Gem::Version
|
32
|
+
version: 3.0.0
|
33
|
+
- !ruby/object:Gem::Dependency
|
28
34
|
name: railties
|
29
|
-
requirement:
|
30
|
-
requirements:
|
31
|
-
- - <
|
32
|
-
- !ruby/object:Gem::Version
|
35
|
+
requirement: !ruby/object:Gem::Requirement
|
36
|
+
requirements:
|
37
|
+
- - "<"
|
38
|
+
- !ruby/object:Gem::Version
|
33
39
|
version: 4.0.0
|
34
40
|
type: :runtime
|
35
41
|
prerelease: false
|
36
|
-
version_requirements:
|
37
|
-
|
38
|
-
|
42
|
+
version_requirements: !ruby/object:Gem::Requirement
|
43
|
+
requirements:
|
44
|
+
- - "<"
|
45
|
+
- !ruby/object:Gem::Version
|
46
|
+
version: 4.0.0
|
47
|
+
description: Automatically includes Modules from app/concerns/<module_with_concerns>/<concern>.rb
|
48
|
+
into <module_with_concerns> to ease monkey-patching associations and validations
|
49
|
+
on ActiveRecord::Base descendents from other gems when layering schemas.
|
50
|
+
email:
|
39
51
|
- luke_imhoff@rapid7.com
|
40
52
|
executables: []
|
41
|
-
|
42
53
|
extensions: []
|
43
|
-
|
44
54
|
extra_rdoc_files: []
|
45
|
-
|
46
|
-
files:
|
55
|
+
files:
|
47
56
|
- CONTRIBUTING.md
|
48
57
|
- LICENSE
|
49
58
|
- README.md
|
@@ -55,31 +64,28 @@ files:
|
|
55
64
|
- lib/tasks/yard.rake
|
56
65
|
- spec/support/shared/examples/metasploit/concern/run.rb
|
57
66
|
homepage: https://github.com/rapid7/metasploit-concern
|
58
|
-
licenses:
|
67
|
+
licenses:
|
59
68
|
- BSD-3-clause
|
60
69
|
metadata: {}
|
61
|
-
|
62
70
|
post_install_message:
|
63
71
|
rdoc_options: []
|
64
|
-
|
65
|
-
require_paths:
|
72
|
+
require_paths:
|
66
73
|
- lib
|
67
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
68
|
-
requirements:
|
69
|
-
-
|
70
|
-
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
74
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
75
|
+
requirements:
|
76
|
+
- - ">="
|
77
|
+
- !ruby/object:Gem::Version
|
78
|
+
version: '2.1'
|
79
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
80
|
+
requirements:
|
81
|
+
- - ">"
|
82
|
+
- !ruby/object:Gem::Version
|
83
|
+
version: 1.3.1
|
76
84
|
requirements: []
|
77
|
-
|
78
85
|
rubyforge_project:
|
79
|
-
rubygems_version: 2.4.
|
86
|
+
rubygems_version: 2.4.3
|
80
87
|
signing_key:
|
81
88
|
specification_version: 4
|
82
89
|
summary: Automatically include Modules from app/concerns
|
83
90
|
test_files: []
|
84
|
-
|
85
91
|
has_rdoc:
|