Top Level Namespace

Defined Under Namespace

Modules: Episodic Classes: Class

Instance Method Summary collapse

Instance Method Details

#require_library_or_gem(library, gem_name = nil) ⇒ Object



8
9
10
11
12
13
14
15
16
17
18
19
20
# File 'lib/episodic/platform.rb', line 8

def require_library_or_gem(library, gem_name = nil)
  if RUBY_VERSION >= '1.9'
    gem(gem_name || library, '>=0') 
  end
  require library
rescue LoadError => library_not_installed
  begin
    require 'rubygems'
    require library
  rescue LoadError
    raise library_not_installed
  end
end