Base
(Not documented)
# File lib/mcollective/generators/data_generator.rb, line 7 7: def initialize(plugin_name, outputs = [], 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: @mod_name = "Data" 12: @pclass = "Base" 13: @plugin_name = plugin_name 14: @outputs = outputs 15: @ddl = create_ddl 16: @content = create_plugin_content 17: @plugin = create_plugin_string 18: write_plugins 19: end
(Not documented)
# File lib/mcollective/generators/data_generator.rb, line 21 21: def create_ddl 22: query_text = "dataquery :description => \"Query information\" do\n" 23: query_text += ERB.new(File.read(File.join(File.dirname(__FILE__), "templates", "data_input_snippet.erb"))).result 24: 25: @outputs.each_with_index do |output,i| 26: query_text += "%2s%s" % [" ", "output :#{output},\n"] 27: query_text += "%9s%s" % [" ", ":description => \"%DESCRIPTION%\",\n"] 28: query_text += "%9s%s" % [" ", ":display_as => \"%DESCRIPTION%\"\n"] 29: query_text += "\n" unless @outputs.size == (i + 1) 30: end 31: 32: query_text += "end" 33: 34: # Use inherited method to create metadata part of the ddl 35: create_metadata_string + query_text 36: end
(Not documented)
# File lib/mcollective/generators/data_generator.rb, line 38 38: def create_plugin_content 39: content_text = "%6s%s" % [" ", "query do |what|\n"] 40: 41: @outputs.each do |output| 42: content_text += "%8s%s" % [" ", "result[:#{output}] = nil\n"] 43: end 44: content_text += "%6s%s" % [" ", "end\n"] 45: 46: # Add actions to agent file 47: content_text 48: end
Disabled; run with --debug to generate this.
Generated with the Darkfish Rdoc Generator 1.1.6.