2 # Require a library with fallback to RubyGems. Warnings during library
3 # loading are silenced to increase signal/noise for application warnings.
4 def require_library_or_gem(library_name
)
8 rescue LoadError
=> cannot_require
9 # 1. Requiring the module is unsuccessful, maybe it's a gem and nobody required rubygems yet. Try.
12 rescue LoadError
=> rubygems_not_installed
15 # 2. Rubygems is installed and loaded. Try to load the library again
18 rescue LoadError
=> gem_not_installed