Class: Detroit::LOCat
- Inherits:
-
Tool
- Object
- Tool
- Detroit::LOCat
- Includes:
- Standard
- Defined in:
- lib/detroit-locat.rb
Overview
LOCat is tool for generating LOC statistics.
This tool targets the following stations of the standard toolchain:
-
generate
Constant Summary collapse
- MANPAGE =
Location of manpage for this tool.
File.dirname(__FILE__) + '/../man/detroit-locat.5'
Instance Attribute Summary collapse
-
#config ⇒ Object
List of config files to use.
-
#exclude ⇒ Object
Exclude subpaths from ‘path`.
-
#format ⇒ Object
Output format cane be html, json or yaml.
-
#ignore ⇒ Object
Exclude subpaths from ‘path` by matching basename.
-
#output ⇒ Object
File to generate.
-
#path ⇒ Object
Limit paths of files to render.
-
#title ⇒ Object
Title to place at top of report.
Instance Method Summary collapse
-
#assemble?(station, options = {}) ⇒ Boolean
This tool ties into the ‘generate` station of the standard assembly.
-
#generate ⇒ Object
Render templates.
- #prerequisite ⇒ Object
Instance Attribute Details
#config ⇒ Object
List of config files to use.
46 47 48 |
# File 'lib/detroit-locat.rb', line 46 def config @config end |
#exclude ⇒ Object
Exclude subpaths from ‘path`.
40 41 42 |
# File 'lib/detroit-locat.rb', line 40 def exclude @exclude end |
#format ⇒ Object
Output format cane be html, json or yaml. By default the format will be determined by the ‘output` file extension.
50 51 52 |
# File 'lib/detroit-locat.rb', line 50 def format @format end |
#ignore ⇒ Object
Exclude subpaths from ‘path` by matching basename.
43 44 45 |
# File 'lib/detroit-locat.rb', line 43 def ignore @ignore end |
#output ⇒ Object
File to generate.
56 57 58 |
# File 'lib/detroit-locat.rb', line 56 def output @output end |
#path ⇒ Object
Limit paths of files to render.
31 32 33 |
# File 'lib/detroit-locat.rb', line 31 def path @path end |
#title ⇒ Object
Title to place at top of report.
53 54 55 |
# File 'lib/detroit-locat.rb', line 53 def title @title end |
Instance Method Details
#assemble?(station, options = {}) ⇒ Boolean
This tool ties into the ‘generate` station of the standard assembly.
79 80 81 82 |
# File 'lib/detroit-locat.rb', line 79 def assemble?(station, ={}) return true if station == :generate return false end |
#generate ⇒ Object
Render templates.
61 62 63 64 65 66 67 68 69 70 71 72 73 |
# File 'lib/detroit-locat.rb', line 61 def generate = {} [:title] = title if title [:format] = format if format [:output] = output if output [:config] = config if config [:files] = collect_files locat = ::LOCat::Command.new() locat.run end |
#prerequisite ⇒ Object
25 26 27 28 |
# File 'lib/detroit-locat.rb', line 25 def prerequisite require 'locat' @path = 'lib' end |