ronin-core 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +13 -150
- data/ChangeLog.md +9 -1
- data/Gemfile +3 -1
- data/Rakefile +1 -1
- data/examples/ruby_shell.rb +5 -0
- data/examples/test_shell.rb +41 -0
- data/lib/ronin/core/class_registry.rb +15 -10
- data/lib/ronin/core/cli/command.rb +11 -11
- data/lib/ronin/core/cli/command_shell/command.rb +8 -5
- data/lib/ronin/core/cli/command_shell.rb +9 -9
- data/lib/ronin/core/cli/generator/options/author.rb +4 -5
- data/lib/ronin/core/cli/generator/options/description.rb +2 -2
- data/lib/ronin/core/cli/generator/options/reference.rb +2 -2
- data/lib/ronin/core/cli/generator/options/summary.rb +2 -2
- data/lib/ronin/core/cli/generator.rb +10 -7
- data/lib/ronin/core/cli/logging.rb +5 -2
- data/lib/ronin/core/cli/options/param.rb +4 -4
- data/lib/ronin/core/cli/options/values/arches.rb +2 -2
- data/lib/ronin/core/cli/options/values/oses.rb +2 -2
- data/lib/ronin/core/cli/printing/arch.rb +2 -2
- data/lib/ronin/core/cli/printing/metadata.rb +2 -2
- data/lib/ronin/core/cli/printing/os.rb +5 -2
- data/lib/ronin/core/cli/printing/params.rb +6 -6
- data/lib/ronin/core/cli/ruby_shell.rb +3 -2
- data/lib/ronin/core/cli/shell.rb +14 -6
- data/lib/ronin/core/git.rb +2 -2
- data/lib/ronin/core/home.rb +2 -2
- data/lib/ronin/core/metadata/authors/author.rb +5 -2
- data/lib/ronin/core/metadata/authors.rb +8 -5
- data/lib/ronin/core/metadata/description.rb +8 -5
- data/lib/ronin/core/metadata/id.rb +7 -4
- data/lib/ronin/core/metadata/references.rb +13 -6
- data/lib/ronin/core/metadata/summary.rb +10 -7
- data/lib/ronin/core/metadata/version.rb +8 -5
- data/lib/ronin/core/params/exceptions.rb +2 -2
- data/lib/ronin/core/params/mixin.rb +15 -15
- data/lib/ronin/core/params/param.rb +2 -2
- data/lib/ronin/core/params/types/boolean.rb +2 -2
- data/lib/ronin/core/params/types/enum.rb +7 -3
- data/lib/ronin/core/params/types/float.rb +2 -2
- data/lib/ronin/core/params/types/integer.rb +2 -2
- data/lib/ronin/core/params/types/numeric.rb +3 -3
- data/lib/ronin/core/params/types/regexp.rb +2 -2
- data/lib/ronin/core/params/types/string.rb +2 -2
- data/lib/ronin/core/params/types/type.rb +2 -2
- data/lib/ronin/core/params/types/uri.rb +2 -2
- data/lib/ronin/core/params/types.rb +6 -3
- data/lib/ronin/core/params.rb +2 -2
- data/lib/ronin/core/version.rb +3 -3
- data/ronin-core.gemspec +5 -3
- metadata +3 -2
@@ -6,12 +6,12 @@
|
|
6
6
|
# it under the terms of the GNU Lesser General Public License as published
|
7
7
|
# by the Free Software Foundation, either version 3 of the License, or
|
8
8
|
# (at your option) any later version.
|
9
|
-
#
|
9
|
+
#
|
10
10
|
# ronin-core is distributed in the hope that it will be useful,
|
11
11
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
12
12
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
13
13
|
# GNU Lesser General Public License for more details.
|
14
|
-
#
|
14
|
+
#
|
15
15
|
# You should have received a copy of the GNU Lesser General Public License
|
16
16
|
# along with ronin-core. If not, see <https://www.gnu.org/licenses/>.
|
17
17
|
#
|
@@ -21,6 +21,9 @@ require 'command_kit/colors'
|
|
21
21
|
module Ronin
|
22
22
|
module Core
|
23
23
|
module CLI
|
24
|
+
#
|
25
|
+
# Helper methods for printing log messages.
|
26
|
+
#
|
24
27
|
module Logging
|
25
28
|
include CommandKit::Colors
|
26
29
|
|
@@ -8,12 +8,12 @@
|
|
8
8
|
# it under the terms of the GNU Lesser General Public License as published
|
9
9
|
# by the Free Software Foundation, either version 3 of the License, or
|
10
10
|
# (at your option) any later version.
|
11
|
-
#
|
11
|
+
#
|
12
12
|
# ronin-core is distributed in the hope that it will be useful,
|
13
13
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
14
14
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
15
15
|
# GNU Lesser General Public License for more details.
|
16
|
-
#
|
16
|
+
#
|
17
17
|
# You should have received a copy of the GNU Lesser General Public License
|
18
18
|
# along with ronin-core. If not, see <https://www.gnu.org/licenses/>.
|
19
19
|
#
|
@@ -35,8 +35,8 @@ module Ronin
|
|
35
35
|
def self.included(command)
|
36
36
|
command.option :param, short: '-p',
|
37
37
|
value: {
|
38
|
-
type:
|
39
|
-
usage: 'NAME=VALUE'
|
38
|
+
type: /\A[^=]+=.+\z/,
|
39
|
+
usage: 'NAME=VALUE'
|
40
40
|
},
|
41
41
|
desc: 'Sets a param' do |str|
|
42
42
|
name, value = str.split('=',2)
|
@@ -6,12 +6,12 @@
|
|
6
6
|
# it under the terms of the GNU Lesser General Public License as published
|
7
7
|
# by the Free Software Foundation, either version 3 of the License, or
|
8
8
|
# (at your option) any later version.
|
9
|
-
#
|
9
|
+
#
|
10
10
|
# ronin-core is distributed in the hope that it will be useful,
|
11
11
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
12
12
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
13
13
|
# GNU Lesser General Public License for more details.
|
14
|
-
#
|
14
|
+
#
|
15
15
|
# You should have received a copy of the GNU Lesser General Public License
|
16
16
|
# along with ronin-core. If not, see <https://www.gnu.org/licenses/>.
|
17
17
|
#
|
@@ -6,12 +6,12 @@
|
|
6
6
|
# it under the terms of the GNU Lesser General Public License as published
|
7
7
|
# by the Free Software Foundation, either version 3 of the License, or
|
8
8
|
# (at your option) any later version.
|
9
|
-
#
|
9
|
+
#
|
10
10
|
# ronin-core is distributed in the hope that it will be useful,
|
11
11
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
12
12
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
13
13
|
# GNU Lesser General Public License for more details.
|
14
|
-
#
|
14
|
+
#
|
15
15
|
# You should have received a copy of the GNU Lesser General Public License
|
16
16
|
# along with ronin-core. If not, see <https://www.gnu.org/licenses/>.
|
17
17
|
#
|
@@ -6,12 +6,12 @@
|
|
6
6
|
# it under the terms of the GNU Lesser General Public License as published
|
7
7
|
# by the Free Software Foundation, either version 3 of the License, or
|
8
8
|
# (at your option) any later version.
|
9
|
-
#
|
9
|
+
#
|
10
10
|
# ronin-core is distributed in the hope that it will be useful,
|
11
11
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
12
12
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
13
13
|
# GNU Lesser General Public License for more details.
|
14
|
-
#
|
14
|
+
#
|
15
15
|
# You should have received a copy of the GNU Lesser General Public License
|
16
16
|
# along with ronin-core. If not, see <https://www.gnu.org/licenses/>.
|
17
17
|
#
|
@@ -6,12 +6,12 @@
|
|
6
6
|
# it under the terms of the GNU Lesser General Public License as published
|
7
7
|
# by the Free Software Foundation, either version 3 of the License, or
|
8
8
|
# (at your option) any later version.
|
9
|
-
#
|
9
|
+
#
|
10
10
|
# ronin-core is distributed in the hope that it will be useful,
|
11
11
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
12
12
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
13
13
|
# GNU Lesser General Public License for more details.
|
14
|
-
#
|
14
|
+
#
|
15
15
|
# You should have received a copy of the GNU Lesser General Public License
|
16
16
|
# along with ronin-core. If not, see <https://www.gnu.org/licenses/>.
|
17
17
|
#
|
@@ -6,12 +6,12 @@
|
|
6
6
|
# it under the terms of the GNU Lesser General Public License as published
|
7
7
|
# by the Free Software Foundation, either version 3 of the License, or
|
8
8
|
# (at your option) any later version.
|
9
|
-
#
|
9
|
+
#
|
10
10
|
# ronin-core is distributed in the hope that it will be useful,
|
11
11
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
12
12
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
13
13
|
# GNU Lesser General Public License for more details.
|
14
|
-
#
|
14
|
+
#
|
15
15
|
# You should have received a copy of the GNU Lesser General Public License
|
16
16
|
# along with ronin-core. If not, see <https://www.gnu.org/licenses/>.
|
17
17
|
#
|
@@ -20,6 +20,9 @@ module Ronin
|
|
20
20
|
module Core
|
21
21
|
module CLI
|
22
22
|
module Printing
|
23
|
+
#
|
24
|
+
# Helper methods for printing Operating System (OS) names.
|
25
|
+
#
|
23
26
|
module OS
|
24
27
|
# Mapping of Operating System (OS) IDs to printable names.
|
25
28
|
OS_NAMES = {
|
@@ -6,12 +6,12 @@
|
|
6
6
|
# it under the terms of the GNU Lesser General Public License as published
|
7
7
|
# by the Free Software Foundation, either version 3 of the License, or
|
8
8
|
# (at your option) any later version.
|
9
|
-
#
|
9
|
+
#
|
10
10
|
# ronin-core is distributed in the hope that it will be useful,
|
11
11
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
12
12
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
13
13
|
# GNU Lesser General Public License for more details.
|
14
|
-
#
|
14
|
+
#
|
15
15
|
# You should have received a copy of the GNU Lesser General Public License
|
16
16
|
# along with ronin-core. If not, see <https://www.gnu.org/licenses/>.
|
17
17
|
#
|
@@ -45,10 +45,10 @@ module Ronin
|
|
45
45
|
rows = []
|
46
46
|
|
47
47
|
klass.params.each do |name,param|
|
48
|
-
param_type
|
49
|
-
required
|
50
|
-
|
51
|
-
|
48
|
+
param_type = param.type.class.name.split('::').last
|
49
|
+
required = if param.required? then 'Yes'
|
50
|
+
else 'No'
|
51
|
+
end
|
52
52
|
default = param.default_value
|
53
53
|
description = param.desc
|
54
54
|
|
@@ -6,12 +6,12 @@
|
|
6
6
|
# it under the terms of the GNU Lesser General Public License as published
|
7
7
|
# by the Free Software Foundation, either version 3 of the License, or
|
8
8
|
# (at your option) any later version.
|
9
|
-
#
|
9
|
+
#
|
10
10
|
# ronin-core is distributed in the hope that it will be useful,
|
11
11
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
12
12
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
13
13
|
# GNU Lesser General Public License for more details.
|
14
|
-
#
|
14
|
+
#
|
15
15
|
# You should have received a copy of the GNU Lesser General Public License
|
16
16
|
# along with ronin-core. If not, see <https://www.gnu.org/licenses/>.
|
17
17
|
#
|
@@ -121,6 +121,7 @@ module Ronin
|
|
121
121
|
PROMPT_C: "#{prompt_prefix}* ",
|
122
122
|
RETURN: "=> %s#{$/}"
|
123
123
|
}
|
124
|
+
|
124
125
|
IRB.conf[:PROMPT_MODE] = :RONIN
|
125
126
|
end
|
126
127
|
end
|
data/lib/ronin/core/cli/shell.rb
CHANGED
@@ -6,12 +6,12 @@
|
|
6
6
|
# it under the terms of the GNU Lesser General Public License as published
|
7
7
|
# by the Free Software Foundation, either version 3 of the License, or
|
8
8
|
# (at your option) any later version.
|
9
|
-
#
|
9
|
+
#
|
10
10
|
# ronin-core is distributed in the hope that it will be useful,
|
11
11
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
12
12
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
13
13
|
# GNU Lesser General Public License for more details.
|
14
|
-
#
|
14
|
+
#
|
15
15
|
# You should have received a copy of the GNU Lesser General Public License
|
16
16
|
# along with ronin-core. If not, see <https://www.gnu.org/licenses/>.
|
17
17
|
#
|
@@ -23,6 +23,9 @@ require 'reline'
|
|
23
23
|
module Ronin
|
24
24
|
module Core
|
25
25
|
module CLI
|
26
|
+
#
|
27
|
+
# Base class for all interactive CLI shells.
|
28
|
+
#
|
26
29
|
class Shell
|
27
30
|
|
28
31
|
include CommandKit::Printing
|
@@ -61,7 +64,7 @@ module Ronin
|
|
61
64
|
@prompt_sigil = new_sigil
|
62
65
|
else
|
63
66
|
@prompt_sigil ||= if superclass <= Shell
|
64
|
-
|
67
|
+
superclass.prompt_sigil
|
65
68
|
end
|
66
69
|
end
|
67
70
|
end
|
@@ -83,12 +86,12 @@ module Ronin
|
|
83
86
|
def self.start(*arguments,**kwargs)
|
84
87
|
shell = new(*arguments,**kwargs)
|
85
88
|
|
89
|
+
prev_completion_proc = Reline.completion_proc
|
86
90
|
Reline.completion_proc = shell.method(:complete)
|
87
|
-
use_history = true
|
88
91
|
|
89
92
|
begin
|
90
93
|
loop do
|
91
|
-
line = Reline.readline("#{shell.prompt} ",
|
94
|
+
line = Reline.readline("#{shell.prompt} ", true)
|
92
95
|
|
93
96
|
if line.nil? # Ctrl^D
|
94
97
|
puts
|
@@ -100,6 +103,8 @@ module Ronin
|
|
100
103
|
unless line.empty?
|
101
104
|
begin
|
102
105
|
shell.exec(line)
|
106
|
+
rescue Interrupt
|
107
|
+
# catch Ctrl^C but keep reading input
|
103
108
|
rescue SystemExit
|
104
109
|
break
|
105
110
|
rescue => error
|
@@ -107,7 +112,10 @@ module Ronin
|
|
107
112
|
end
|
108
113
|
end
|
109
114
|
end
|
110
|
-
rescue Interrupt
|
115
|
+
rescue Interrupt
|
116
|
+
# catch Ctrl^C and return
|
117
|
+
ensure
|
118
|
+
Reline.completion_proc = prev_completion_proc
|
111
119
|
end
|
112
120
|
end
|
113
121
|
|
data/lib/ronin/core/git.rb
CHANGED
@@ -6,12 +6,12 @@
|
|
6
6
|
# it under the terms of the GNU Lesser General Public License as published
|
7
7
|
# by the Free Software Foundation, either version 3 of the License, or
|
8
8
|
# (at your option) any later version.
|
9
|
-
#
|
9
|
+
#
|
10
10
|
# ronin-core is distributed in the hope that it will be useful,
|
11
11
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
12
12
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
13
13
|
# GNU Lesser General Public License for more details.
|
14
|
-
#
|
14
|
+
#
|
15
15
|
# You should have received a copy of the GNU Lesser General Public License
|
16
16
|
# along with ronin-core. If not, see <https://www.gnu.org/licenses/>.
|
17
17
|
#
|
data/lib/ronin/core/home.rb
CHANGED
@@ -6,12 +6,12 @@
|
|
6
6
|
# it under the terms of the GNU Lesser General Public License as published
|
7
7
|
# by the Free Software Foundation, either version 3 of the License, or
|
8
8
|
# (at your option) any later version.
|
9
|
-
#
|
9
|
+
#
|
10
10
|
# ronin-core is distributed in the hope that it will be useful,
|
11
11
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
12
12
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
13
13
|
# GNU Lesser General Public License for more details.
|
14
|
-
#
|
14
|
+
#
|
15
15
|
# You should have received a copy of the GNU Lesser General Public License
|
16
16
|
# along with ronin-core. If not, see <https://www.gnu.org/licenses/>.
|
17
17
|
#
|
@@ -6,12 +6,12 @@
|
|
6
6
|
# it under the terms of the GNU Lesser General Public License as published
|
7
7
|
# by the Free Software Foundation, either version 3 of the License, or
|
8
8
|
# (at your option) any later version.
|
9
|
-
#
|
9
|
+
#
|
10
10
|
# ronin-core is distributed in the hope that it will be useful,
|
11
11
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
12
12
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
13
13
|
# GNU Lesser General Public License for more details.
|
14
|
-
#
|
14
|
+
#
|
15
15
|
# You should have received a copy of the GNU Lesser General Public License
|
16
16
|
# along with ronin-core. If not, see <https://www.gnu.org/licenses/>.
|
17
17
|
#
|
@@ -20,6 +20,9 @@ module Ronin
|
|
20
20
|
module Core
|
21
21
|
module Metadata
|
22
22
|
module Authors
|
23
|
+
#
|
24
|
+
# Represents author metadata.
|
25
|
+
#
|
23
26
|
class Author
|
24
27
|
|
25
28
|
# The author's name.
|
@@ -6,12 +6,12 @@
|
|
6
6
|
# it under the terms of the GNU Lesser General Public License as published
|
7
7
|
# by the Free Software Foundation, either version 3 of the License, or
|
8
8
|
# (at your option) any later version.
|
9
|
-
#
|
9
|
+
#
|
10
10
|
# ronin-core is distributed in the hope that it will be useful,
|
11
11
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
12
12
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
13
13
|
# GNU Lesser General Public License for more details.
|
14
|
-
#
|
14
|
+
#
|
15
15
|
# You should have received a copy of the GNU Lesser General Public License
|
16
16
|
# along with ronin-core. If not, see <https://www.gnu.org/licenses/>.
|
17
17
|
#
|
@@ -28,12 +28,12 @@ module Ronin
|
|
28
28
|
# ### Example
|
29
29
|
#
|
30
30
|
# class MyModule
|
31
|
-
#
|
31
|
+
#
|
32
32
|
# include Ronin::Core::Metadata::Authors
|
33
|
-
#
|
33
|
+
#
|
34
34
|
# author 'John Doe'
|
35
35
|
# author 'John Smith', email: 'john.smith@example.com'
|
36
|
-
#
|
36
|
+
#
|
37
37
|
# end
|
38
38
|
#
|
39
39
|
# puts MyModule.authors
|
@@ -53,6 +53,9 @@ module Ronin
|
|
53
53
|
base.extend ClassMethods
|
54
54
|
end
|
55
55
|
|
56
|
+
#
|
57
|
+
# Class-methods.
|
58
|
+
#
|
56
59
|
module ClassMethods
|
57
60
|
#
|
58
61
|
# The authors associated with the class.
|
@@ -6,12 +6,12 @@
|
|
6
6
|
# it under the terms of the GNU Lesser General Public License as published
|
7
7
|
# by the Free Software Foundation, either version 3 of the License, or
|
8
8
|
# (at your option) any later version.
|
9
|
-
#
|
9
|
+
#
|
10
10
|
# ronin-core is distributed in the hope that it will be useful,
|
11
11
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
12
12
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
13
13
|
# GNU Lesser General Public License for more details.
|
14
|
-
#
|
14
|
+
#
|
15
15
|
# You should have received a copy of the GNU Lesser General Public License
|
16
16
|
# along with ronin-core. If not, see <https://www.gnu.org/licenses/>.
|
17
17
|
#
|
@@ -26,9 +26,9 @@ module Ronin
|
|
26
26
|
# ### Example
|
27
27
|
#
|
28
28
|
# class MyModule
|
29
|
-
#
|
29
|
+
#
|
30
30
|
# include Ronin::Core::Metadata::Description
|
31
|
-
#
|
31
|
+
#
|
32
32
|
# description <<~DESC
|
33
33
|
# Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do
|
34
34
|
# eiusmod tempor incididunt ut labore et dolore magna aliqua.
|
@@ -41,7 +41,7 @@ module Ronin
|
|
41
41
|
# proident, sunt in culpa qui officia deserunt mollit anim id est
|
42
42
|
# laborum.
|
43
43
|
# DESC
|
44
|
-
#
|
44
|
+
#
|
45
45
|
# end
|
46
46
|
#
|
47
47
|
module Description
|
@@ -57,6 +57,9 @@ module Ronin
|
|
57
57
|
base.extend ClassMethods
|
58
58
|
end
|
59
59
|
|
60
|
+
#
|
61
|
+
# Class-methods.
|
62
|
+
#
|
60
63
|
module ClassMethods
|
61
64
|
#
|
62
65
|
# Gets or sets the description.
|
@@ -6,12 +6,12 @@
|
|
6
6
|
# it under the terms of the GNU Lesser General Public License as published
|
7
7
|
# by the Free Software Foundation, either version 3 of the License, or
|
8
8
|
# (at your option) any later version.
|
9
|
-
#
|
9
|
+
#
|
10
10
|
# ronin-core is distributed in the hope that it will be useful,
|
11
11
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
12
12
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
13
13
|
# GNU Lesser General Public License for more details.
|
14
|
-
#
|
14
|
+
#
|
15
15
|
# You should have received a copy of the GNU Lesser General Public License
|
16
16
|
# along with ronin-core. If not, see <https://www.gnu.org/licenses/>.
|
17
17
|
#
|
@@ -25,13 +25,13 @@ module Ronin
|
|
25
25
|
# ### Example
|
26
26
|
#
|
27
27
|
# class MyClass
|
28
|
-
#
|
28
|
+
#
|
29
29
|
# include Ronin::Core::Metadata::ID
|
30
30
|
#
|
31
31
|
# id 'my_class'
|
32
32
|
#
|
33
33
|
# end
|
34
|
-
#
|
34
|
+
#
|
35
35
|
module ID
|
36
36
|
#
|
37
37
|
# Adds {ClassMethods} to the class.
|
@@ -45,6 +45,9 @@ module Ronin
|
|
45
45
|
base.extend ClassMethods
|
46
46
|
end
|
47
47
|
|
48
|
+
#
|
49
|
+
# Class-methods.
|
50
|
+
#
|
48
51
|
module ClassMethods
|
49
52
|
#
|
50
53
|
# Gets or sets the class `id`.
|
@@ -6,12 +6,12 @@
|
|
6
6
|
# it under the terms of the GNU Lesser General Public License as published
|
7
7
|
# by the Free Software Foundation, either version 3 of the License, or
|
8
8
|
# (at your option) any later version.
|
9
|
-
#
|
9
|
+
#
|
10
10
|
# ronin-core is distributed in the hope that it will be useful,
|
11
11
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
12
12
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
13
13
|
# GNU Lesser General Public License for more details.
|
14
|
-
#
|
14
|
+
#
|
15
15
|
# You should have received a copy of the GNU Lesser General Public License
|
16
16
|
# along with ronin-core. If not, see <https://www.gnu.org/licenses/>.
|
17
17
|
#
|
@@ -26,14 +26,14 @@ module Ronin
|
|
26
26
|
# ### Example
|
27
27
|
#
|
28
28
|
# class MyModule
|
29
|
-
#
|
29
|
+
#
|
30
30
|
# include Ronin::Core::Metadata::References
|
31
|
-
#
|
31
|
+
#
|
32
32
|
# references [
|
33
33
|
# "https://...",
|
34
34
|
# ...
|
35
35
|
# ]
|
36
|
-
#
|
36
|
+
#
|
37
37
|
# end
|
38
38
|
#
|
39
39
|
module References
|
@@ -49,6 +49,9 @@ module Ronin
|
|
49
49
|
base.extend ClassMethods
|
50
50
|
end
|
51
51
|
|
52
|
+
#
|
53
|
+
# Class-methods.
|
54
|
+
#
|
52
55
|
module ClassMethods
|
53
56
|
#
|
54
57
|
# Gets or sets the reference links.
|
@@ -71,7 +74,11 @@ module Ronin
|
|
71
74
|
#
|
72
75
|
def references(new_references=nil)
|
73
76
|
if new_references
|
74
|
-
@references =
|
77
|
+
@references = if superclass.kind_of?(ClassMethods)
|
78
|
+
superclass.references + new_references
|
79
|
+
else
|
80
|
+
new_references
|
81
|
+
end
|
75
82
|
else
|
76
83
|
@references || if superclass.kind_of?(ClassMethods)
|
77
84
|
superclass.references
|
@@ -6,12 +6,12 @@
|
|
6
6
|
# it under the terms of the GNU Lesser General Public License as published
|
7
7
|
# by the Free Software Foundation, either version 3 of the License, or
|
8
8
|
# (at your option) any later version.
|
9
|
-
#
|
9
|
+
#
|
10
10
|
# ronin-core is distributed in the hope that it will be useful,
|
11
11
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
12
12
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
13
13
|
# GNU Lesser General Public License for more details.
|
14
|
-
#
|
14
|
+
#
|
15
15
|
# You should have received a copy of the GNU Lesser General Public License
|
16
16
|
# along with ronin-core. If not, see <https://www.gnu.org/licenses/>.
|
17
17
|
#
|
@@ -26,11 +26,11 @@ module Ronin
|
|
26
26
|
# ### Example
|
27
27
|
#
|
28
28
|
# class MyModule
|
29
|
-
#
|
29
|
+
#
|
30
30
|
# include Ronin::Core::Metadata::Summary
|
31
|
-
#
|
31
|
+
#
|
32
32
|
# summary "Lorem ipsum dolor sit amet, consectetur adipiscing elit"
|
33
|
-
#
|
33
|
+
#
|
34
34
|
# end
|
35
35
|
#
|
36
36
|
module Summary
|
@@ -46,6 +46,9 @@ module Ronin
|
|
46
46
|
base.extend ClassMethods
|
47
47
|
end
|
48
48
|
|
49
|
+
#
|
50
|
+
# Class-methods.
|
51
|
+
#
|
49
52
|
module ClassMethods
|
50
53
|
#
|
51
54
|
# Gets or sets the summary.
|
@@ -57,7 +60,7 @@ module Ronin
|
|
57
60
|
# The previously set summary text.
|
58
61
|
#
|
59
62
|
# @example Setting the summary:
|
60
|
-
# summary "Lorem ipsum dolor sit amet, consectetur adipiscing elit"
|
63
|
+
# summary "Lorem ipsum dolor sit amet, consectetur adipiscing elit"
|
61
64
|
#
|
62
65
|
# @example Getting the summary:
|
63
66
|
# MyModule.summary
|
@@ -67,7 +70,7 @@ module Ronin
|
|
67
70
|
@summary = new_summary
|
68
71
|
else
|
69
72
|
@summary || if superclass.kind_of?(ClassMethods)
|
70
|
-
|
73
|
+
superclass.summary
|
71
74
|
end
|
72
75
|
end
|
73
76
|
end
|
@@ -6,12 +6,12 @@
|
|
6
6
|
# it under the terms of the GNU Lesser General Public License as published
|
7
7
|
# by the Free Software Foundation, either version 3 of the License, or
|
8
8
|
# (at your option) any later version.
|
9
|
-
#
|
9
|
+
#
|
10
10
|
# ronin-core is distributed in the hope that it will be useful,
|
11
11
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
12
12
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
13
13
|
# GNU Lesser General Public License for more details.
|
14
|
-
#
|
14
|
+
#
|
15
15
|
# You should have received a copy of the GNU Lesser General Public License
|
16
16
|
# along with ronin-core. If not, see <https://www.gnu.org/licenses/>.
|
17
17
|
#
|
@@ -26,11 +26,11 @@ module Ronin
|
|
26
26
|
# ### Example
|
27
27
|
#
|
28
28
|
# class MyModule
|
29
|
-
#
|
29
|
+
#
|
30
30
|
# include Ronin::Core::Metadata::Version
|
31
|
-
#
|
31
|
+
#
|
32
32
|
# version '0.2'
|
33
|
-
#
|
33
|
+
#
|
34
34
|
# end
|
35
35
|
#
|
36
36
|
module Version
|
@@ -46,6 +46,9 @@ module Ronin
|
|
46
46
|
base.extend ClassMethods
|
47
47
|
end
|
48
48
|
|
49
|
+
#
|
50
|
+
# Class methods.
|
51
|
+
#
|
49
52
|
module ClassMethods
|
50
53
|
#
|
51
54
|
# Gets or sets the version number.
|
@@ -6,12 +6,12 @@
|
|
6
6
|
# it under the terms of the GNU Lesser General Public License as published
|
7
7
|
# by the Free Software Foundation, either version 3 of the License, or
|
8
8
|
# (at your option) any later version.
|
9
|
-
#
|
9
|
+
#
|
10
10
|
# ronin-core is distributed in the hope that it will be useful,
|
11
11
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
12
12
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
13
13
|
# GNU Lesser General Public License for more details.
|
14
|
-
#
|
14
|
+
#
|
15
15
|
# You should have received a copy of the GNU Lesser General Public License
|
16
16
|
# along with ronin-core. If not, see <https://www.gnu.org/licenses/>.
|
17
17
|
#
|