X-Git-Url: https://review.fuel-infra.org/gitweb?a=blobdiff_plain;ds=sidebyside;f=doc%2Fclasses%2FMCollective%2FPluginPackager%2FStandardDefinition.html;fp=doc%2Fclasses%2FMCollective%2FPluginPackager%2FStandardDefinition.html;h=d190b63fec378373dba9a3b1c6b464a713012680;hb=d1f1649ba43c5cbc43c4beb2380096ba051d646a;hp=0000000000000000000000000000000000000000;hpb=8a3fe7daeecccf43dd71c59371c5005400d35101;p=packages%2Fprecise%2Fmcollective.git diff --git a/doc/classes/MCollective/PluginPackager/StandardDefinition.html b/doc/classes/MCollective/PluginPackager/StandardDefinition.html new file mode 100644 index 0000000..d190b63 --- /dev/null +++ b/doc/classes/MCollective/PluginPackager/StandardDefinition.html @@ -0,0 +1,340 @@ + + + + +
+Class | +MCollective::PluginPackager::StandardDefinition | +
In: | +
+
+ lib/mcollective/pluginpackager/standard_definition.rb
+
+ + |
+
Parent: | ++ Object + | +
dependencies | +[RW] | ++ |
mcname | +[RW] | ++ |
mcversion | +[RW] | ++ |
metadata | +[RW] | ++ |
packagedata | +[RW] | ++ |
path | +[RW] | ++ |
plugintype | +[RW] | ++ |
postinstall | +[RW] | ++ |
preinstall | +[RW] | ++ |
revision | +[RW] | ++ |
target_path | +[RW] | ++ |
vendor | +[RW] | ++ |
+ # File lib/mcollective/pluginpackager/standard_definition.rb, line 7 + 7: def initialize(configuration, mcdependency, plugintype) + 8: @plugintype = plugintype + 9: @path = configuration[:target] +10: @packagedata = {} +11: @revision = configuration[:revision] || 1 +12: @preinstall = configuration[:preinstall] +13: @postinstall = configuration[:postinstall] +14: @vendor = configuration[:vendor] || "Puppet Labs" +15: @dependencies = configuration[:dependency] || [] +16: @target_path = File.expand_path(@path) +17: @metadata, mcversion = PluginPackager.get_metadata(@path, @plugintype) +18: @mcname = mcdependency[:mcname] || "mcollective" +19: @mcversion = mcdependency[:mcversion] || mcversion +20: @dependencies << {:name => "#{mcname}-common", :version => @mcversion} +21: @metadata[:name] = (configuration[:pluginname] || @metadata[:name]).downcase.gsub(/\s+|_/, "-") +22: @metadata[:version] = (configuration[:version] || @metadata[:version]) +23: identify_packages +24: end ++
+Obtain list of common files +
+ ++ # File lib/mcollective/pluginpackager/standard_definition.rb, line 54 +54: def common +55: common = {:files => [], +56: :dependencies => @dependencies.clone, +57: :description => "Common libraries for #{@name} connector plugin"} +58: +59: commondir = File.join(@path, "util") +60: if PluginPackager.check_dir_present commondir +61: common[:files] = Dir.glob(File.join(commondir, "*")) +62: return common +63: else +64: return nil +65: end +66: end ++
+Identify present packages and populate the packagedata hash +
+ ++ # File lib/mcollective/pluginpackager/standard_definition.rb, line 27 +27: def identify_packages +28: common_package = common +29: @packagedata[:common] = common_package if common_package +30: plugin_package = plugin +31: @packagedata[@plugintype.to_sym] = plugin_package if plugin_package +32: end ++
+Obtain standard plugin files +and dependencies +
+ ++ # File lib/mcollective/pluginpackager/standard_definition.rb, line 35 +35: def plugin +36: plugindata = {:files => [], +37: :dependencies => @dependencies.clone, +38: :description => "#{@name} #{@plugintype} plugin for the Marionette Collective."} +39: +40: plugindir = File.join(@path, @plugintype.to_s) +41: if PluginPackager.check_dir_present plugindir +42: plugindata[:files] = Dir.glob(File.join(plugindir, "*")) +43: else +44: return nil +45: end +46: +47: plugindata[:plugindependency] = {:name => "#{@mcname}-#{@metadata[:name]}-common", +48: :version => @metadata[:version], +49: :revision => @revision} if @packagedata[:common] +50: plugindata +51: end ++