Sha256: 3c69083a353fbd06c54731b9b618c7d79d888ab539e7b70d78a40905b5610899

Contents?: true

Size: 820 Bytes

Versions: 2

Compression:

Stored size: 820 Bytes

Contents

module Brakefast
  module Detector
    class ControllerWarnings < Base
      register_detector :controller_warnings

      def set_detector_module
        if target_module_name && target_method_name
          mod = Module.new
          mod.module_eval %Q{
            def #{target_method_name}
              s = "vulnerability found in #{file}:#{line} - #{message}"
              Thread.current[:brakefast_notifications] << s
=begin
              # for debug
              File.open("/tmp/1.log", "a") do |f|
                f.write("vulnerability found in #{e.file}:#{e.line} - #{msg}")
              end
=end
              super
            end
          }

          create_hook(target_module_name, mod)
        end
      end

      def target_module_name
        vulnerability.controller
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
brakefast-0.0.2 lib/brakefast/detector/controller_warnings.rb
brakefast-0.0.1 lib/brakefast/detector/controller_warnings.rb