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_qlmanage? ⇒ Boolean
- #with_tmux? ⇒ Boolean
Constructor Details
#initialize ⇒ Environment
Returns a new instance of Environment.
5 6 7 8 9 10 11 12 |
# File 'lib/twterm/environment.rb', line 5 def initialize @uname = `uname`.strip @terminal_notifier_available = TerminalNotifier.available? @with_eog = system('which eog 2>&1 >/dev/null') @with_tmux = system('which tmux 2>&1 >/dev/null') && !ENV['TMUX'].nil? @with_qlmanage = system('which qlmanage 2>&1 >/dev/null') end |
Instance Method Details
#darwin? ⇒ Boolean
14 15 16 |
# File 'lib/twterm/environment.rb', line 14 def darwin? @uname == 'Darwin' end |
#linux? ⇒ Boolean
18 19 20 |
# File 'lib/twterm/environment.rb', line 18 def linux? @uname == 'Linux' end |
#terminal_notifier_available? ⇒ Boolean
22 23 24 |
# File 'lib/twterm/environment.rb', line 22 def terminal_notifier_available? @terminal_notifier_available end |
#with_eog? ⇒ Boolean
26 27 28 |
# File 'lib/twterm/environment.rb', line 26 def with_eog? @with_eog end |
#with_qlmanage? ⇒ Boolean
30 31 32 |
# File 'lib/twterm/environment.rb', line 30 def with_qlmanage? @with_qlmanage end |
#with_tmux? ⇒ Boolean
34 35 36 |
# File 'lib/twterm/environment.rb', line 34 def with_tmux? @with_tmux end |