X-Git-Url: https://review.fuel-infra.org/gitweb?a=blobdiff_plain;ds=sidebyside;f=doc%2FMCollective%2FGenerators%2FAgentGenerator.html;fp=doc%2FMCollective%2FGenerators%2FAgentGenerator.html;h=81dd3a9a1a1524f75989201bb569f0776b505f3c;hb=7c9314f502cde8daad23b61d10b24a542e04154a;hp=0000000000000000000000000000000000000000;hpb=d1f1649ba43c5cbc43c4beb2380096ba051d646a;p=packages%2Fprecise%2Fmcollective.git diff --git a/doc/MCollective/Generators/AgentGenerator.html b/doc/MCollective/Generators/AgentGenerator.html new file mode 100644 index 0000000..81dd3a9 --- /dev/null +++ b/doc/MCollective/Generators/AgentGenerator.html @@ -0,0 +1,570 @@ + + + +
+ + +Base
+ +(Not documented)
+ + + ++ # File lib/mcollective/generators/agent_generator.rb, line 7 + 7: def initialize(plugin_name, actions = [], name = nil, description = nil, author = nil , + 8: license = nil, version = nil, url = nil, timeout = nil) + 9: +10: super(name, description, author, license, version, url, timeout) +11: @plugin_name = plugin_name +12: @actions = actions || [] +13: @ddl = create_ddl +14: @mod_name = "Agent" +15: @pclass = "RPC::Agent" +16: @content = create_plugin_content +17: @plugin = create_plugin_string +18: write_plugins +19: end+
(Not documented)
+ + + ++ # File lib/mcollective/generators/agent_generator.rb, line 45 +45: def action_help +46: action_snippet = File.read(File.join(File.dirname(__FILE__), "templates", "action_snippet.erb")) +47: ERB.new(action_snippet).result +48: end+
(Not documented)
+ + + ++ # File lib/mcollective/generators/agent_generator.rb, line 21 +21: def create_ddl +22: action_text = "" +23: @actions.each_with_index do |action, i| +24: action_text += "action \"#{action}\", :description => \"%ACTIONDESCRIPTION%\" do\n" +25: action_text += action_help if i == 0 +26: action_text += "end\n" +27: action_text += "\n" unless @actions.size == (i + 1) +28: end +29: # Use inherited method to create metadata part of the ddl +30: create_metadata_string + action_text +31: end+
(Not documented)
+ + + ++ # File lib/mcollective/generators/agent_generator.rb, line 33 +33: def create_plugin_content +34: content_text = "" +35: +36: # Add actions to agent file +37: @actions.each_with_index do |action, i| +38: content_text += "%6s%s" % [" ", "action \"#{action}\" do\n"] +39: content_text += "%6s%s" % [" ", "end\n"] +40: content_text += "\n" unless @actions.size == (i + 1) +41: end +42: content_text +43: end+
Disabled; run with --debug to generate this.
+ +Generated with the Darkfish + Rdoc Generator 1.1.6.
+