2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
|
# File 'lib/ruby-clock/shell.rb', line 2
def shell_runner
@shell_runner ||= begin
require 'terrapin'
unless Terrapin::CommandLine.runner.class == Terrapin::CommandLine::ProcessRunner
puts <<~MESSAGE
🤷 terrapin is installed, but for some reason terrapin is
using backticks as its runner.
MESSAGE
end
puts '🐆 Using terrapin for shell commands.'
:terrapin
rescue LoadError
puts <<~MESSAGE
🦥 Using ruby backticks for shell commands.
For better performance, install the terrapin gem.
See README.md for more info.
MESSAGE
:backticks
end
end
|