class Fingerprint::Command::Analyze

Public Instance Methods

call() click to toggle source
# File lib/fingerprint/command/analyze.rb, line 50
def call
        output_file = @options[:name]

        if File.exist?(output_file) and !@options[:force]
                abort "Output file #{output_file} already exists. Aborting."
        end

        options = @options.dup
        options[:excludes] = [File.expand_path(options[:name], Dir.pwd)]

        finished = false
        begin
                File.open(output_file, "w") do |io|
                        options[:output] = io

                        Scanner.scan_paths(@paths, **options)
                end
                finished = true
        ensure
                FileUtils.rm(output_file) unless finished
        end 
end