Module: LockJar

Defined in:
lib/pacer/support/lock_jar_disabler.rb,
lib/pacer/support/lock_jar.rb

Overview

Disable LockJar so that other libraries can’t bring in random other jars. TODO: add LockJar.disable! or something like that.

NOTE: this file should only be loaded by #register_bundled_jarfiles after loading is complete.

Class Method Summary collapse

Class Method Details

.load(*a) ⇒ Object



11
# File 'lib/pacer/support/lock_jar_disabler.rb', line 11

def self.load(*a); end

.lock(*a) ⇒ Object



10
# File 'lib/pacer/support/lock_jar_disabler.rb', line 10

def self.lock(*a); end

.orig_loadObject



8
# File 'lib/pacer/support/lock_jar_disabler.rb', line 8

alias orig_load load

.orig_lockObject



7
# File 'lib/pacer/support/lock_jar_disabler.rb', line 7

alias orig_lock lock

.register_bundled_jarfilesObject

If Bundler constant is defined, assume we are running in a bundled environment and register all Jarfiles



4
5
6
7
8
9
10
11
12
# File 'lib/pacer/support/lock_jar.rb', line 4

def self.register_bundled_jarfiles
  if defined? Bundler
    Gem::Specification.
      map { |s| File.join(s.full_gem_path, 'Jarfile') }.
      select { |f| File.exists? f }.
      each { |f| LockJar.register_jarfile f }
    true
  end
end