Class: Twterm::Environment
- Inherits:
-
Object
- Object
- Twterm::Environment
- Defined in:
- lib/twterm/environment.rb
Instance Method Summary collapse
- #darwin? ⇒ Boolean
-
#initialize ⇒ Environment
constructor
A new instance of Environment.
- #linux? ⇒ Boolean
- #terminal_notifier_available? ⇒ Boolean
- #with_eog? ⇒ Boolean
- #with_imgcat? ⇒ Boolean
- #with_qlmanage? ⇒ Boolean
- #with_tmux? ⇒ Boolean
Constructor Details
#initialize ⇒ Environment
Returns a new instance of Environment.
5 6 7 8 9 10 11 12 13 |
# File 'lib/twterm/environment.rb', line 5 def initialize @uname = `uname`.strip @terminal_notifier_available = TerminalNotifier.available? @with_eog = system('which eog >/dev/null 2>&1') @with_imgcat = system('which imgcat >/dev/null 2>&1') @with_tmux = system('which tmux >/dev/null 2>&1') && !ENV['TMUX'].nil? @with_qlmanage = system('which qlmanage >/dev/null 2>&1') end |
Instance Method Details
#darwin? ⇒ Boolean
15 16 17 |
# File 'lib/twterm/environment.rb', line 15 def darwin? @uname == 'Darwin' end |
#linux? ⇒ Boolean
19 20 21 |
# File 'lib/twterm/environment.rb', line 19 def linux? @uname == 'Linux' end |
#terminal_notifier_available? ⇒ Boolean
23 24 25 |
# File 'lib/twterm/environment.rb', line 23 def terminal_notifier_available? @terminal_notifier_available end |
#with_eog? ⇒ Boolean
27 28 29 |
# File 'lib/twterm/environment.rb', line 27 def with_eog? @with_eog end |
#with_imgcat? ⇒ Boolean
31 32 33 |
# File 'lib/twterm/environment.rb', line 31 def with_imgcat? @with_imgcat end |
#with_qlmanage? ⇒ Boolean
35 36 37 |
# File 'lib/twterm/environment.rb', line 35 def with_qlmanage? @with_qlmanage end |
#with_tmux? ⇒ Boolean
39 40 41 |
# File 'lib/twterm/environment.rb', line 39 def with_tmux? @with_tmux end |