Top Level Namespace

Defined Under Namespace

Modules: BrewLib

Instance Method Summary collapse

Instance Method Details

#msg(action, installer) ⇒ Object



23
24
25
# File 'lib/rubygems_plugin.rb', line 23

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

#run(action, installer) ⇒ Object



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

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