I am trying to understand the script presented on this site :
#!/usr/bin/env ruby require ENV['TM_SUPPORT_PATH'] + '/lib/escape.rb' def terminal_script_filepath %|tell application "Terminal" activate do script "jsc -i #{e_as(e_sh(ENV['TM_FILEPATH']))}" end tell| end open("|osascript", "w") { |io| io << terminal_script_filepath }
Most importantly, the part where the terminal_script_filepath function starts with:
%| β¦ β¦ |
... and where he "understands" in:
{ |io| io << terminal_script_filepath }
What Ruby concepts are used here?
I know that open() with a channel helps me provide input to the STDIN of the process, but how is input from terminal_script_filepath to io introduced? I also know the basic % operations with strings , for example %w , but what does the pipe do here?
slhck
source share