Sha256: d9a9f402efc3b20e4c582a8fb5bba5f3d6faf9ed7766206e7355919ec7b6dd5a

Contents?: true

Size: 1.24 KB

Versions: 6

Compression:

Stored size: 1.24 KB

Contents

# frozen_string_literal: true

# https://guides.rubygems.org/plugins/

require "pathname"
def run(action, installer)
  path = Pathname.new(installer.spec.lib_dirs_glob) / "#{action}.rb"
  if 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
    if delete
      $LOAD_PATH.delete installer.spec.lib_dirs_glob
    end
    true
  end
end

def msg(action, installer)
  puts "Finished: plugin: #{action} => #{installer.spec.name} (#{installer.spec.version})"
end

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

# Gem.pre_reset do |installer|
#   run "pre_reset", 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_reset do |installer|
#   run "post_reset", installer
# end

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

# TODO: el caller o que solo se haga una vez
=begin
bundle clean --force
gem uninstall --ignore-dependencies --all -x
gem install bundle
bundle install
=end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
gem_name-0.1.8 lib/rubygems_plugin.rb
gem_name-0.1.7 lib/rubygems_plugin.rb
gem_name-0.1.6 lib/rubygems_plugin.rb
gem_name-0.1.5 lib/rubygems_plugin.rb
gem_name-0.1.4 lib/rubygems_plugin.rb
gem_name-0.1.3 lib/rubygems_plugin.rb