Class: Object
- Inherits:
- BasicObject
- Defined in:
- lib/sh_util.rb
Instance Method Summary collapse
Instance Method Details
#find_in_load_path(file) ⇒ Object
15 16 17 18 19 20 21 |
# File 'lib/sh_util.rb', line 15 def find_in_load_path(file) $:.each do |path| abs_file = "#{path}/#{file}" return abs_file if File.exists? abs_file end return nil end |
#try_require(lib) ⇒ Object
4 5 6 7 8 9 10 11 12 13 |
# File 'lib/sh_util.rb', line 4 def try_require lib found = nil begin require lib found = true rescue LoadError found = false end return found end |