3030# only recognize a select set of keys and raise an exception when other keys
3131# are used.
3232#
33- # ==Methods of BoutiquesSupport::BoutiquesDescriptor (which inherits from RestrictedHash)
33+ # ==Methods of +BoutiquesSupport::BoutiquesDescriptor+
34+ # which inherits from RestrictedHash
3435#
3536# ===Creation methods:
3637#
4748# desc.name = 'SuperTool' # set the name
4849# toolname = desc.name # gets the name
4950# ver = desc.tool_version # gets 'tool-version'
50- # inputs = desc.inputs # array of BoutiquesSupport::Input objects
51+ # inputs = desc.inputs # array of + BoutiquesSupport::Input+ objects
5152# custom = desc.custom # 'custom' object within descriptor
5253#
53- # The same conventions apply to Boutiques::Input, Boutiques::OutputFile
54- # and Boutiques::Group. See the schema of a Boutiques descriptor for the
55- # list of allowed attributes in each object.
54+ # The same conventions apply to
55+ # +BoutiquesSupport::Input+,
56+ # +BoutiquesSupport::OutputFile+
57+ # and +BoutiquesSupport::Group+.
58+ # See the schema of a Boutiques descriptor for the list of allowed attributes
59+ # in each object.
5660#
5761# Other utility methods are documented in the source code but might not
5862# appear in RDOC-generated documentation. Among these, many are
6165# A number of BoutiquesDescriptor methods provide access to 'custom',
6266# {CBRAIN-specific properties}[../../public/doc/cbrain_boutiques_extensions/cbrain_properties.txt]
6367# of a descriptor. Such methods start with +custom+ prefix. It is strongly recommended to use these
64- # methods rather than via hash .
68+ # methods rather than via +custom+ methods attributes .
6569# We details these and few other utility methods below
6670module BoutiquesSupport
6771
6872 Revision_info = CbrainFileRevision [ __FILE__ ] #:nodoc:
6973
7074 # Descriptor schema
7175 # = class BoutiquesDescriptor
72- # is a closure in this context , and thus can accesses both schema and data extracted using it
76+ # is a closure in this module , and thus can access both schema and data extracted using it
7377 SCHEMA_FILE = "#{ Rails . root . to_s } /lib/cbrain_task_generators/schemas/boutiques.schema.json"
7478
7579 # Attention! below we define anonymous class BoutiquesDescriptor
@@ -108,7 +112,6 @@ module BoutiquesSupport
108112 # :section: Getter methods of BoutiquesDescriptor for CBRAIN specific properties of the descriptor custom section
109113
110114 # :method: custom_module_info
111- # Returns the entry for a custom Boutiques integration module
112115 # Given a module name, returns the structure with the
113116 # data for it stored under the "custom"['cbrain:integrator_modules']
114117 # entry of the descriptor.
@@ -178,8 +181,8 @@ module BoutiquesSupport
178181 # :section: Getter methods of BoutiquesDescriptor for CBRAIN specific properties of the descriptor custom section
179182
180183 # :method: custom_inherits_from_class
181- # An advanced feature for seasoned CBRAIN experts only. That allows
182- # overwrite the standard task behavior with custom class
184+ # An advanced feature for seasoned CBRAIN experts only, that allows
185+ # overwrite the standard task behavior with custom class.
183186 # An example of property definition in a tool descriptor:
184187 # "custom: {
185188 # "cbrain:inherits-from-class": "MyClassName"
@@ -190,10 +193,11 @@ module BoutiquesSupport
190193 # :section: Getter methods of BoutiquesDescriptor for CBRAIN specific properties of the descriptor custom section
191194
192195 # :method: custom_can_submit_new_tasks
196+ # (Experimental)
193197 # A method of BoutiquesDescriptor.Returns Boutiques CBRAIN custom property indicating
194198 # are forking sub-task(s) allowed. To submit a subtask, a task must create a JSON file
195199 # named ".new-task-*.json" at the root of its
196- # work directory
200+ # work directory.
197201 # An example of property definition in a tool descriptor:
198202 # "custom: {
199203 # "cbrain:can-submit-new-tasks": true
@@ -228,7 +232,7 @@ module BoutiquesSupport
228232
229233 # :method: custom_save_back_inputs
230234 # Returns Boutiques CBRAIN custom property indicating
231- # inputs which are saved back to the dataprovider (the original data will be mutated)
235+ # inputs which are saved back to the dataprovider (the original data will be mutated).
232236 # An example of property definition in a tool descriptor:
233237 # "custom: {
234238 # "cbrain:save_back_inputs": [id_1, id_2, id_3 ...]
@@ -239,7 +243,7 @@ module BoutiquesSupport
239243
240244 # :method: custom_readonly_input_files
241245 # Returns Boutiques CBRAIN custom property indicating
242- # if the tool cannot modify inputs
246+ # that the tool does not modify inputs.
243247 # An example of property definition in a tool descriptor:
244248 # "custom: {
245249 # "cbrain:readonly-input-files": true
@@ -250,7 +254,7 @@ module BoutiquesSupport
250254
251255 # :method: custom_alters_input_files
252256 # Returns Boutiques CBRAIN custom property indicating
253- # if this task may alter its input files
257+ # if this task may alter its input files.
254258 # An example of property definition in a tool descriptor:
255259 # "custom: {
256260 # "cbrain:alters-input-files": true
@@ -267,15 +271,15 @@ module BoutiquesSupport
267271 # For listed outputs ids new results overwrite old files.
268272 # An example of property definition in a tool descriptor:
269273 # "custom: {
270- # "cbrain:no-run-id-for-outputs": []id_1, id_2, id_3 ..]
274+ # "cbrain:no-run-id-for-outputs": []id_1, id_2, id_3 ... ]
271275 # }
272276
273277
274278 # :section: Getter methods of BoutiquesDescriptor for CBRAIN specific properties of the descriptor custom section
275279
276280 # :method: custom_allow_empty_strings
277281 # Returns Boutiques CBRAIN custom property indicating
278- # for which inputs an empty string is a valid input
282+ # for which inputs an empty string is a valid input.
279283 # An example of property definition in a tool descriptor:
280284 # "custom: {
281285 # "cbrain:allow_empty_strings": [input_id]
@@ -298,6 +302,26 @@ module BoutiquesSupport
298302 # "cbrain:boutiques_bosh_exec_mode": "launch"
299303 # }
300304
305+
306+ # :section: Utility methods of +class Input+
307+
308+ # :method: cb_invoke_name
309+ # This method return the parameter name for the input.
310+ # We put all input Boutiques parameters under a 'invoke' substructure.
311+ # E.g. for a input with ID 'abcd' in a task, we'll find the value
312+ # in task.params['invoke']['abcd'] and the parameter name is thus
313+ # "invoke[abcd]"
314+
315+ # :section: Utility methods of +class Input+
316+
317+ # :method: cb_invoke_html_name
318+
319+
320+ # :section: Utility methods of +class Input+
321+
322+ # :method: cb_invoke_html_id
323+
324+
301325 # Read schema, extract some name lists
302326 @schema = JSON . parse ( File . read ( SCHEMA_FILE ) )
303327
@@ -486,7 +510,7 @@ def custom_author
486510 # Returns Boutiques CBRAIN custom property indicating
487511 # are forking sub-task(s) allowed. To submit a subtask, a task must create a JSON file
488512 # named ".new-task-*.json" at the root of its
489- # work directory
513+ # work directory.
490514 # An example of property definition in a tool descriptor:
491515 # "custom: {
492516 # "cbrain:can-submit-new-tasks": true
@@ -506,7 +530,8 @@ def custom_ignore_outputs
506530 end
507531
508532 # Returns Boutiques CBRAIN custom property indicating
509- # inputs which are saved back to the dataprovider (the original data will be mutated)
533+ # inputs which are saved back to the dataprovider
534+ # (the original data will be mutated).
510535 # An example of property definition in a tool descriptor:
511536 # "custom: {
512537 # "cbrain:save_back_inputs": [id_1, id_2, id_3 ...]
@@ -516,7 +541,7 @@ def custom_save_back_inputs
516541 end
517542
518543 # Returns Boutiques CBRAIN custom property indicating
519- # if the tool cannot modify inputs
544+ # that the tool does not modify inputs.
520545 # An example of property definition in a tool descriptor:
521546 # "custom: {
522547 # "cbrain:readonly-input-files": true
@@ -526,7 +551,7 @@ def custom_readonly_input_files
526551 end
527552
528553 # Returns Boutiques CBRAIN custom property indicating
529- # if this task may alter its input files
554+ # if this task may alter its input files.
530555 # An example of property definition in a tool descriptor:
531556 # "custom: {
532557 # "cbrain:alters-input-files": true
@@ -549,7 +574,7 @@ def custom_no_run_id_for_outputs
549574 end
550575
551576 # Returns Boutiques CBRAIN custom property indicating
552- # for which inputs an empty string is a valid input
577+ # for which inputs an empty string is a valid input.
553578 # An example of property definition in a tool descriptor:
554579 # "custom: {
555580 # "cbrain:allow_empty_strings": [input_id]
@@ -575,7 +600,7 @@ def custom_boutiques_bosh_exec_mode
575600 end
576601
577602 # An advanced feature for seasoned CBRAIN experts only. That allows
578- # overwrite the standard task behavior with custom class
603+ # overwrite the standard task behavior with custom class.
579604 # An example of property definition in a tool descriptor:
580605 # "custom: {
581606 # "cbrain:inherits-from-class": "MyClassName"
0 commit comments