module
Hansa::Shebang
Overview
Content-based shebang detection, ported from go-enry v2's GetLanguagesByShebang strategy. When the interpreter maps to a single language the shebang is considered decisive; when it maps to several (perl -> Perl/Pod, lua -> Lua/Terra) they are handed to the classifier as candidates.
Defined in:
shebang.crConstant Summary
-
ENV_OPT_ARGS =
/-[i0uCSv]*|--\S+/ -
ENV_VAR_ARGS =
/\S+=\S+/ -
PYTHON_VERSION =
/python\d\.\d+/ -
SHEBANG_EXEC_HACK =
/exec (\w+).+\$0.+\$@/
Class Method Summary
-
.interpreter(content : String) : String
Returns the interpreter named by the shebang line, handling /usr/bin/env indirection and the special cases documented in go-enry's getInterpreter.
- .languages(content : String) : Array(String)
Class Method Detail
def self.interpreter(content : String) : String
#
Returns the interpreter named by the shebang line, handling /usr/bin/env indirection and the special cases documented in go-enry's getInterpreter.