Sha256: 143aceb4b3d931cf364e8194b14f53f96f3469bf03a7d2432173cf012d6da563

Contents?: true

Size: 689 Bytes

Versions: 2

Compression:

Stored size: 689 Bytes

Contents

# -*- encoding : utf-8 -*-

require "redis_scanner/version"
require "redis_scanner/rule"
require "redis_scanner/pattern"
require "redis_scanner/redis"
require "redis_scanner/engine"
require "redis_scanner/formatter"
require "redis"

module RedisScanner
  def self.scan(options)
    redis = Redis.new options
    engine = Engine.new redis, options
    patterns = engine.run
    output_result(patterns, options)
  end

  def self.output_result(patterns, options)
    formatter = Formatter.new(options)
    result = formatter.format patterns
    if options[:file]
      File.open(options[:file], "w") do |file|
        file.puts result
      end
    else
      puts result
    end
  end

end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
redis_scanner-0.1.6 lib/redis_scanner.rb
redis_scanner-0.1.5 lib/redis_scanner.rb