Update after review

Fixes #2029
This commit is contained in:
Richard Pijnenburg 2014-11-05 23:51:39 +00:00 committed by Jordan Sissel
parent 4f46ab33cc
commit 1381c06858
3 changed files with 10 additions and 11 deletions

View file

@ -53,7 +53,7 @@ class LogStash::PluginManager::Install < Clamp::Command
end
::Gem.configuration.verbose = false
LogStash::PluginManager::Vendor.new().setup_hook
LogStash::PluginManager::Vendor.setup_hook
options = {}
options[:document] = []
inst = Gem::DependencyInstaller.new(options)

View file

@ -63,7 +63,7 @@ class LogStash::PluginManager::Update < Clamp::Command
end
::Gem.configuration.verbose = false
LogStash::PluginManager::Vendor.new().setup_hook
LogStash::PluginManager::Vendor.setup_hook
options = {}
options[:document] = []
inst = Gem::DependencyInstaller.new(options)

View file

@ -1,17 +1,16 @@
require 'logstash/json'
require 'logstash/util/filetools'
class LogStash::PluginManager::Vendor
module LogStash::PluginManager::Vendor
def setup_hook
def self.setup_hook
Gem.post_install do |gem_installer|
unless ENV['VENDOR_SKIP'] == 'true'
vendor_file = ::File.join(gem_installer.gem_dir, 'vendor.json')
if ::File.exist?(vendor_file)
vendor_file_content = IO.read(vendor_file)
file_list = LogStash::Json.load(vendor_file_content)
LogStash::Util::FileTools.process_downloads(file_list, ::File.join(gem_installer.gem_dir, 'vendor'))
end
next if ENV['VENDOR_SKIP'] == 'true'
vendor_file = ::File.join(gem_installer.gem_dir, 'vendor.json')
if ::File.exist?(vendor_file)
vendor_file_content = IO.read(vendor_file)
file_list = LogStash::Json.load(vendor_file_content)
LogStash::Util::FileTools.process_downloads(file_list, ::File.join(gem_installer.gem_dir, 'vendor'))
end
end
end