Sha256: e58a10bfb3c91418382391f762450aed7356851790b80e6590ef7a0b409a80a3
Contents?: true
Size: 1.32 KB
Versions: 6
Compression:
Stored size: 1.32 KB
Contents
require 'open-uri' require 'yaml' module KPM class PluginsDirectory def self.all(latest=false) if latest # Look at GitHub (source of truth) source = URI.parse('https://raw.githubusercontent.com/killbill/killbill-cloud/master/kpm/lib/kpm/plugins_directory.yml').read YAML.load(source) else source = File.join(File.expand_path(File.dirname(__FILE__)), 'plugins_directory.yml') YAML.load_file(source) end end def self.lookup(plugin_name, latest=false) plugin = all(latest)[plugin_name.to_s.downcase.to_sym] return nil if plugin.nil? type = plugin[:type] is_ruby = type == :ruby group_id = plugin[:group_id] || (is_ruby ? KPM::BaseArtifact::KILLBILL_RUBY_PLUGIN_GROUP_ID : KPM::BaseArtifact::KILLBILL_JAVA_PLUGIN_GROUP_ID) artifact_id = plugin[:artifact_id] || "#{plugin.to_s}-plugin" packaging = plugin[:packaging] || (is_ruby ? KPM::BaseArtifact::KILLBILL_RUBY_PLUGIN_PACKAGING : KPM::BaseArtifact::KILLBILL_JAVA_PLUGIN_PACKAGING) classifier = plugin[:classifier] || (is_ruby ? KPM::BaseArtifact::KILLBILL_RUBY_PLUGIN_CLASSIFIER : KPM::BaseArtifact::KILLBILL_JAVA_PLUGIN_CLASSIFIER) version = plugin[:stable_version] || 'LATEST' [group_id, artifact_id, packaging, classifier, version, type] end end end
Version data entries
6 entries across 6 versions & 1 rubygems