ronin-core 0.1.0.beta1 → 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/.github/workflows/ruby.yml +1 -0
- data/.rubocop.yml +13 -150
- data/.yardopts +1 -1
- data/ChangeLog.md +9 -1
- data/Gemfile +3 -1
- data/README.md +2 -1
- data/Rakefile +1 -1
- data/examples/ruby_shell.rb +5 -0
- data/examples/test_shell.rb +41 -0
- data/gemspec.yml +1 -1
- data/lib/ronin/core/class_registry.rb +18 -13
- data/lib/ronin/core/cli/command.rb +12 -12
- data/lib/ronin/core/cli/command_shell/command.rb +9 -6
- data/lib/ronin/core/cli/command_shell.rb +11 -11
- data/lib/ronin/core/cli/generator/options/author.rb +5 -6
- data/lib/ronin/core/cli/generator/options/description.rb +3 -3
- data/lib/ronin/core/cli/generator/options/reference.rb +3 -3
- data/lib/ronin/core/cli/generator/options/summary.rb +3 -3
- data/lib/ronin/core/cli/generator.rb +11 -8
- data/lib/ronin/core/cli/logging.rb +6 -3
- data/lib/ronin/core/cli/options/param.rb +5 -5
- data/lib/ronin/core/cli/options/values/arches.rb +3 -3
- data/lib/ronin/core/cli/options/values/oses.rb +3 -3
- data/lib/ronin/core/cli/printing/arch.rb +3 -3
- data/lib/ronin/core/cli/printing/metadata.rb +4 -4
- data/lib/ronin/core/cli/printing/os.rb +6 -3
- data/lib/ronin/core/cli/printing/params.rb +7 -7
- data/lib/ronin/core/cli/ruby_shell.rb +4 -3
- data/lib/ronin/core/cli/shell.rb +16 -8
- data/lib/ronin/core/git.rb +3 -3
- data/lib/ronin/core/home.rb +3 -3
- data/lib/ronin/core/metadata/authors/author.rb +6 -3
- data/lib/ronin/core/metadata/authors.rb +9 -6
- data/lib/ronin/core/metadata/description.rb +9 -6
- data/lib/ronin/core/metadata/id.rb +8 -5
- data/lib/ronin/core/metadata/references.rb +14 -7
- data/lib/ronin/core/metadata/summary.rb +11 -8
- data/lib/ronin/core/metadata/version.rb +9 -6
- data/lib/ronin/core/params/exceptions.rb +3 -3
- data/lib/ronin/core/params/mixin.rb +17 -17
- data/lib/ronin/core/params/param.rb +4 -4
- data/lib/ronin/core/params/types/boolean.rb +3 -3
- data/lib/ronin/core/params/types/enum.rb +8 -4
- data/lib/ronin/core/params/types/float.rb +3 -3
- data/lib/ronin/core/params/types/integer.rb +3 -3
- data/lib/ronin/core/params/types/numeric.rb +4 -4
- data/lib/ronin/core/params/types/regexp.rb +3 -3
- data/lib/ronin/core/params/types/string.rb +3 -3
- data/lib/ronin/core/params/types/type.rb +3 -3
- data/lib/ronin/core/params/types/uri.rb +3 -3
- data/lib/ronin/core/params/types.rb +7 -4
- data/lib/ronin/core/params.rb +3 -3
- data/lib/ronin/core/version.rb +4 -4
- data/ronin-core.gemspec +7 -4
- metadata +5 -90
- data/spec/class_registry_spec.rb +0 -224
- data/spec/cli/command_shell/command_spec.rb +0 -113
- data/spec/cli/command_shell_spec.rb +0 -1114
- data/spec/cli/command_spec.rb +0 -16
- data/spec/cli/fixtures/irb_command +0 -8
- data/spec/cli/fixtures/template/dir/file1.txt +0 -1
- data/spec/cli/fixtures/template/dir/file2.txt +0 -1
- data/spec/cli/fixtures/template/file.erb +0 -1
- data/spec/cli/fixtures/template/file.txt +0 -1
- data/spec/cli/generator/options/author_spec.rb +0 -121
- data/spec/cli/generator/options/description_spec.rb +0 -45
- data/spec/cli/generator/options/reference_spec.rb +0 -53
- data/spec/cli/generator/options/summary_spec.rb +0 -45
- data/spec/cli/generator_spec.rb +0 -244
- data/spec/cli/logging_spec.rb +0 -95
- data/spec/cli/options/param_spec.rb +0 -67
- data/spec/cli/options/values/arches_spec.rb +0 -62
- data/spec/cli/printing/arch_spec.rb +0 -130
- data/spec/cli/printing/metadata_spec.rb +0 -211
- data/spec/cli/printing/os_spec.rb +0 -64
- data/spec/cli/printing/params_spec.rb +0 -63
- data/spec/cli/ruby_shell.rb +0 -99
- data/spec/cli/shell_spec.rb +0 -211
- data/spec/fixtures/example_class_registry/base_class.rb +0 -9
- data/spec/fixtures/example_class_registry/classes/loaded_class.rb +0 -9
- data/spec/fixtures/example_class_registry/classes/name_mismatch.rb +0 -9
- data/spec/fixtures/example_class_registry/classes/no_module.rb +0 -4
- data/spec/fixtures/example_class_registry.rb +0 -8
- data/spec/git_spec.rb +0 -58
- data/spec/home_spec.rb +0 -64
- data/spec/metadata/authors/author_spec.rb +0 -335
- data/spec/metadata/authors_spec.rb +0 -126
- data/spec/metadata/description_spec.rb +0 -74
- data/spec/metadata/id_spec.rb +0 -92
- data/spec/metadata/references_spec.rb +0 -100
- data/spec/metadata/summary_spec.rb +0 -74
- data/spec/metadata/version_spec.rb +0 -72
- data/spec/params/mixin_spec.rb +0 -484
- data/spec/params/param_spec.rb +0 -164
- data/spec/params/types/boolean_spec.rb +0 -56
- data/spec/params/types/enum_spec.rb +0 -94
- data/spec/params/types/float_spec.rb +0 -107
- data/spec/params/types/integer_spec.rb +0 -155
- data/spec/params/types/numeric_spec.rb +0 -138
- data/spec/params/types/regexp_spec.rb +0 -64
- data/spec/params/types/string_spec.rb +0 -174
- data/spec/params/types/type_spec.rb +0 -14
- data/spec/params/types/uri_spec.rb +0 -62
- data/spec/spec_helper.rb +0 -11
@@ -1,17 +1,17 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
#
|
3
|
-
# Copyright (c) 2021-
|
3
|
+
# Copyright (c) 2021-2023 Hal Brodigan (postmodern.mod3 at gmail.com)
|
4
4
|
#
|
5
5
|
# ronin-core is free software: you can redistribute it and/or modify
|
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`.
|
@@ -1,17 +1,17 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
#
|
3
|
-
# Copyright (c) 2021-
|
3
|
+
# Copyright (c) 2021-2023 Hal Brodigan (postmodern.mod3 at gmail.com)
|
4
4
|
#
|
5
5
|
# ronin-core is free software: you can redistribute it and/or modify
|
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
|
@@ -1,17 +1,17 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
#
|
3
|
-
# Copyright (c) 2021-
|
3
|
+
# Copyright (c) 2021-2023 Hal Brodigan (postmodern.mod3 at gmail.com)
|
4
4
|
#
|
5
5
|
# ronin-core is free software: you can redistribute it and/or modify
|
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
|
@@ -1,17 +1,17 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
#
|
3
|
-
# Copyright (c) 2021-
|
3
|
+
# Copyright (c) 2021-2023 Hal Brodigan (postmodern.mod3 at gmail.com)
|
4
4
|
#
|
5
5
|
# ronin-core is free software: you can redistribute it and/or modify
|
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.
|
@@ -1,17 +1,17 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
#
|
3
|
-
# Copyright (c) 2021-
|
3
|
+
# Copyright (c) 2021-2023 Hal Brodigan (postmodern.mod3 at gmail.com)
|
4
4
|
#
|
5
5
|
# ronin-core is free software: you can redistribute it and/or modify
|
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
|
#
|
@@ -1,17 +1,17 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
#
|
3
|
-
# Copyright (c) 2021-
|
3
|
+
# Copyright (c) 2021-2023 Hal Brodigan (postmodern.mod3 at gmail.com)
|
4
4
|
#
|
5
5
|
# ronin-core is free software: you can redistribute it and/or modify
|
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
|
#
|
@@ -29,36 +29,36 @@ module Ronin
|
|
29
29
|
# ## Examples
|
30
30
|
#
|
31
31
|
# class BaseClass
|
32
|
-
#
|
32
|
+
#
|
33
33
|
# include Ronin::Core::Params::Mixin
|
34
|
-
#
|
34
|
+
#
|
35
35
|
# end
|
36
36
|
#
|
37
37
|
# class MyModule < BaseClass
|
38
|
-
#
|
38
|
+
#
|
39
39
|
# param :str, desc: 'A basic string param'
|
40
|
-
#
|
40
|
+
#
|
41
41
|
# param :feature_flag, Boolean, desc: 'A boolean param'
|
42
|
-
#
|
42
|
+
#
|
43
43
|
# param :enum, Enum[:one, :two, :three],
|
44
44
|
# desc: 'An enum param'
|
45
45
|
#
|
46
46
|
# param :num1, Integer, desc: 'An integer param'
|
47
|
-
#
|
47
|
+
#
|
48
48
|
# param :num2, Integer, default: 42,
|
49
49
|
# desc: 'A param with a default value'
|
50
|
-
#
|
50
|
+
#
|
51
51
|
# param :num3, Integer, default: ->{ rand(42) },
|
52
52
|
# desc: 'A param with a dynamic default value'
|
53
|
-
#
|
53
|
+
#
|
54
54
|
# param :float, Float, 'Floating point param'
|
55
55
|
#
|
56
56
|
# param :url, URI, desc: 'URL param'
|
57
57
|
#
|
58
58
|
# param :pattern, Regexp, desc: 'Regular Expression param'
|
59
|
-
#
|
59
|
+
#
|
60
60
|
# end
|
61
|
-
#
|
61
|
+
#
|
62
62
|
# mod = MyModule.new(params: {num1: 1, enum: :two})
|
63
63
|
# mod.params
|
64
64
|
# # => {:num2=>42, :num3=>25, :num1=>1, :enum=>:two}
|
@@ -79,7 +79,7 @@ module Ronin
|
|
79
79
|
# The class which is including {Mixin}.
|
80
80
|
#
|
81
81
|
# @raise [TypeError]
|
82
|
-
# {Mixin} was
|
82
|
+
# {Mixin} was included into a module instead of a class.
|
83
83
|
#
|
84
84
|
# @api private
|
85
85
|
#
|
@@ -197,7 +197,7 @@ module Ronin
|
|
197
197
|
end
|
198
198
|
|
199
199
|
# The param values.
|
200
|
-
#
|
200
|
+
#
|
201
201
|
# @return [Hash{Symbol => Object}]
|
202
202
|
#
|
203
203
|
# @api public
|
@@ -220,7 +220,7 @@ module Ronin
|
|
220
220
|
#
|
221
221
|
def initialize(*arguments, params: nil, **kwargs, &block)
|
222
222
|
if params then self.params = params
|
223
|
-
else initialize_params
|
223
|
+
else initialize_params
|
224
224
|
end
|
225
225
|
|
226
226
|
super(*arguments,**kwargs,&block)
|
@@ -281,7 +281,7 @@ module Ronin
|
|
281
281
|
#
|
282
282
|
def params=(new_params)
|
283
283
|
# re-initialize the params each time they are set en-mass
|
284
|
-
initialize_params
|
284
|
+
initialize_params
|
285
285
|
|
286
286
|
new_params.each do |name,value|
|
287
287
|
set_param(name,value)
|
@@ -1,17 +1,17 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
#
|
3
|
-
# Copyright (c) 2021-
|
3
|
+
# Copyright (c) 2021-2023 Hal Brodigan (postmodern.mod3 at gmail.com)
|
4
4
|
#
|
5
5
|
# ronin-core is free software: you can redistribute it and/or modify
|
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
|
#
|
@@ -41,7 +41,7 @@ module Ronin
|
|
41
41
|
# @return [Boolean]
|
42
42
|
attr_reader :required
|
43
43
|
|
44
|
-
# The
|
44
|
+
# The default value or proc for the param.
|
45
45
|
#
|
46
46
|
# @return [Object, Proc, nil]
|
47
47
|
attr_reader :default
|
@@ -1,17 +1,17 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
#
|
3
|
-
# Copyright (c) 2021-
|
3
|
+
# Copyright (c) 2021-2023 Hal Brodigan (postmodern.mod3 at gmail.com)
|
4
4
|
#
|
5
5
|
# ronin-core is free software: you can redistribute it and/or modify
|
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
|
#
|
@@ -1,17 +1,17 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
#
|
3
|
-
# Copyright (c) 2021-
|
3
|
+
# Copyright (c) 2021-2023 Hal Brodigan (postmodern.mod3 at gmail.com)
|
4
4
|
#
|
5
5
|
# ronin-core is free software: you can redistribute it and/or modify
|
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
|
#
|
@@ -51,7 +51,11 @@ module Ronin
|
|
51
51
|
end
|
52
52
|
|
53
53
|
@values = values
|
54
|
-
@map =
|
54
|
+
@map = {}
|
55
|
+
|
56
|
+
values.each do |value|
|
57
|
+
@map[value.to_s] = value
|
58
|
+
end
|
55
59
|
end
|
56
60
|
|
57
61
|
#
|
@@ -1,17 +1,17 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
#
|
3
|
-
# Copyright (c) 2021-
|
3
|
+
# Copyright (c) 2021-2023 Hal Brodigan (postmodern.mod3 at gmail.com)
|
4
4
|
#
|
5
5
|
# ronin-core is free software: you can redistribute it and/or modify
|
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
|
#
|
@@ -1,17 +1,17 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
#
|
3
|
-
# Copyright (c) 2021-
|
3
|
+
# Copyright (c) 2021-2023 Hal Brodigan (postmodern.mod3 at gmail.com)
|
4
4
|
#
|
5
5
|
# ronin-core is free software: you can redistribute it and/or modify
|
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
|
#
|
@@ -1,17 +1,17 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
#
|
3
|
-
# Copyright (c) 2021-
|
3
|
+
# Copyright (c) 2021-2023 Hal Brodigan (postmodern.mod3 at gmail.com)
|
4
4
|
#
|
5
5
|
# ronin-core is free software: you can redistribute it and/or modify
|
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
|
#
|
@@ -30,7 +30,7 @@ module Ronin
|
|
30
30
|
# The optional minimum value.
|
31
31
|
#
|
32
32
|
# @return [::Integer, nil]
|
33
|
-
#
|
33
|
+
#
|
34
34
|
# @api private
|
35
35
|
attr_reader :min
|
36
36
|
|
@@ -1,17 +1,17 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
#
|
3
|
-
# Copyright (c) 2021-
|
3
|
+
# Copyright (c) 2021-2023 Hal Brodigan (postmodern.mod3 at gmail.com)
|
4
4
|
#
|
5
5
|
# ronin-core is free software: you can redistribute it and/or modify
|
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
|
#
|
@@ -1,17 +1,17 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
#
|
3
|
-
# Copyright (c) 2021-
|
3
|
+
# Copyright (c) 2021-2023 Hal Brodigan (postmodern.mod3 at gmail.com)
|
4
4
|
#
|
5
5
|
# ronin-core is free software: you can redistribute it and/or modify
|
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
|
#
|
@@ -1,17 +1,17 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
#
|
3
|
-
# Copyright (c) 2021-
|
3
|
+
# Copyright (c) 2021-2023 Hal Brodigan (postmodern.mod3 at gmail.com)
|
4
4
|
#
|
5
5
|
# ronin-core is free software: you can redistribute it and/or modify
|
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
|
#
|
@@ -1,17 +1,17 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
#
|
3
|
-
# Copyright (c) 2021-
|
3
|
+
# Copyright (c) 2021-2023 Hal Brodigan (postmodern.mod3 at gmail.com)
|
4
4
|
#
|
5
5
|
# ronin-core is free software: you can redistribute it and/or modify
|
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
|
#
|
@@ -1,17 +1,17 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
#
|
3
|
-
# Copyright (c) 2021-
|
3
|
+
# Copyright (c) 2021-2023 Hal Brodigan (postmodern.mod3 at gmail.com)
|
4
4
|
#
|
5
5
|
# ronin-core is free software: you can redistribute it and/or modify
|
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,6 +28,9 @@ require 'ronin/core/params/types/enum'
|
|
28
28
|
module Ronin
|
29
29
|
module Core
|
30
30
|
module Params
|
31
|
+
#
|
32
|
+
# Contains all {Param::Type} classes.
|
33
|
+
#
|
31
34
|
module Types
|
32
35
|
# Mapping of ruby core classes to param types.
|
33
36
|
TYPE_ALIASES = {
|
@@ -35,7 +38,7 @@ module Ronin
|
|
35
38
|
::Integer => Types::Integer,
|
36
39
|
::Float => Types::Float,
|
37
40
|
::Regexp => Types::Regexp,
|
38
|
-
::URI => Types::URI
|
41
|
+
::URI => Types::URI
|
39
42
|
}
|
40
43
|
|
41
44
|
#
|
data/lib/ronin/core/params.rb
CHANGED
@@ -1,17 +1,17 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
#
|
3
|
-
# Copyright (c) 2021-
|
3
|
+
# Copyright (c) 2021-2023 Hal Brodigan (postmodern.mod3 at gmail.com)
|
4
4
|
#
|
5
5
|
# ronin-core is free software: you can redistribute it and/or modify
|
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
|
#
|