Skip to content

Commit 1e0d735

Browse files
author
Kevin Paulisse
committed
Add some more comments to the scriptrunner
1 parent c2819c4 commit 1e0d735

1 file changed

Lines changed: 10 additions & 1 deletion

File tree

lib/octocatalog-diff/util/scriptrunner.rb

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,13 @@ def run(opts = {})
3737

3838
private
3939

40-
def find_script(default_script, override_script_path)
40+
# PRIVATE: Determine the path to the script to execute, taking into account the default script
41+
# location and the optional override script path.
42+
#
43+
# @param default_script [String] Path to script, relative to `scripts` directory
44+
# @param override_script_path [String] Optional directory with override script
45+
# @return [String] Full path to script
46+
def find_script(default_script, override_script_path = nil)
4147
if override_script_path
4248
script_test = File.join(override_script_path, File.basename(default_script))
4349
if File.file?(script_test)
@@ -54,6 +60,9 @@ def find_script(default_script, override_script_path)
5460
raise Errno::ENOENT, "Unable to locate default script '#{default_script}'"
5561
end
5662

63+
# PRIVATE: Assert that a directory exists (and is a directory). Raise error if not.
64+
#
65+
# @param dir [String] Directory to test
5766
def assert_directory_exists(dir)
5867
return if File.directory?(dir)
5968
raise Errno::ENOENT, "Invalid directory '#{dir}'"

0 commit comments

Comments
 (0)