Add Task#[]

This commit is contained in:
josh committed 2022-01-30 13:11:47 -05:00
1 parent f2a56f1c61
commit ac0f6087fc
3 files changed
+44

No files matched your search

+15
View File
@@ -131,6 +131,21 @@ module Rscons
modify(options, &block)
end
# Get a parameter's value.
#
# @param param_name [String]
# Parameter name.
#
# @return [String]
# Parameter value.
def [](param_name)
param = @params[param_name]
unless param
raise RsconsError.new("Could not find parameter '#{param_name}'")
end
param.value
end
# Execute a task's actions.
#
# @return [void]