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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 0866fc4bfc65ce2c0b92ac2b4d8b0e6d412f0f4e
4
- data.tar.gz: d1a849df9cfb4d7e2efb41bf836b62df007e02b8
3
+ metadata.gz: aac165e869ae94f8a2cb8bd95e8107a36285f0e8
4
+ data.tar.gz: 3743606bde96d403842d7e300d963a61338d8bf2
5
5
  SHA512:
6
- metadata.gz: 6351f6c0f03e6c4a7983933c723a9f479cc1b9a39d5ff4683930f9bb91b1c6f9b4f087b0ffaa5e193c7fcbfb00bb41317884cd9da25d062d0df4604e416c8e15
7
- data.tar.gz: 40fa45e9e46359b1f9b5c818ed470213fe7434c73fdbf93eeed173ea27c5c0f8a3ef589f7c61c510cb6c90ae7da19568947a2d571a5723695dadb32a3a5ed00d
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
@@ -1,4 +1,4 @@
1
1
  # Version
2
2
  module CMSScanner
3
- VERSION = '0.0.7'
3
+ VERSION = '0.0.8'
4
4
  end
@@ -1,6 +1,6 @@
1
1
  require 'spec_helper'
2
2
 
3
- # Module included the CMSScanner to test its correct inclusion
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) { described_class.new }
18
- let(:controller) { SubScanner::Controller }
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?(:new_method)).to eq true
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.7
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-16 00:00:00.000000000 Z
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