Sha256: 24774d23537b0f95049a613dfe3d12095b3c0cb6d24d9ac1b59631b65369b367

Contents?: true

Size: 904 Bytes

Versions: 3

Compression:

Stored size: 904 Bytes

Contents

# frozen_string_literal: true

# https://guides.rubygems.org/plugins/
# https://github.com/rvm/executable-hooks/blob/master/lib/rubygems_plugin.rb
require "pathname"
def run(action, installer)
  path = Pathname.new(installer.spec.lib_dirs_glob) / "#{action}.rb"
  return unless path.exist?

  delete = false
  unless $LOAD_PATH.include?(installer.spec.lib_dirs_glob)
    $LOAD_PATH.unshift installer.spec.lib_dirs_glob
    delete = true
  end
  # noinspection RubyResolve
  require action
  $LOAD_PATH.delete installer.spec.lib_dirs_glob if delete
  true
end

Gem.pre_install do |installer|
  run "pre_install", installer
end

Gem.pre_uninstall do |installer|
  run "pre_uninstall", installer
end

Gem.post_build do |installer|
  run "post_build", installer
end

Gem.post_install do |installer|
  run "post_install", installer
end

Gem.post_uninstall do |installer|
  run "post_uninstall", installer
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
brew_lib-0.1.20 lib/rubygems_plugin.rb
brew_lib-0.1.19 lib/rubygems_plugin.rb
brew_lib-0.1.17 lib/rubygems_plugin.rb