cms_scanner 0.0.39.1 → 0.0.39.2

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: c506e545bbc520583708c6c0f1fb9bbbe123f4ec
4
- data.tar.gz: 8fcdb2761bdd345469fb69f9c4b6c081e562ecc6
3
+ metadata.gz: 8001dc7d354d305031e7a7bae7ca2ca3452303d9
4
+ data.tar.gz: 43d6f7ddc39542d5f769871c02d76efd23ef2a7c
5
5
  SHA512:
6
- metadata.gz: 69ce15c63489b1c55d98c2f3440c28ac8c699f9c0a666d1749a954b3f3e02faa820c2956f7dfdf648fb9e7b43c38ac39d650ea3cfe62aeb997cf5db1fd5e7cba
7
- data.tar.gz: 1418729d154f6f7e83998f29660fe88f855840aa4bf79885ebbdd8b62cc99a67166c2518244bd80ce212341b0e30aa8fe6c1f5702296f8f75057ecbe43222436
6
+ metadata.gz: 967008cf977097b24c50dc6a8eda40a5e2f3c27ddea51b8c2d9c8ff03135f863e1462c262d4364a85215a59d659c68610ff335ec3e95ccbe993483537f7fe9fb
7
+ data.tar.gz: 94825ea1751ed4bbeaf6c5a68c48076104b02de6635e07b6f18be6a1a06dcc4a60983235b572ec9e0137e6922cad07b758e7deeadafc77f54911a99c98feab14
@@ -5,6 +5,7 @@ require 'yajl/json_gem'
5
5
  require 'public_suffix'
6
6
  require 'addressable/uri'
7
7
  require 'ruby-progressbar'
8
+ require 'ruby-progressbar/outputs/null'
8
9
  require 'opt_parse_validator'
9
10
  require 'active_support/concern'
10
11
  require 'active_support/inflector'
@@ -1,4 +1,3 @@
1
- require 'cms_scanner/mocked_progress_bar'
2
1
  require 'cms_scanner/finders/finder/smart_url_checker'
3
2
  require 'cms_scanner/finders/finder/enumerator'
4
3
  require 'cms_scanner/finders/finder/fingerprinter'
@@ -30,11 +29,12 @@ module CMSScanner
30
29
  # @param [ Hash ] opts See https://github.com/jfelchner/ruby-progressbar/wiki/Options
31
30
  # @option opts [ Boolean ] :show_progression
32
31
  #
33
- # @return [ ProgressBar::Base, CMSScanner::MockedProgressBar ]
32
+ # @return [ ProgressBar::Base ]
34
33
  def create_progress_bar(opts = {})
35
- klass = opts[:show_progression] ? ProgressBar : MockedProgressBar
34
+ bar_opts = { format: '%t %a <%B> (%c / %C) %P%% %e' }
35
+ bar_opts[:output] = ProgressBar::Outputs::Null unless opts[:show_progression]
36
36
 
37
- @progress_bar = klass.create({ format: '%t %a <%B> (%c / %C) %P%% %e' }.merge(opts))
37
+ @progress_bar = ProgressBar.create(bar_opts.merge(opts))
38
38
  end
39
39
 
40
40
  # @return [ Browser ]
@@ -4,7 +4,7 @@ module CMSScanner
4
4
  # and beautify it a the end of the scan
5
5
  module Buffer
6
6
  def output(tpl, vars = {}, controller_name = nil)
7
- buffer << render(tpl, vars, controller_name)
7
+ buffer << render(tpl, vars, controller_name).encode('UTF-8', invalid: :replace, undef: :replace)
8
8
  end
9
9
 
10
10
  def buffer
@@ -1,4 +1,4 @@
1
1
  # Version
2
2
  module CMSScanner
3
- VERSION = '0.0.39.1'.freeze
3
+ VERSION = '0.0.39.2'.freeze
4
4
  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.39.1
4
+ version: 0.0.39.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - WPScanTeam
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-03-04 00:00:00.000000000 Z
11
+ date: 2018-05-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: nokogiri
@@ -332,7 +332,6 @@ files:
332
332
  - lib/cms_scanner/formatter.rb
333
333
  - lib/cms_scanner/formatter/buffer.rb
334
334
  - lib/cms_scanner/helper.rb
335
- - lib/cms_scanner/mocked_progress_bar.rb
336
335
  - lib/cms_scanner/numeric.rb
337
336
  - lib/cms_scanner/public_suffix/domain.rb
338
337
  - lib/cms_scanner/references.rb
@@ -1,36 +0,0 @@
1
- module CMSScanner
2
- # ProgressBar to be used in formatter w/o user_interaction such as
3
- # JSON etc, to still be able to have a log of messages to output.
4
- # The object must implement the methods in ruby-progressbar
5
- # and used in CMSScanner, See https://github.com/jfelchner/ruby-progressbar
6
- class MockedProgressBar
7
- attr_reader :increment, :finish
8
-
9
- def self.create(opts = {})
10
- new(opts)
11
- end
12
-
13
- def initialize(_opts = {}); end
14
-
15
- # @return [ Integer ]
16
- def total
17
- 0
18
- end
19
-
20
- def total=(_total); end
21
-
22
- # @return [ Array<String> ]
23
- def logs
24
- @logs ||= []
25
- end
26
-
27
- # @param [ String, nil ] message
28
- #
29
- # @return [ Mixed ]
30
- def log(message = nil)
31
- return logs unless message
32
-
33
- logs << message
34
- end
35
- end
36
- end