Guest User

Untitled

a guest
Jan 23rd, 2018
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.57 KB | None | 0 0
  1. pry(main)> show-command ".<shell command>"
  2.  
  3. From: /Users/john/ruby/projects/pry/lib/pry/default_commands/shell.rb @ line 6:
  4. Number of lines: 15
  5.  
  6. command(/\.(.*)/, "All text following a '.' is forwarded to the shell.", :listing => ".<shell command>", :use_prefix => false) do |cmd|
  7. if cmd =~ /^cd\s+(.+)/i
  8. dest = $1
  9. begin
  10. Dir.chdir File.expand_path(dest)
  11. rescue Errno::ENOENT
  12. output.puts "No such directory: #{dest}"
  13. end
  14.  
  15. else
  16. if !system(cmd)
  17. output.puts "Error: there was a problem executing system command: #{cmd}"
  18. end
  19. end
  20. end
  21. pry(main)>
Add Comment
Please, Sign In to add comment