@@ -126,41 +126,43 @@ class ProcessBuilder {
126126
127127 // / DIRECTIVES
128128
129- void accelerator ( Map params , value ) {
129+ void accelerator ( Map params , value ) {
130130 if ( value instanceof Number ) {
131131 if ( params. limit== null )
132132 params. limit= value
133133 else if ( params. request== null )
134134 params. request= value
135135 }
136- else if ( value != null )
136+ else if ( value != null ) {
137137 throw new IllegalArgumentException (" Not a valid `accelerator` directive value: $value [${ value.getClass().getName()} ]" )
138+ }
138139 accelerator(params)
139140 }
140141
141142 void accelerator ( value ) {
142143 if ( value instanceof Number )
143144 config. put(' accelerator' , [limit : value])
144- else if ( value instanceof Map )
145+ else if ( value instanceof Map || value instanceof Closure )
145146 config. put(' accelerator' , value)
146147 else if ( value != null )
147148 throw new IllegalArgumentException (" Not a valid `accelerator` directive value: $value [${ value.getClass().getName()} ]" )
148149 }
149150
150- void arch ( Map params , value ) {
151+ void arch ( Map params , value ) {
151152 if ( value instanceof String ) {
152153 if ( params. name== null )
153154 params. name= value
154155 }
155- else if ( value != null )
156+ else if ( value != null ) {
156157 throw new IllegalArgumentException (" Not a valid `arch` directive value: $value [${ value.getClass().getName()} ]" )
158+ }
157159 arch(params)
158160 }
159161
160162 void arch ( value ) {
161163 if ( value instanceof String )
162164 config. put(' arch' , [name : value])
163- else if ( value instanceof Map )
165+ else if ( value instanceof Map || value instanceof Closure )
164166 config. put(' arch' , value)
165167 else if ( value != null )
166168 throw new IllegalArgumentException (" Not a valid `arch` directive value: $value [${ value.getClass().getName()} ]" )
@@ -178,7 +180,7 @@ class ProcessBuilder {
178180 * @param opts
179181 * @param value
180182 */
181- void disk ( Map opts , value ) {
183+ void disk ( Map opts , value ) {
182184 opts. request = value
183185 disk(opts)
184186 }
@@ -327,10 +329,10 @@ class ProcessBuilder {
327329 *
328330 * publishDir '/some/dir', mode: 'copy'
329331 *
330- * @param params
331- * @param path
332+ * @param params map of publish options
333+ * @param path String | Closure<String>
332334 */
333- void publishDir (Map params , CharSequence path ) {
335+ void publishDir (Map params , path ) {
334336 params. put(' path' , path)
335337 publishDir( params )
336338 }
0 commit comments