Class: Sudo::Proxy
- Inherits:
-
Object
- Object
- Sudo::Proxy
- Defined in:
- lib/sudo/proxy.rb
Instance Method Summary collapse
- #add_load_path(path) ⇒ Object
- #load_path ⇒ Object
- #loaded_specs ⇒ Object
- #proxy(object, method = :itself, *args, &blk) ⇒ Object
Instance Method Details
#add_load_path(path) ⇒ Object
35 36 37 |
# File 'lib/sudo/proxy.rb', line 35 def add_load_path(path) $LOAD_PATH << path end |
#load_path ⇒ Object
31 32 33 |
# File 'lib/sudo/proxy.rb', line 31 def load_path $LOAD_PATH end |
#loaded_specs ⇒ Object
22 23 24 25 26 27 28 29 |
# File 'lib/sudo/proxy.rb', line 22 def loaded_specs # Return only the keys (gem names) to avoid marshaling StubSpecification objects # which can fail in newer Bundler versions Gem.loaded_specs.keys rescue => e warn "Warning: Could not get loaded gem specs (#{e.class}: #{e.}). Returning empty list." [] end |
#proxy(object, method = :itself, *args, &blk) ⇒ Object
18 19 20 |
# File 'lib/sudo/proxy.rb', line 18 def proxy(object, method = :itself, *args, &blk) object.send method, *args, &blk end |