Sha256: 27f63cfca12bbb38c204dfe35bf660982af9093808a7dc3868b9ce18c1ee0a5e

Contents?: true

Size: 682 Bytes

Versions: 1

Compression:

Stored size: 682 Bytes

Contents

require 'thor'
require 'fukuzatsu'

module Fukuzatsu

  class CLI < Thor

    desc_text = "Formats are text (default, to STDOUT), html, and csv. "
    desc_text << "Example: fuku check foo/ -f html"

    desc "check PATH_TO_FILE [-f FORMAT] [-t MAX_COMPLEXITY_ALLOWED]", desc_text
    method_option :format, :type => :string, :default => 'text', :aliases => "-f"
    method_option :threshold, :type => :numeric, :default => 0, :aliases => "-t"

    def check(path="./")
      Fukuzatsu.new(path, formatter, options['threshold']).report
    end

    default_task :check

    private

    def formatter
      options['format'] && options['format'].to_sym || :text
    end

  end

end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
fukuzatsu-2.1.1 lib/fukuzatsu/cli.rb