aboutsummaryrefslogtreecommitdiffstats
path: root/lib/fileutils.rb
Commit message (Collapse)AuthorAgeFilesLines
* fileutils.rb: keyword argumentsnobu2016-03-011-237/+97
| | | | | | | * lib/fileutils.rb: use keyword arguments instead of option hashes. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53975 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* fileutils.rb: LowMethods aliasesnobu2016-02-291-2/+3
| | | | | | | * lib/fileutils.rb (LowMethods): make alias methods instead of eval for each methods. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53974 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* fileutils.rb: reduce privatenobu2016-02-291-6/+9
| | | | | | | * lib/fileutils.rb (Verbose, NoWrite, DryRun): make overridden methods private by each one calls. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53973 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* fileutils.rb: reduce publicnobu2016-02-291-9/+3
| | | | | | | * lib/fileutils.rb (Verbose, NoWrite, DryRun): make extended methods public by each one calls. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53972 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* fileutils.rb: unify method definition stylenobu2016-02-291-5/+5
| | | | | | * lib/fileutils.rb: Unify to coding-style for method definition. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53971 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Add frozen_string_literal: false for all filesnaruse2015-12-161-0/+1
| | | | | | When you change this to true, you may need to add more tests. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53141 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/fileutils.rb: rename tailing to trailing.hsbt2015-10-261-5/+5
| | | | | | [Misc #11548] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52285 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* fileutils.rb: fix rename_cannot_overwrite_filenobu2015-08-261-1/+1
| | | | | | | * lib/fileutils.rb (rename_cannot_overwrite_file): File.rename on cygwin and mswin/mingw can overwrite the destination file. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51696 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* fileutils.rb: fix error messagenobu2015-04-011-1/+1
| | | | | | | | | * lib/fileutils.rb (FileUtils#mv): show the exact target path in the error message instead of the destination parent directory name. patched by João Britto <jabcalves AT gmail.com> at [ruby-core:68706]. [Bug #11021] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50141 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/fileutils.rb: enable to remove with non-owner directory.hsbt2014-08-121-0/+1
| | | | | | | [ruby-dev:45976] [Bug #6756] * test/fileutils/test_fileutils.rb: add testcase for #6756. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47150 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/fileutils.rb: fix typo.hsbt2014-08-121-2/+2
| | | | | | [ruby-dev:47831] [Bug #9180] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47148 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/fileutils.rb: added missing options of FileUtils.touch by @Domon.hsbt2014-07-181-1/+1
| | | | | | [fix GH-669] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46856 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/fileutils.rb: handle ENOENT error with symlink targeted tohsbt2014-07-111-3/+9
| | | | | | non-exists file. [ruby-dev:45933] [Bug #6716] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46783 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/fileutils.rb: show fileutils require at top.ayumin2014-05-081-38/+40
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45880 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/fileutils.rb: Don't need to define fu_get_gid and fu_get_gid inakr2014-04-291-36/+24
| | | | | | | | rescue LoadError on 'etc'. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45743 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/fileutils.rb (rmdir): rescue Errno::EEXIST in addition tongoto2014-04-251-1/+1
| | | | | | | | | | ENOTEMPTY (and ENOENT), because SUSv3 describes that "If the directory is not an empty directory, rmdir() shall fail and set errno to [EEXIST] or [ENOTEMPTY]" and Solaris uses EEXIST. [Bug #9571] [ruby-dev:48017] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45720 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/fileutils.rb (fu_get_uid, fu_get_gid): Etc.getpwnam/getgrnam mayusa2014-04-241-2/+2
| | | | | | | | | returns nil. * lib/webrick/utils.rb (su): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45712 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* fileutils.rb: [DOC] update rdocnobu2014-04-171-2/+2
| | | | | | | | * lib/fileutils.rb (FileUtils#copy_entry): update rdoc about preserve option and permissions, following r31123. [ruby-core:62065] [Bug #9748] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45604 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/fileutils.rb: [DOC] Fix typo in options_of() example [Bug #9392]zzak2014-01-231-1/+1
| | | | | | | Patch by Giorgos Tsiftsis git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44688 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * fix typo by @rrrene [fix GH-510]hsbt2014-01-221-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44679 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* fileutils.rb: rmdir parents optionnobu2013-12-241-1/+1
| | | | | | | * lib/fileutils.rb (FileUtils#rmdir): [DOC] add parents option. [Bug #7824] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44396 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/fileutils.rb: remove unnecessary initialization. by @vipulnsward ↵hsbt2013-12-071-1/+1
| | | | | | [fix GH-463] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44048 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/fileutils.rb: [DOC] Fix typo (s/perserve/preserve/)a_matsuda2013-11-301-1/+1
| | | | | | [ci skip] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43936 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/cgi.rb: [DOC] Capitalize "Ruby" in documentation [Fixes GH-341]zzak2013-07-181-1/+1
| | | | | | | | | | | | | | | | | | | | | | Patch by Dave Worth https://github.com/ruby/ruby/pull/341 * lib/webrick.rb: ditto * lib/scanf.rb: ditto * lib/xmlrpc/config.rb: ditto * lib/resolv.rb: ditto * lib/e2mmap.rb: ditto * lib/fileutils.rb: ditto * lib/mkmf.rb: ditto * lib/cgi/session.rb: ditto * lib/yaml.rb: ditto * lib/erb.rb: ditto * lib/irb.rb: ditto * lib/tracer.rb: ditto * lib/net/http.rb: ditto * ext/syslog/lib/syslog/logger.rb: ditto * sample/pty/expect_sample.rb: ditto git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42045 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/fileutils.rb (FileUtils#chown_R): Do not skip traversal evenknu2013-07-091-1/+0
| | | | | | | if user and group are both nil, to be consistent with #chown and other commands. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41860 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/fileutils.rb (FileUtils#mode_to_s): Define mode_to_s() alsoknu2013-07-091-0/+1
| | | | | | as singleton method, or FileUtils.chmod fails in verbose mode. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41853 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/fileutils.rb (FileUtils#chown, FileUtils#chown_R): If userknu2013-07-091-4/+4
| | | | | | and group are both nil, print ":". git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41851 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/fileutils.rb (FileUtils#chown, FileUtils#chown_R): Fix theknu2013-07-051-2/+2
| | | | | | | wrong output message when user is nil, which should be "chown :group file" instead of "chown group file". git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41796 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/fileutils.rb (FileUtils.chmod{,_R}): Enhance the symbolicknu2013-07-041-46/+62
| | | | | | | | | mode parser to support the permission symbols u/g/o and multiple actions as defined in SUS, so that chmod("g=o+w", file) works as expected. Invalid symbolic modes are now rejected with ArgumentError. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41782 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/fileutils.rb (FileUtils#symbolic_modes_to_i): Fix the wrongknu2013-07-041-2/+2
| | | | | | | character class [+-=], which happened to match all desired characters but also match undesired characters. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41781 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* fileutils.rb: fix traversal loopnobu2013-06-131-0/+1
| | | | | | | * lib/fileutils.rb (FileUtils#rmdir): fix traversal loop, not trying remove same directory only. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41283 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* FileUtils.rmdir use remove_tailing_slashkazu2013-06-031-1/+1
| | | | | | | * lib/fileutils.rb (FileUtils.rmdir): use remove_tailing_slash. * test/fileutils/test_fileutils.rb: test for above. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41052 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/fileutils.rb: fix behavior when mkdir/mkdir_p accepted "/".ayumin2013-06-031-2/+7
| | | | | | * test/fileutils/test_fileutils.rb: add test for above change. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41047 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/fileutils.rb: Revert r34669 which altered the waydrbrain2013-03-011-178/+182
| | | | | | | | | | | | | metaprogramming in FileUtils occurred. [ruby-trunk - Bug #7958] * test/fileutils/visibility_tests.rb: Refactored tests of FileUtils options modules to expose bug found in #7958 * test/fileutils/test_dryrun.rb: ditto. * test/fileutils/test_nowrite.rb: ditto. * test/fileutils/test_verbose.rb: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39544 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/fileutils.rb (copy_entry, wrap_traverse): preserve attributes ofmame2013-02-021-2/+14
| | | | | | | | | directories on FileUtils.cp_r. The fix was proposed by Jan Wedekind. [Bug #7246] * test/fileutils/test_fileutils.rb: add a test for above. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39015 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/fileutils.rb: chmod/chmod_R with a string mode (e.g., "+x")mame2013-02-021-3/+7
| | | | | | | | caused error in verbose mode. * test/fileutils/test_fileutils.rb: add a test for above. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39011 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/fileutils.rb (chmod): Add "X" to modes, convert format to tablezzak2012-11-141-12/+14
| | | | | | | [ruby-core:48965] [Bug #7288] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37652 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/fileutils.rb (module FileUtils): repatch [ruby-core:39622]glass2012-11-041-10/+7
| | | | | | | [Feature #5337]. improve performance of FileUtils.compare_stream. [ruby-core:47545] [Feature #7028] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37465 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/fileutils.rb: fix typo.ayumin2012-08-181-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36727 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/fileutils.rb (uptodate?): remove useless parameter.ayumin2012-07-161-3/+1
| | | | | | patched by Oscar Del Ben.[Bug #6708][ruby-core:46256] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36400 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/fileutils.rb (cp_r): Fixed cp_r example. Patch by TJ Koblentzdrbrain2012-05-111-1/+1
| | | | | | | from pull request #114. [ruby-trunk - Bug #6410] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35626 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/fileutils.rb (copy_metadata): use File.lchown and File.lchmod toakr2012-04-301-4/+27
| | | | | | | | update meta data of symlinks. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35499 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/fileutils.rb (fu_have_symlink?): specify TypeError for rescueakr2012-03-121-1/+1
| | | | | | | clause. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34987 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/fileutils.rb: remove tailing spaces.nobu2012-03-111-2/+2
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34975 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/fileutils.rb: use chomp(?/) instead of sub to optimize and avoidnaruse2012-02-251-4/+4
| | | | | | to regexping invalid string. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34809 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/fileutils.rb: revert a line modified accidentally at r34669.shirosaki2012-02-201-1/+1
| | | | | | | This fixes mingw test errors in TestDir_M17N. [ruby-core:42728] [Feature #4970] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34706 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/fileutils.rb: refactored FileUtil methods to use thetenderlove2012-02-171-190/+189
| | | | | | | | | `define_command` API. Patch from 7rans <transfire@gmail.com> * test/fileutils/test_dryrun.rb: corresponding test refactoring * test/fileutils/test_nowrite.rb: ditto * test/fileutils/test_verbose.rb: ditto git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34669 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/fileutils.rb (FileUtils::Entry_#entries): use utility methodnobu2011-12-281-1/+1
| | | | | | | instead of typoed regexp. [ruby-core:41829] [Bug #5817] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34146 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/fileutils.rb (module FileUtils): improve performance ofayumin2011-09-191-10/+7
| | | | | | | FileUtils.compare_stream. a patch by Masaki Matsushita. [Feature #5337] [ruby-core:39622] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33297 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/fileutils.rb: Document block behavior of FileUtils.cd. Patch bydrbrain2011-05-221-0/+4
| | | | | | | Bil Kleb. [Ruby 1.9 - Bug 4751] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31684 b2dd03c8-39d4-4d8f-98ff-823fe69b080e