Top Level Namespace

Defined Under Namespace

Modules: BBLib Classes: Array, Element, File, Fixnum, Hash, Numeric, String, Symbol

Instance Method Summary collapse

Instance Method Details

#require_gem(gem, name = nil) ⇒ Object

Convenience method that will try to download and install a gem before requiring it only if the gem is not already installed



18
19
20
21
22
23
24
# File 'lib/gem/bbgem.rb', line 18

def require_gem gem, name = nil
  name = gem if name.nil?
  if !BBLib.gem_installed? name
    return false unless Gem.install gem
  end
  require name
end