Class: ITermCLI::Terminal::Function
- Inherits:
-
Object
- Object
- ITermCLI::Terminal::Function
show all
- Defined in:
- lib/iterm_cli/terminal/function.rb
Class Method Summary
collapse
Instance Method Summary
collapse
Class Method Details
.call(*args) ⇒ Object
7
8
9
|
# File 'lib/iterm_cli/terminal/function.rb', line 7
def self.call(*args)
new.call(*args)
end
|
Instance Method Details
#call(*_args) ⇒ Object
11
12
13
|
# File 'lib/iterm_cli/terminal/function.rb', line 11
def call(*_args)
raise NotImplementedError
end
|
#osascript(source, arg = {}) ⇒ Object
15
16
17
18
19
20
21
22
23
|
# File 'lib/iterm_cli/terminal/function.rb', line 15
def osascript(source, arg = {})
out, err, status = Open3.capture3("/usr/bin/osascript", "-l", "JavaScript", "-e", source, arg.to_json)
unless status.success?
warn "osascript exited with #{status.to_i}"
warn err
exit status.to_i
end
out
end
|