Class: Appear::Revealers::MacRevealer
- Inherits:
-
BaseRevealer
- Object
- BaseService
- Service
- BaseRevealer
- Appear::Revealers::MacRevealer
- Defined in:
- lib/appear/revealers.rb
Overview
Base class for Mac-terminal revealers.
Direct Known Subclasses
Instance Method Summary collapse
-
#reveal_tree(tree) ⇒ Object
Implementation.
-
#supports_tree?(target, rest) ⇒ Boolean
Implementation.
Methods inherited from BaseRevealer
Methods inherited from BaseService
delegate, #initialize, require_service, required_services
Constructor Details
This class inherits a constructor from Appear::BaseService
Instance Method Details
#reveal_tree(tree) ⇒ Object
Implementation.
66 67 68 69 70 71 72 73 |
# File 'lib/appear/revealers.rb', line 66 def reveal_tree(tree) hits = services.lsof.join_via_tty(tree, services.mac_term.panes) actual_hits = hits.uniq {|hit| hit.tty }. reject {|hit| services.mac_os.has_gui?(hit.process) }. each { |hit| services.mac_term.reveal_pane(hit) } return actual_hits.length > 0 end |
#supports_tree?(target, rest) ⇒ Boolean
Implementation
77 78 79 80 81 |
# File 'lib/appear/revealers.rb', line 77 def supports_tree?(target, rest) rest.any? do |process| process.name == services.mac_term.app_name && services.mac_os.has_gui?(process) end end |