dradis-plugins 4.17.0 → 4.19.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.rubocop.yml +129 -0
- data/CHANGELOG.md +6 -0
- data/Rakefile +1 -2
- data/app/controllers/concerns/dradis/plugins/exportable.rb +1 -1
- data/dradis-plugins.gemspec +1 -0
- data/lib/dradis/plugins/content_service/base.rb +1 -1
- data/lib/dradis/plugins/content_service/boards.rb +1 -1
- data/lib/dradis/plugins/content_service/content_blocks.rb +1 -1
- data/lib/dradis/plugins/content_service/core.rb +4 -4
- data/lib/dradis/plugins/content_service/evidence.rb +1 -1
- data/lib/dradis/plugins/content_service/issues.rb +1 -2
- data/lib/dradis/plugins/content_service/nodes.rb +1 -2
- data/lib/dradis/plugins/content_service/notes.rb +1 -1
- data/lib/dradis/plugins/engine.rb +1 -1
- data/lib/dradis/plugins/export/base.rb +3 -4
- data/lib/dradis/plugins/gem_version.rb +1 -1
- data/lib/dradis/plugins/import/filters/base.rb +2 -4
- data/lib/dradis/plugins/import/filters.rb +1 -3
- data/lib/dradis/plugins/import/result.rb +3 -2
- data/lib/dradis/plugins/mappings/base.rb +0 -1
- data/lib/dradis/plugins/settings.rb +2 -2
- data/lib/dradis/plugins/thor.rb +3 -3
- data/lib/dradis/plugins/thor_helper.rb +0 -1
- data/lib/dradis/plugins/upload/field_processor.rb +3 -5
- data/lib/dradis/plugins/upload/importer.rb +3 -4
- data/lib/dradis/plugins/upload.rb +1 -1
- data/lib/dradis/plugins/version.rb +1 -1
- data/lib/dradis/plugins.rb +0 -1
- data/spec/settings_spec.rb +7 -9
- metadata +18 -7
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 71b6ed361bb7be89c9866b89c5aaf0f07dcea637453c80db034d84f53e4baac5
|
|
4
|
+
data.tar.gz: 11db1abdc7c169d147c2a2445e9ce277568103579c9d9435b30fbe1a978fe19f
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: c3457901aaadbd6ff208f087dcb10e36faae4d54a2d2f4ce2dcd708c4ee732b9fef857c8e62c2551b98a641956d29f2e900c221657d34265009cbcb80f068639
|
|
7
|
+
data.tar.gz: be6a12a20cd48e49f54ba69e7b176cf1891ecc61091d0db620c9e6b5285d6bc87f290887c05ab5819ea58df5509598cc79f40f6378e3798f7cce3ed04787c58c
|
data/.rubocop.yml
ADDED
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
AllCops:
|
|
2
|
+
# RuboCop has a bunch of cops enabled by default. This setting tells RuboCop
|
|
3
|
+
# to ignore them, so only the ones explicitly set in this file are enabled.
|
|
4
|
+
DisabledByDefault: true
|
|
5
|
+
SuggestExtensions: false
|
|
6
|
+
Exclude:
|
|
7
|
+
- '**/templates/**/*'
|
|
8
|
+
|
|
9
|
+
# Prefer &&/|| over and/or.
|
|
10
|
+
Style/AndOr:
|
|
11
|
+
Enabled: true
|
|
12
|
+
|
|
13
|
+
# Do not use braces for hash literals when they are the last argument of a
|
|
14
|
+
# method call.
|
|
15
|
+
Style/HashAsLastArrayItem:
|
|
16
|
+
Enabled: true
|
|
17
|
+
|
|
18
|
+
# Align `when` with `case`.
|
|
19
|
+
Layout/CaseIndentation:
|
|
20
|
+
Enabled: true
|
|
21
|
+
|
|
22
|
+
# Align comments with method definitions.
|
|
23
|
+
Layout/CommentIndentation:
|
|
24
|
+
Enabled: true
|
|
25
|
+
|
|
26
|
+
Layout/EmptyLineAfterMagicComment:
|
|
27
|
+
Enabled: true
|
|
28
|
+
|
|
29
|
+
# No extra empty lines.
|
|
30
|
+
Layout/EmptyLines:
|
|
31
|
+
Enabled: true
|
|
32
|
+
|
|
33
|
+
# In a regular class definition, no empty lines around the body.
|
|
34
|
+
Layout/EmptyLinesAroundClassBody:
|
|
35
|
+
Enabled: true
|
|
36
|
+
|
|
37
|
+
# In a regular method definition, no empty lines around the body.
|
|
38
|
+
Layout/EmptyLinesAroundMethodBody:
|
|
39
|
+
Enabled: true
|
|
40
|
+
|
|
41
|
+
# In a regular module definition, no empty lines around the body.
|
|
42
|
+
Layout/EmptyLinesAroundModuleBody:
|
|
43
|
+
Enabled: true
|
|
44
|
+
|
|
45
|
+
Layout/FirstArgumentIndentation:
|
|
46
|
+
Enabled: true
|
|
47
|
+
|
|
48
|
+
# Use Ruby >= 1.9 syntax for hashes. Prefer { a: :b } over { :a => :b }.
|
|
49
|
+
Style/HashSyntax:
|
|
50
|
+
Enabled: true
|
|
51
|
+
EnforcedShorthandSyntax: never
|
|
52
|
+
|
|
53
|
+
# Method definitions after `private` or `protected` isolated calls need one
|
|
54
|
+
# extra level of indentation.
|
|
55
|
+
Layout/IndentationConsistency:
|
|
56
|
+
Enabled: true
|
|
57
|
+
EnforcedStyle: normal
|
|
58
|
+
|
|
59
|
+
# Two spaces, no tabs (for indentation).
|
|
60
|
+
Layout/IndentationWidth:
|
|
61
|
+
Enabled: true
|
|
62
|
+
|
|
63
|
+
Layout/SpaceAfterColon:
|
|
64
|
+
Enabled: true
|
|
65
|
+
|
|
66
|
+
Layout/SpaceAfterComma:
|
|
67
|
+
Enabled: true
|
|
68
|
+
|
|
69
|
+
Layout/SpaceAroundEqualsInParameterDefault:
|
|
70
|
+
Enabled: true
|
|
71
|
+
|
|
72
|
+
Layout/SpaceAroundKeyword:
|
|
73
|
+
Enabled: true
|
|
74
|
+
|
|
75
|
+
Layout/SpaceAroundOperators:
|
|
76
|
+
Enabled: true
|
|
77
|
+
|
|
78
|
+
Layout/SpaceBeforeFirstArg:
|
|
79
|
+
Enabled: true
|
|
80
|
+
|
|
81
|
+
# Defining a method with parameters needs parentheses.
|
|
82
|
+
Style/MethodDefParentheses:
|
|
83
|
+
Enabled: true
|
|
84
|
+
|
|
85
|
+
# Use `foo {}` not `foo{}`.
|
|
86
|
+
Layout/SpaceBeforeBlockBraces:
|
|
87
|
+
Enabled: true
|
|
88
|
+
|
|
89
|
+
# Use `foo { bar }` not `foo {bar}`.
|
|
90
|
+
Layout/SpaceInsideBlockBraces:
|
|
91
|
+
Enabled: true
|
|
92
|
+
|
|
93
|
+
# Use `{ a: 1 }` not `{a:1}`.
|
|
94
|
+
Layout/SpaceInsideHashLiteralBraces:
|
|
95
|
+
Enabled: true
|
|
96
|
+
|
|
97
|
+
Layout/SpaceInsideParens:
|
|
98
|
+
Enabled: true
|
|
99
|
+
|
|
100
|
+
# Check quotes usage according to lint rule below.
|
|
101
|
+
Style/StringLiterals:
|
|
102
|
+
Enabled: true
|
|
103
|
+
EnforcedStyle: single_quotes
|
|
104
|
+
|
|
105
|
+
# Detect hard tabs, no hard tabs.
|
|
106
|
+
Layout/IndentationStyle:
|
|
107
|
+
Enabled: true
|
|
108
|
+
|
|
109
|
+
# Blank lines should not have any spaces.
|
|
110
|
+
Layout/TrailingEmptyLines:
|
|
111
|
+
Enabled: true
|
|
112
|
+
|
|
113
|
+
# No trailing whitespace.
|
|
114
|
+
Layout/TrailingWhitespace:
|
|
115
|
+
Enabled: true
|
|
116
|
+
|
|
117
|
+
# Use quotes for string literals when they are enough.
|
|
118
|
+
Style/RedundantPercentQ:
|
|
119
|
+
Enabled: true
|
|
120
|
+
|
|
121
|
+
# Align `end` with the matching keyword or starting expression except for
|
|
122
|
+
# assignments, where it should be aligned with the LHS.
|
|
123
|
+
Layout/EndAlignment:
|
|
124
|
+
Enabled: true
|
|
125
|
+
EnforcedStyleAlignWith: variable
|
|
126
|
+
|
|
127
|
+
# Use my_method(my_arg) not my_method( my_arg ) or my_method my_arg.
|
|
128
|
+
Lint/RequireParentheses:
|
|
129
|
+
Enabled: true
|
data/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,9 @@
|
|
|
1
|
+
v4.19.0 (November 2025)
|
|
2
|
+
- Add state attribute to Result class
|
|
3
|
+
|
|
4
|
+
v4.18.0 (September 2025)
|
|
5
|
+
- Update File.exists? calls for ruby upgrade
|
|
6
|
+
|
|
1
7
|
v4.17.0 (July 2025)
|
|
2
8
|
- Add Exportable concern to house shared report export logic from Export::BaseController
|
|
3
9
|
- Only track report export when report is created
|
data/Rakefile
CHANGED
|
@@ -1,2 +1 @@
|
|
|
1
|
-
require
|
|
2
|
-
|
|
1
|
+
require 'bundler/gem_tasks'
|
|
@@ -37,7 +37,7 @@ module Dradis
|
|
|
37
37
|
@template_file =
|
|
38
38
|
File.expand_path(File.join(templates_dir, export_params[:template]))
|
|
39
39
|
|
|
40
|
-
unless @template_file.starts_with?(templates_dir) && File.
|
|
40
|
+
unless @template_file.starts_with?(templates_dir) && File.exist?(@template_file)
|
|
41
41
|
if is_api?
|
|
42
42
|
render_json_error(Exception.new('Something fishy is going on...'), 422)
|
|
43
43
|
else
|
data/dradis-plugins.gemspec
CHANGED
|
@@ -10,7 +10,7 @@ module Dradis::Plugins::ContentService
|
|
|
10
10
|
project.methodology_library.boards
|
|
11
11
|
end
|
|
12
12
|
|
|
13
|
-
def create_board(args={})
|
|
13
|
+
def create_board(args = {})
|
|
14
14
|
name = args.fetch(:name, default_board_name)
|
|
15
15
|
node_id = args.fetch(:node_id, default_node_id)
|
|
16
16
|
Board.create(
|
|
@@ -13,7 +13,7 @@ module Dradis::Plugins::ContentService
|
|
|
13
13
|
end
|
|
14
14
|
end
|
|
15
15
|
|
|
16
|
-
def create_content_block(args={})
|
|
16
|
+
def create_content_block(args = {})
|
|
17
17
|
block_group = args.fetch(:block_group, default_content_block_group)
|
|
18
18
|
content = args.fetch(:content, default_content_block_content)
|
|
19
19
|
state = args.fetch(:state, :published)
|
|
@@ -11,7 +11,7 @@ module Dradis::Plugins::ContentService
|
|
|
11
11
|
|
|
12
12
|
# @option plugin [Class] the 'wrapper' module of a plugin, e.g.
|
|
13
13
|
# Dradis::Plugins::Nessus
|
|
14
|
-
def initialize(args={})
|
|
14
|
+
def initialize(args = {})
|
|
15
15
|
@logger = args.fetch(:logger, Rails.logger)
|
|
16
16
|
@plugin = args.fetch(:plugin)
|
|
17
17
|
@project = args[:project]
|
|
@@ -25,14 +25,14 @@ module Dradis::Plugins::ContentService
|
|
|
25
25
|
@default_author ||= "#{plugin::Engine.plugin_name.to_s.humanize} upload plugin"
|
|
26
26
|
end
|
|
27
27
|
|
|
28
|
-
def try_rescue_from_length_validation(args={})
|
|
28
|
+
def try_rescue_from_length_validation(args = {})
|
|
29
29
|
model = args[:model]
|
|
30
30
|
field = args[:field]
|
|
31
31
|
text = args[:text]
|
|
32
32
|
msg = args[:msg]
|
|
33
|
-
tail =
|
|
33
|
+
tail = '...' + args[:tail].to_s
|
|
34
34
|
|
|
35
|
-
logger.error{
|
|
35
|
+
logger.error { 'Trying to rescue from a :length error' }
|
|
36
36
|
|
|
37
37
|
if model.errors[field]
|
|
38
38
|
# the plugin tried to store too much information
|
|
@@ -2,7 +2,7 @@ module Dradis::Plugins::ContentService
|
|
|
2
2
|
module Evidence
|
|
3
3
|
extend ActiveSupport::Concern
|
|
4
4
|
|
|
5
|
-
def create_evidence(args={})
|
|
5
|
+
def create_evidence(args = {})
|
|
6
6
|
content = args.fetch(:content, default_evidence_content)
|
|
7
7
|
node = args.fetch(:node, default_node_parent)
|
|
8
8
|
issue = args[:issue] || default_evidence_issue
|
|
@@ -16,7 +16,7 @@ module Dradis::Plugins::ContentService
|
|
|
16
16
|
issues.where(category_id: default_issue_category.id)
|
|
17
17
|
end
|
|
18
18
|
|
|
19
|
-
def create_issue(args={})
|
|
19
|
+
def create_issue(args = {})
|
|
20
20
|
text = args.fetch(:text, default_issue_text)
|
|
21
21
|
# NOTE that ID is the unique issue identifier assigned by the plugin,
|
|
22
22
|
# and is not to be confused with the Issue#id primary key
|
|
@@ -88,7 +88,6 @@ module Dradis::Plugins::ContentService
|
|
|
88
88
|
end
|
|
89
89
|
end
|
|
90
90
|
|
|
91
|
-
|
|
92
91
|
private
|
|
93
92
|
|
|
94
93
|
def default_issue_category
|
|
@@ -17,7 +17,7 @@ module Dradis::Plugins::ContentService
|
|
|
17
17
|
nodes.sort_by! { |node| node.label.split('.').map(&:to_i) }
|
|
18
18
|
end
|
|
19
19
|
|
|
20
|
-
def create_node(args={})
|
|
20
|
+
def create_node(args = {})
|
|
21
21
|
label = args[:label] || default_node_label
|
|
22
22
|
parent = args[:parent] || default_node_parent
|
|
23
23
|
|
|
@@ -59,7 +59,6 @@ module Dradis::Plugins::ContentService
|
|
|
59
59
|
@default_node_type ||= Node::Types::DEFAULT
|
|
60
60
|
end
|
|
61
61
|
|
|
62
|
-
|
|
63
62
|
# Private: this method returns a list of nodes associated with Evidence
|
|
64
63
|
# instances. When a node is affected by multiple issues, or multiple pieces
|
|
65
64
|
# of evidence, we just want a single reference to it.
|
|
@@ -6,7 +6,7 @@ module Dradis::Plugins::ContentService
|
|
|
6
6
|
project.notes.where(category: Category.report)
|
|
7
7
|
end
|
|
8
8
|
|
|
9
|
-
def create_note(args={})
|
|
9
|
+
def create_note(args = {})
|
|
10
10
|
cat = args.fetch(:category, default_note_category)
|
|
11
11
|
node = args.fetch(:node, default_node_parent)
|
|
12
12
|
text = args.fetch(:text, default_note_text)
|
|
@@ -5,7 +5,7 @@ module Dradis
|
|
|
5
5
|
|
|
6
6
|
config.dradis = ActiveSupport::OrderedOptions.new
|
|
7
7
|
|
|
8
|
-
initializer
|
|
8
|
+
initializer 'dradis-plugins.set_configs' do |app|
|
|
9
9
|
options = app.config.dradis
|
|
10
10
|
options.base_export_controller_class_name ||= 'AuthenticatedController'
|
|
11
11
|
options.thor_helper_module ||= Dradis::Plugins::ThorHelper
|
|
@@ -7,7 +7,7 @@ module Dradis
|
|
|
7
7
|
class Base
|
|
8
8
|
attr_accessor :content_service, :logger, :options, :plugin, :project, :scope
|
|
9
9
|
|
|
10
|
-
def initialize(args={})
|
|
10
|
+
def initialize(args = {})
|
|
11
11
|
# Save everything just in case the implementing class needs any of it.
|
|
12
12
|
@options = args
|
|
13
13
|
|
|
@@ -22,12 +22,12 @@ module Dradis
|
|
|
22
22
|
post_initialize(args)
|
|
23
23
|
end
|
|
24
24
|
|
|
25
|
-
def export(args={})
|
|
25
|
+
def export(args = {})
|
|
26
26
|
raise "The export() method is not implemented in this plugin [#{self.class.name}]."
|
|
27
27
|
end
|
|
28
28
|
|
|
29
29
|
# This method can be overwriten by plugins to do initialization tasks.
|
|
30
|
-
def post_initialize(args={})
|
|
30
|
+
def post_initialize(args = {})
|
|
31
31
|
end
|
|
32
32
|
|
|
33
33
|
private
|
|
@@ -52,7 +52,6 @@ module Dradis
|
|
|
52
52
|
raise "You need to pass a :plugin value to your Exporter or define it under your plugin's root namespace."
|
|
53
53
|
end
|
|
54
54
|
end
|
|
55
|
-
|
|
56
55
|
end # Base
|
|
57
56
|
end # Export
|
|
58
57
|
end # Plugins
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
module Dradis::Plugins::Import
|
|
2
2
|
class Result
|
|
3
|
-
attr_accessor :description, :id, :tags, :title
|
|
3
|
+
attr_accessor :description, :id, :tags, :title, :state
|
|
4
4
|
|
|
5
|
-
def initialize(args={})
|
|
5
|
+
def initialize(args = {})
|
|
6
6
|
@description = args[:description] || "The Import plugin didn't provide a :description for this result."
|
|
7
7
|
@id = args[:id] || "The Import plugin didn't provide an :id for this result."
|
|
8
8
|
@tags = args[:tags] || []
|
|
9
9
|
@title = args[:title] || "The Import plugin didn't provide a :title for this result."
|
|
10
|
+
@state = args[:state] || nil
|
|
10
11
|
end
|
|
11
12
|
end
|
|
12
13
|
end
|
|
@@ -20,7 +20,7 @@ module Dradis::Plugins
|
|
|
20
20
|
value: value = dirty_or_stored_or_default(key.to_sym),
|
|
21
21
|
default: is_default?(key, value)
|
|
22
22
|
}
|
|
23
|
-
end.sort_by{ |o| o[:name] }
|
|
23
|
+
end.sort_by { |o| o[:name] }
|
|
24
24
|
end
|
|
25
25
|
|
|
26
26
|
def save
|
|
@@ -32,7 +32,7 @@ module Dradis::Plugins
|
|
|
32
32
|
end
|
|
33
33
|
|
|
34
34
|
def update_settings(opts = {})
|
|
35
|
-
opts.select{ |k, v| @default_options.key?(k) }.each do |k, v|
|
|
35
|
+
opts.select { |k, v| @default_options.key?(k) }.each do |k, v|
|
|
36
36
|
@dirty_options[k.to_sym] = v
|
|
37
37
|
end
|
|
38
38
|
save
|
data/lib/dradis/plugins/thor.rb
CHANGED
|
@@ -17,9 +17,9 @@ module Dradis
|
|
|
17
17
|
end
|
|
18
18
|
end
|
|
19
19
|
|
|
20
|
-
def plugin_thorfiles(args={})
|
|
20
|
+
def plugin_thorfiles(args = {})
|
|
21
21
|
if paths['dradis/thorfiles'].existent.any?
|
|
22
|
-
Dir[
|
|
22
|
+
Dir['%s/thorfile.rb' % paths['dradis/thorfiles'].existent]
|
|
23
23
|
else
|
|
24
24
|
[]
|
|
25
25
|
end
|
|
@@ -27,4 +27,4 @@ module Dradis
|
|
|
27
27
|
end
|
|
28
28
|
end
|
|
29
29
|
end
|
|
30
|
-
end
|
|
30
|
+
end
|
|
@@ -5,11 +5,10 @@
|
|
|
5
5
|
module Dradis
|
|
6
6
|
module Plugins
|
|
7
7
|
module Upload
|
|
8
|
-
|
|
9
8
|
class FieldProcessor
|
|
10
9
|
attr_reader :data
|
|
11
10
|
|
|
12
|
-
def initialize(args={})
|
|
11
|
+
def initialize(args = {})
|
|
13
12
|
@data = args[:data]
|
|
14
13
|
post_initialize(args)
|
|
15
14
|
end
|
|
@@ -18,18 +17,17 @@ module Dradis
|
|
|
18
17
|
# and extract the value of the requested field.
|
|
19
18
|
#
|
|
20
19
|
# Subclasses will overwrite this method.
|
|
21
|
-
def value(args={})
|
|
20
|
+
def value(args = {})
|
|
22
21
|
field = args[:field]
|
|
23
22
|
"Sorry, this plugin doesn't define a FieldProcessor (called for [#{field}])"
|
|
24
23
|
end
|
|
25
24
|
|
|
26
25
|
protected
|
|
27
26
|
# This can be overriden by subclasses
|
|
28
|
-
def post_initialize(args={})
|
|
27
|
+
def post_initialize(args = {})
|
|
29
28
|
# nop
|
|
30
29
|
end
|
|
31
30
|
end
|
|
32
|
-
|
|
33
31
|
end
|
|
34
32
|
end
|
|
35
33
|
end
|
|
@@ -20,7 +20,7 @@ module Dradis
|
|
|
20
20
|
{ evidence: 'evidence', issue: 'issue' }
|
|
21
21
|
end
|
|
22
22
|
|
|
23
|
-
def initialize(args={})
|
|
23
|
+
def initialize(args = {})
|
|
24
24
|
@options = args
|
|
25
25
|
|
|
26
26
|
@default_user_id = args[:default_user_id] || -1
|
|
@@ -35,12 +35,12 @@ module Dradis
|
|
|
35
35
|
post_initialize(args)
|
|
36
36
|
end
|
|
37
37
|
|
|
38
|
-
def import(args={})
|
|
38
|
+
def import(args = {})
|
|
39
39
|
raise "The import() method is not implemented in this plugin [#{self.class.name}]."
|
|
40
40
|
end
|
|
41
41
|
|
|
42
42
|
# This method can be overwriten by plugins to do initialization tasks.
|
|
43
|
-
def post_initialize(args={})
|
|
43
|
+
def post_initialize(args = {})
|
|
44
44
|
end
|
|
45
45
|
|
|
46
46
|
private
|
|
@@ -81,7 +81,6 @@ module Dradis
|
|
|
81
81
|
)
|
|
82
82
|
end
|
|
83
83
|
end # Importer
|
|
84
|
-
|
|
85
84
|
end # Upload
|
|
86
85
|
end # Plugins
|
|
87
86
|
end # Core
|
data/lib/dradis/plugins.rb
CHANGED
data/spec/settings_spec.rb
CHANGED
|
@@ -18,19 +18,19 @@ describe Dradis::Plugins::Settings do
|
|
|
18
18
|
TestEngine::settings.reset_defaults!
|
|
19
19
|
end
|
|
20
20
|
|
|
21
|
-
it
|
|
21
|
+
it 'sets and return default values' do
|
|
22
22
|
expect(TestEngine::settings.host).to eq('localhost')
|
|
23
23
|
expect(TestEngine::settings.port).to eq(80)
|
|
24
24
|
end
|
|
25
25
|
|
|
26
|
-
it
|
|
26
|
+
it 'sets and returns user defined values' do
|
|
27
27
|
expect(TestEngine::settings.host).to eq('localhost')
|
|
28
28
|
TestEngine::settings.host = '127.0.0.1'
|
|
29
29
|
expect(TestEngine::settings.host).to eq('127.0.0.1')
|
|
30
30
|
expect(TestEngine::settings.port).to eq(80)
|
|
31
31
|
end
|
|
32
32
|
|
|
33
|
-
it
|
|
33
|
+
it 'sets and returns new value even if it equals default value' do
|
|
34
34
|
expect(TestEngine::settings.host).to eq('localhost')
|
|
35
35
|
TestEngine::settings.host = '127.0.0.1'
|
|
36
36
|
expect(TestEngine::settings.host).to eq('127.0.0.1')
|
|
@@ -38,17 +38,17 @@ describe Dradis::Plugins::Settings do
|
|
|
38
38
|
expect(TestEngine::settings.host).to eq('localhost')
|
|
39
39
|
end
|
|
40
40
|
|
|
41
|
-
it
|
|
41
|
+
it 'saves to db and returns persisted values' do
|
|
42
42
|
expect(TestEngine::settings.host).to eq('localhost')
|
|
43
43
|
TestEngine::settings.host = '127.0.0.1'
|
|
44
|
-
expect(TestEngine::settings.save).to eq(
|
|
44
|
+
expect(TestEngine::settings.save).to eq({ host: '127.0.0.1' })
|
|
45
45
|
expect(TestEngine::settings.host).to eq('127.0.0.1')
|
|
46
46
|
end
|
|
47
47
|
|
|
48
|
-
it
|
|
48
|
+
it 'reads from db after saving' do
|
|
49
49
|
expect(TestEngine::settings.host).to eq('localhost')
|
|
50
50
|
TestEngine::settings.host = '127.0.0.1'
|
|
51
|
-
expect(TestEngine::settings.save).to eq(
|
|
51
|
+
expect(TestEngine::settings.save).to eq({ host: '127.0.0.1' })
|
|
52
52
|
end
|
|
53
53
|
|
|
54
54
|
end
|
|
@@ -83,5 +83,3 @@ describe Dradis::Plugins::Settings, '#all' do
|
|
|
83
83
|
])
|
|
84
84
|
end
|
|
85
85
|
end
|
|
86
|
-
|
|
87
|
-
|
metadata
CHANGED
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: dradis-plugins
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 4.
|
|
4
|
+
version: 4.19.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Daniel Martin
|
|
8
|
-
autorequire:
|
|
9
8
|
bindir: bin
|
|
10
9
|
cert_chain: []
|
|
11
|
-
date:
|
|
10
|
+
date: 1980-01-02 00:00:00.000000000 Z
|
|
12
11
|
dependencies:
|
|
13
12
|
- !ruby/object:Gem::Dependency
|
|
14
13
|
name: bundler
|
|
@@ -52,8 +51,21 @@ dependencies:
|
|
|
52
51
|
- - ">="
|
|
53
52
|
- !ruby/object:Gem::Version
|
|
54
53
|
version: '0'
|
|
54
|
+
- !ruby/object:Gem::Dependency
|
|
55
|
+
name: rubocop
|
|
56
|
+
requirement: !ruby/object:Gem::Requirement
|
|
57
|
+
requirements:
|
|
58
|
+
- - '='
|
|
59
|
+
- !ruby/object:Gem::Version
|
|
60
|
+
version: 1.79.0
|
|
61
|
+
type: :development
|
|
62
|
+
prerelease: false
|
|
63
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
64
|
+
requirements:
|
|
65
|
+
- - '='
|
|
66
|
+
- !ruby/object:Gem::Version
|
|
67
|
+
version: 1.79.0
|
|
55
68
|
description: Required dependency for Dradis Framework.
|
|
56
|
-
email:
|
|
57
69
|
executables: []
|
|
58
70
|
extensions: []
|
|
59
71
|
extra_rdoc_files: []
|
|
@@ -61,6 +73,7 @@ files:
|
|
|
61
73
|
- ".github/pull_request_template.md"
|
|
62
74
|
- ".gitignore"
|
|
63
75
|
- ".rspec"
|
|
76
|
+
- ".rubocop.yml"
|
|
64
77
|
- CHANGELOG.md
|
|
65
78
|
- CHANGELOG.template
|
|
66
79
|
- CONTRIBUTING.md
|
|
@@ -123,7 +136,6 @@ homepage: http://dradis.com/ce/
|
|
|
123
136
|
licenses:
|
|
124
137
|
- GPL-2
|
|
125
138
|
metadata: {}
|
|
126
|
-
post_install_message:
|
|
127
139
|
rdoc_options: []
|
|
128
140
|
require_paths:
|
|
129
141
|
- lib
|
|
@@ -138,8 +150,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
138
150
|
- !ruby/object:Gem::Version
|
|
139
151
|
version: '0'
|
|
140
152
|
requirements: []
|
|
141
|
-
rubygems_version: 3.
|
|
142
|
-
signing_key:
|
|
153
|
+
rubygems_version: 3.6.9
|
|
143
154
|
specification_version: 4
|
|
144
155
|
summary: Plugin manager for the Dradis Framework project.
|
|
145
156
|
test_files:
|