Module: Rfd::Commands::Other
- Included in:
- Rfd::Commands
- Defined in:
- lib/rfd/commands.rb
Overview
Other utility commands.
Instance Method Summary collapse
-
#C ⇒ Object
Copy path to clipboard.
-
#O ⇒ Object
Open terminal here.
-
#q ⇒ Object
Quit the app.
Instance Method Details
#C ⇒ Object
Copy path to clipboard.
349 350 351 |
# File 'lib/rfd/commands.rb', line 349 def C clipboard end |
#O ⇒ Object
Open terminal here.
354 355 356 357 358 |
# File 'lib/rfd/commands.rb', line 354 def O dir = current_item.directory? ? current_item.path : current_dir.path escaped_dir = dir.gsub('\\', '\\\\\\\\').gsub('"', '\\"') system 'osascript', '-e', %Q[tell app "Terminal" to do script "cd \\"#{escaped_dir}\\""] if osx? end |
#q ⇒ Object
Quit the app.
384 385 386 |
# File 'lib/rfd/commands.rb', line 384 def q raise StopIteration if ask 'Are you sure want to exit? (y/n)' end |