class Linguist::Strategy::Manpage
- Linguist::Strategy::Manpage
- Reference
- Object
Overview
Detects man pages based on numeric file extensions with group suffixes.
Defined in:
linguist/strategy/manpage.crConstant Summary
-
MANPAGE_EXTS =
/\.(?:[1-9](?![0-9])[a-z_0-9]*|0p|n|man|mdoc)(?:\.in)?$/i
-
Public: RegExp for matching conventional manpage extensions
This is the same expression as that used by
github/markup
Class Method Summary
-
.call(blob, candidates = [] of Language, real_languages = LanguageContainer.new)
Public: Use the file extension to match a possible man page, only if no other candidates were previously identified.
Class Method Detail
Public: Use the file extension to match a possible man page, only if no other candidates were previously identified.
blob - An object that quacks like a blob. candidates - A list of candidate languages.
Examples
Manpage.call(FileBlob.new("path/to/file"))
Returns:
- The list of candidates if it wasn't empty
- An array of ["Roff", "Roff Manpage"] if the file's extension matches a valid-looking man(1) section
- An empty Array for anything else