class Detroit::LOCat

LOCat is tool for generating LOC statistics.

This tool targets the following stations of the standard toolchain:

Constants

MANPAGE

Location of manpage for this tool.

Attributes

config[RW]

List of config files to use.

exclude[RW]

Exclude subpaths from ‘path`.

format[RW]

Output format cane be html, json or yaml. By default the format will be determined by the ‘output` file extension.

ignore[RW]

Exclude subpaths from ‘path` by matching basename.

output[RW]

File to generate.

path[RW]

Limit paths of files to render.

title[RW]

Title to place at top of report.

Public Instance Methods

assemble?(station, options={}) click to toggle source

This tool ties into the ‘generate` station of the standard assembly.

@return [Boolean]

# File lib/detroit-locat.rb, line 79
def assemble?(station, options={})
  return true if station == :generate
  return false
end
generate() click to toggle source

Render templates.

# File lib/detroit-locat.rb, line 61
def generate
  options = {}
  options[:title]  = title  if title
  options[:format] = format if format
  options[:output] = output if output
  options[:config] = config if config

  options[:files]  = collect_files

  locat = ::LOCat::Command.new(options)

  locat.run
end
prerequisite() click to toggle source
# File lib/detroit-locat.rb, line 25
def prerequisite
  require 'locat'
  @path = 'lib'
end

Private Instance Methods

collect_files() click to toggle source
# File lib/detroit-locat.rb, line 87
def collect_files
  f = [path].flatten.compact
  x = [exclude].flatten.compact
  i = [ignore].flatten.compact
  amass(f, x, i)
end