lib/kpm/installer.rb in kpm-0.0.1 vs lib/kpm/installer.rb in kpm-0.0.2

- old
+ new

@@ -22,10 +22,11 @@ end def install install_killbill_server install_plugins + install_default_bundles end private def install_killbill_server @@ -73,11 +74,32 @@ FileUtils.mkdir_p(destination) @logger.info "Installing Kill Bill Ruby plugin #{artifact_id} #{version} to #{destination}" archive = KillbillPluginArtifact.pull(artifact_id, version, :ruby, destination, @config['nexus'], @config['nexus']['ssl_verify']) - Utils.unpack_tgz(archive[:file_path], destination) + Utils.unpack_tgz(archive[:file_path], destination, true) FileUtils.rm archive[:file_path] end end + + def install_default_bundles + return if @config['default_bundles'] == false + + group_id = 'org.kill-bill.billing' + artifact_id = 'killbill-osgi-bundles-defaultbundles' + packaging = 'tar.gz' + version = @config['version'] || LATEST_VERSION + destination = "#{@config['plugins_dir']}/platform" + + FileUtils.mkdir_p(destination) + + @logger.info "Installing Kill Bill #{artifact_id} #{version} to #{destination}" + archive = BaseArtifact.pull(group_id, artifact_id, packaging, version, destination, @config['nexus'], @config['nexus']['ssl_verify']) + + Utils.unpack_tgz(archive[:file_path], destination) + FileUtils.rm archive[:file_path] + + # The special JRuby bundle needs to be called jruby.jar + File.rename Dir.glob("#{destination}/killbill-osgi-bundles-jruby-*.jar").first, "#{destination}/jruby.jar" + end end -end \ No newline at end of file +end