class Preek::CLI

whoop whoop

Public Instance Methods

git() click to toggle source
# File lib/preek/cli.rb, line 40
def git
  args = git_status.scan(/[ M?]{2} (.*\.rb)/).flatten
  smell *args unless args.empty?
end
smell(*files) click to toggle source
# File lib/preek/cli.rb, line 35
def smell(*files)
  Examiner.new(files, excludes, reporter: reporter, output: output).perform
end
version(*) click to toggle source
# File lib/preek/cli.rb, line 13
def version(*)
  say VERSION
end

Private Instance Methods

_aliases() click to toggle source
# File lib/preek/cli.rb, line 59
def _aliases
  {
    irresponsible: 'IrresponsibleModule'
  }
end
exclude_list() click to toggle source
# File lib/preek/cli.rb, line 73
def exclude_list
  %w(IrresponsibleModule)
end
excludes() click to toggle source
# File lib/preek/cli.rb, line 69
def excludes
  (exclude_list - includes)
end
git_status() click to toggle source
# File lib/preek/cli.rb, line 47
def git_status
  `git status -s`
end
includes() click to toggle source
# File lib/preek/cli.rb, line 65
def includes
  options.keys.map {|key| _aliases[key.to_sym] }
end
output() click to toggle source
# File lib/preek/cli.rb, line 55
def output
  options[:compact] ? CompactOutput : Output
end
reporter() click to toggle source
# File lib/preek/cli.rb, line 51
def reporter
  options[:verbose] ? VerboseReport : QuietReport
end