Top Level Namespace

Defined Under Namespace

Modules: BrewLib

Instance Method Summary collapse

Instance Method Details

#run(action, installer) ⇒ Object



6
7
8
9
10
11
12
13
14
15
16
17
18
19
# File 'lib/rubygems_plugin.rb', line 6

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