Add specs for tasks

This commit is contained in:
josh committed 2022-01-26 23:36:43 -05:00
1 parent c3121f17cf
commit d11981d4b2
5 files changed
+99 -4

No files matched your search

+1 -1
View File
@@ -31,7 +31,7 @@ module Rscons
while argv.size > 0
if argv[0].start_with?("-")
valid_arg = false
if argv[0] =~ /^--(\S+?)(?:=(.*))$/
if argv[0] =~ /^--(\S+?)(?:=(.*))?$/
param_name, value = $1, $2
if param = Task[task].params[param_name]
param.value = value || argv[0]
+5 -2
View File
@@ -339,8 +339,11 @@ module Rscons
# Perform configure action.
def configure(configure_op)
cdsl = ConfigureDsl.new(self, configure_op)
Task["configure"].actions.each do |action|
cdsl.instance_eval(&action)
configure_task = Task["configure"]
configure_task.actions.each do |action|
cdsl.instance_eval do
action[configure_task, configure_task.param_values]
end
end
end
+13 -1
View File
@@ -146,7 +146,7 @@ module Rscons
Rscons.application.configure
else
@actions.each do |action|
action[]
action[self, param_values]
end
end
end
@@ -200,6 +200,18 @@ module Rscons
end
end
# Get parameter values as a Hash.
#
# @return [Hash]
# Parameter values.
def param_values
param_values = {}
@params.each do |name, param|
param_values[name] = param.value
end
param_values
end
end
end