Module: Rfd::Commands::Other

Included in:
Rfd::Commands
Defined in:
lib/rfd/commands.rb

Overview

Other utility commands.

Instance Method Summary collapse

Instance Method Details

#CObject

Copy path to clipboard.



349
350
351
# File 'lib/rfd/commands.rb', line 349

def C
  clipboard
end

#OObject

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

#qObject

Quit the app.

Raises:

  • (StopIteration)


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