Advertisement
Guest User

Untitled

a guest
Aug 20th, 2014
165
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.50 KB | None | 0 0
  1. # src, dest are strings
  2. # on_dir, on_file are Procs
  3.  
  4. def copy_transform src, dest, on_dir, on_file
  5. # walking src recursively
  6. # call the appropriate block to make the transformation happen
  7. # use the the result to create a directory of file
  8. end
  9.  
  10. Net::SSH.start(<host>, <usr>) do |ssh|
  11. # redirect all the write and/or read operations like:
  12. # mkdir, cp, mv, rm
  13. # to the ssh-object given to the block
  14.  
  15. copy_transform 'src', 'dest', proc1, proc2
  16.  
  17. # restore every stream
  18. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement