Skip to content
Snippets Groups Projects
Commit d17491bd authored by Markus Reiter's avatar Markus Reiter
Browse files

Document `Shebang`.

parent 1359f2e3
No related branches found
No related tags found
No related merge requests found
......@@ -22,7 +22,6 @@ Style/Documentation:
- 'utils/gems.rb'
- 'utils/notability.rb'
- 'utils/popen.rb'
- 'utils/shebang.rb'
- 'utils/shell.rb'
- 'utils/livecheck_formula.rb'
- 'version.rb'
# frozen_string_literal: true
module Utils
# Helper functions for manipulating shebang lines.
#
# @api private
module Shebang
module_function
# Specification on how to rewrite a given shebang.
#
# @api private
class RewriteInfo
attr_reader :regex, :max_length, :replacement
......@@ -14,6 +20,12 @@ module Utils
end
end
# Rewrite shebang for the given `paths` using the given `rewrite_info`.
#
# @example
# rewrite_shebang detected_python_shebang, bin/"script.py"
#
# @api public
def rewrite_shebang(rewrite_info, *paths)
paths.each do |f|
f = Pathname(f)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment