method
cp_r
v2_6_3 -
Show latest stable
-
0 notes -
Class: FileUtils
- 1_8_6_287
- 1_8_7_72
- 1_8_7_330
- 1_9_1_378
- 1_9_2_180
- 1_9_3_125
- 1_9_3_392
- 2_1_10
- 2_2_9
- 2_4_6
- 2_5_5
- 2_6_3 (0)
- What's this?
cp_r(src, dest, preserve: nil, noop: nil, verbose: nil, dereference_root: true, remove_destination: nil)
private
Copies src to dest. If src is a directory, this method copies all its contents recursively. If dest is a directory, copies src to dest/src.
src can be a list of files.
# Installing Ruby library "mylib" under the site_ruby Bundler::FileUtils.rm_r site_ruby + '/mylib', :force Bundler::FileUtils.cp_r 'lib/', site_ruby + '/mylib' # Examples of copying several files to target directory. Bundler::FileUtils.cp_r %w(mail.rb field.rb debug/), site_ruby + '/tmail' Bundler::FileUtils.cp_r Dir.glob('*.rb'), '/home/foo/lib/ruby', :noop => true, :verbose => true # If you want to copy all contents of a directory instead of the # directory itself, c.f. src/x -> dest/x, src/y -> dest/y, # use following code. Bundler::FileUtils.cp_r 'src/.', 'dest' # cp_r('src', 'dest') makes dest/src, # but this doesn't.