Module: Basepath
Instance Method Summary collapse
-
#const_expand!(s) ⇒ Object
used when settings consts and load_path.
- #mine(file = false) ⇒ Object
Instance Method Details
#const_expand!(s) ⇒ Object
used when settings consts and load_path
13 14 15 |
# File 'lib/basepath.rb', line 13 def (s) (s.sub!(RX_CONSTS, '') ? Object.const_get($1) : ::BASE_PATH).join(s); end |
#mine(file = false) ⇒ Object
6 7 8 9 10 |
# File 'lib/basepath.rb', line 6 def mine(file = false) path_to_first_caller = (s = caller.last) ? s.sub(/:\d+(?::in `.*?')?$/, '') : __FILE__ path = Pathname.new(path_to_first_caller).realpath file ? path : path.dirname end |