cms_scanner 0.0.7 → 0.0.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/cms_scanner/formatter.rb +12 -0
- data/lib/cms_scanner/version.rb +1 -1
- data/spec/lib/sub_scanner_spec.rb +22 -4
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: aac165e869ae94f8a2cb8bd95e8107a36285f0e8
|
4
|
+
data.tar.gz: 3743606bde96d403842d7e300d963a61338d8bf2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fff92236db3a3b7ce157f97e84d693918de1554fba25d7421b83b6dcdbe2d54c3ecf23d9605671ea8f07b255b3292f4d441ba6ff5efca110c4648548e72d918b
|
7
|
+
data.tar.gz: c66dbaa122048b7334f7f1310ad017cadbbc62cf01c53d1325c41b756867b485e6eb7f0ea5f6460c2a8118ae800fe979badcea6c2614a1452d856c7ecc81d92f
|
@@ -37,10 +37,22 @@ module CMSScanner
|
|
37
37
|
base.extend(ClassMethods)
|
38
38
|
end
|
39
39
|
|
40
|
+
# This module should be implemented in the code which uses this Framework to
|
41
|
+
# be able to override/implements instance methods for all the Formatters
|
42
|
+
# w/o having to include/write the methods in each formatters.
|
43
|
+
#
|
44
|
+
# Example: to override the #views_directories (see the wpscan-v3/lib/wpscan/formatter.rb)
|
45
|
+
module InstanceMethods
|
46
|
+
end
|
47
|
+
|
40
48
|
# Base Formatter
|
41
49
|
class Base
|
42
50
|
attr_reader :controller_name
|
43
51
|
|
52
|
+
def initialize
|
53
|
+
extend NS::Formatter::InstanceMethods
|
54
|
+
end
|
55
|
+
|
44
56
|
# @return [ String ] The underscored name of the class
|
45
57
|
def format
|
46
58
|
self.class.name.demodulize.underscore
|
data/lib/cms_scanner/version.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
require 'spec_helper'
|
2
2
|
|
3
|
-
# Module
|
3
|
+
# Module including the CMSScanner to test its correct inclusion
|
4
4
|
module SubScanner
|
5
5
|
include CMSScanner
|
6
6
|
|
@@ -11,17 +11,35 @@ module SubScanner
|
|
11
11
|
'working'
|
12
12
|
end
|
13
13
|
end
|
14
|
+
|
15
|
+
# Custom method for all formatters
|
16
|
+
module Formatter
|
17
|
+
include CMSScanner::Formatter
|
18
|
+
|
19
|
+
# Implements a #custom method which should be available in all formatters
|
20
|
+
module InstanceMethods
|
21
|
+
def custom
|
22
|
+
'It Works!'
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
14
26
|
end
|
15
27
|
|
16
28
|
describe SubScanner::Scan do
|
17
|
-
subject(:scanner)
|
18
|
-
let(:
|
29
|
+
subject(:scanner) { described_class.new }
|
30
|
+
let(:formatter_class) { SubScanner::Formatter }
|
19
31
|
|
20
32
|
it 'loads the overrided Target class' do
|
21
33
|
target = scanner.controllers.first.target
|
22
34
|
|
23
35
|
expect(target).to be_a SubScanner::Target
|
24
|
-
expect(target.respond_to
|
36
|
+
expect(target).to respond_to(:new_method)
|
25
37
|
expect(target.new_method).to eq 'working'
|
26
38
|
end
|
39
|
+
|
40
|
+
it 'adds the #custom method for all formatters' do
|
41
|
+
formatter_class.availables.each do |format|
|
42
|
+
expect(formatter_class.load(format).custom).to eql 'It Works!'
|
43
|
+
end
|
44
|
+
end
|
27
45
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cms_scanner
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- WPScanTeam - Erwan Le Rousseau
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-12-
|
11
|
+
date: 2014-12-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: opt_parse_validator
|