X-Git-Url: https://review.fuel-infra.org/gitweb?a=blobdiff_plain;f=doc%2FMCollective%2FDDL%2FBase.html;fp=doc%2Fclasses%2FMCollective%2FDDL%2FBase.html;h=7625233ad3718af446509bef1f6eb289fc3b8b2f;hb=refs%2Fheads%2Fhavana;hp=0ffb57dfd9739c80e89561ec8d78f3a69ad5afc2;hpb=d1f1649ba43c5cbc43c4beb2380096ba051d646a;p=packages%2Fprecise%2Fmcollective.git diff --git a/doc/classes/MCollective/DDL/Base.html b/doc/MCollective/DDL/Base.html similarity index 53% rename from doc/classes/MCollective/DDL/Base.html rename to doc/MCollective/DDL/Base.html index 0ffb57d..7625233 100644 --- a/doc/classes/MCollective/DDL/Base.html +++ b/doc/MCollective/DDL/Base.html @@ -1,85 +1,364 @@ - - - + +
-Class | -MCollective::DDL::Base | -
In: | -
-
- lib/mcollective/ddl/base.rb
-
- - |
-
Parent: | -- Object - | -
+ +
+ +The base class for all kinds of DDL files. DDL files when run gets parsed and builds up a hash of the basic primitive types, ideally restricted so it can be converted to @@ -88,119 +367,147 @@ laster on.
The Hash being built should be stored in @entities, the format is generally -not prescribed but there‘s a definite feel to how DDL files look so study the agent and discovery ones to see how the structure applies to very different use cases.
For every plugin type you should have a single word name - that corresponds to the directory in the libdir where these plugins live. If you need -anything above and beyond ‘metadata’ in your plugin DDL then add a PlugintypeDDL class here and add your specific behaviors to those.
-entities | -[R] | -- |
meta | -[R] | -- |
pluginname | -[R] | -- |
plugintype | -[R] | -- |
requirements | -[R] | -- |
usage | -[R] | -- |
(Not documented)
+ + + +# File lib/mcollective/ddl/base.rb, line 24 24: def initialize(plugin, plugintype=:agent, loadddl=true) @@ -213,27 +520,40 @@ specific behaviors to those. 31: @requirements = {} 32: 33: loadddlfile if loadddl -34: end --
(Not documented)
+ + + +# File lib/mcollective/ddl/base.rb, line 89 89: def findddlfile(ddlname=nil, ddltype=nil) @@ -248,26 +568,31 @@ specific behaviors to those. 98: end 99: end 100: return false -101: end --
+Generates help using the template based on the data created with metadata +and input.
If no template name is provided one will be chosen based on the plugin @@ -275,9 +600,11 @@ type. If the provided template path is not absolute then the template will be loaded either from the config dir and if that does not exist, default to /etc/mcollective
- -# File lib/mcollective/ddl/base.rb, line 44 44: def help(template=nil) @@ -297,32 +624,39 @@ be loaded either from the config dir and if that does not exist, default to 58: 59: erb = ERB.new(template, 0, '%') 60: erb.result(binding) -61: end --
-Registers an input argument for a given -action +61: end +
+Registers an input argument for a given action
See the documentation for action for how to use this
- -# File lib/mcollective/ddl/base.rb, line 153 153: def input(argument, properties) @@ -353,25 +687,34 @@ See the documentation for action for how to use this 178: 179: @entities[entity][:input][argument][:list] = properties[:list] 180: end -181: end --
(Not documented)
+ + + +# File lib/mcollective/ddl/base.rb, line 81 81: def loadddlfile @@ -380,28 +723,36 @@ See the documentation for action for how to use this 84: else 85: raise_code(:PLMC40, "Can't find DDL for %{type} plugin '%{name}'", :debug, :type => @plugintype, :name => @pluginname) 86: end -87: end --
Registers meta data for the introspection hash
- -# File lib/mcollective/ddl/base.rb, line 215 215: def metadata(meta) @@ -410,32 +761,39 @@ Registers meta data for the introspection hash 218: end 219: 220: @meta = meta -221: end --
-Registers an output argument for a given -action +221: end +
+Registers an output argument for a given action
See the documentation for action for how to use this
- -# File lib/mcollective/ddl/base.rb, line 186 186: def output(argument, properties) @@ -448,25 +806,34 @@ See the documentation for action for how to use this 193: @entities[action][:output][argument] = {:description => properties[:description], 194: :display_as => properties[:display_as], 195: :default => properties[:default]} -196: end --
(Not documented)
+ + + +# File lib/mcollective/ddl/base.rb, line 198 198: def requires(requirement) @@ -483,25 +850,34 @@ See the documentation for action for how to use this 209: end 210: 211: validate_requirements -212: end --
(Not documented)
+ + + +# File lib/mcollective/ddl/base.rb, line 67 67: def template_for_plugintype @@ -516,47 +892,62 @@ See the documentation for action for how to use this 76: return "metadata-help.erb" 77: end 78: end -79: end --
(Not documented)
+ + + +# File lib/mcollective/ddl/base.rb, line 63 63: def usage(usage_text) 64: @usage = usage_text -65: end --
+validate strings, lists and booleans, we’ll add more types of validators when all the use cases are clear
@@ -568,9 +959,11 @@ safe assumption, just to skip them. :string can have maxlength and regex. A maxlength of 0 will bypasss checks :list has a array of valid values
- -# File lib/mcollective/ddl/base.rb, line 127 127: def validate_input_argument(input, key, argument) @@ -594,25 +987,34 @@ safe assumption, just to skip them. 145: return true 146: rescue => e 147: DDL.validation_fail!(:PLMC21, "Cannot validate input '%{input}': %{error}", :debug, :input => key, :error => e.to_s) -148: end --
(Not documented)
+ + + +# File lib/mcollective/ddl/base.rb, line 103 103: def validate_requirements @@ -628,22 +1030,33 @@ safe assumption, just to skip them. 113: end 114: 115: true -116: end --
Disabled; run with --debug to generate this.
+ +Generated with the Darkfish + Rdoc Generator 1.1.6.
+