Sha256: f6ac0d9232546163fa2be2d394baf9ceab92bd5236c7912767c4bcb7272029df

Contents?: true

Size: 566 Bytes

Versions: 3

Compression:

Stored size: 566 Bytes

Contents

require 'reek/sniffer'

module Reek

  class ReekCommand

    def initialize(sources, report_class, show_all)
      @sniffer = sources.length > 0 ? sources.sniff : sniff_stdin
      @report_class = report_class
      @show_all = show_all
    end

    def sniff_stdin
      Reek::Sniffer.new($stdin.to_reek_source('$stdin'))
    end

    def execute(view)
      rpt = @report_class.new(@sniffer.sniffers, @show_all)
      view.output(rpt.report)
      if @sniffer.smelly?
        view.report_smells
      else
        view.report_success
      end
    end
  end

end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
reek-1.2.6 lib/reek/reek_command.rb
reek-1.2.5 lib/reek/reek_command.rb
reek-1.2.4 lib/reek/reek_command.rb