Граф коммитов

142 Коммитов

Автор SHA1 Сообщение Дата
hsbt ac210750df * lib/fileutils.rb: enable to remove with non-owner directory.
[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
2014-08-12 04:36:31 +00:00
hsbt 0210b487a4 * lib/fileutils.rb: fix typo.
[ruby-dev:47831] [Bug #9180]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47148 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-08-12 03:21:57 +00:00
hsbt 2de10af779 * lib/fileutils.rb: added missing options of FileUtils.touch by @Domon.
[fix GH-669]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46856 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-07-18 01:16:12 +00:00
hsbt c2eac0e78c * lib/fileutils.rb: handle ENOENT error with symlink targeted to
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
2014-07-11 07:51:19 +00:00
ayumin 529461dff7 * lib/fileutils.rb: show fileutils require at top.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45880 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-05-08 18:32:24 +00:00
akr 17a4a9b993 * lib/fileutils.rb: Don't need to define fu_get_gid and fu_get_gid in
rescue LoadError on 'etc'.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45743 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-04-29 03:51:13 +00:00
ngoto 1377f38c9b * lib/fileutils.rb (rmdir): rescue Errno::EEXIST in addition to
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
2014-04-25 14:28:56 +00:00
usa 3c00fe9f41 * lib/fileutils.rb (fu_get_uid, fu_get_gid): Etc.getpwnam/getgrnam may
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
2014-04-24 14:19:21 +00:00
nobu 52ca908819 fileutils.rb: [DOC] update rdoc
* 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
2014-04-17 01:03:55 +00:00
zzak d89e8fb53a * lib/fileutils.rb: [DOC] Fix typo in options_of() example [Bug #9392]
Patch by Giorgos Tsiftsis


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44688 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-01-23 05:28:36 +00:00
hsbt 94ebcc4aa7 * fix typo by @rrrene [fix GH-510]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44679 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-01-22 06:22:06 +00:00
nobu a8aefef874 fileutils.rb: rmdir parents option
* 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
2013-12-24 16:56:31 +00:00
hsbt 218755f306 * lib/fileutils.rb: remove unnecessary initialization. by @vipulnsward [fix GH-463]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44048 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-12-07 10:25:33 +00:00
a_matsuda 4f5d3c5e53 * lib/fileutils.rb: [DOC] Fix typo (s/perserve/preserve/)
[ci skip]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43936 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-11-30 14:41:55 +00:00
zzak c366a99cc5 * lib/cgi.rb: [DOC] Capitalize "Ruby" in documentation [Fixes GH-341]
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
2013-07-18 13:50:32 +00:00
knu 1e2a6a20e5 * lib/fileutils.rb (FileUtils#chown_R): Do not skip traversal even
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
2013-07-09 09:03:36 +00:00
knu a6e3d4bea0 * lib/fileutils.rb (FileUtils#mode_to_s): Define mode_to_s() also
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
2013-07-09 07:02:04 +00:00
knu 02f61f874a * lib/fileutils.rb (FileUtils#chown, FileUtils#chown_R): If user
and group are both nil, print ":".

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41851 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-07-09 07:01:59 +00:00
knu 9b9654c3c3 * lib/fileutils.rb (FileUtils#chown, FileUtils#chown_R): Fix the
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
2013-07-05 10:07:41 +00:00
knu a0011cd54d * lib/fileutils.rb (FileUtils.chmod{,_R}): Enhance the symbolic
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
2013-07-04 17:22:08 +00:00
knu 45116b6a6d * lib/fileutils.rb (FileUtils#symbolic_modes_to_i): Fix the wrong
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
2013-07-04 17:22:05 +00:00
nobu 4b5267018a fileutils.rb: fix traversal loop
* 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
2013-06-13 13:12:35 +00:00
kazu 1739ecda3b FileUtils.rmdir use remove_tailing_slash
* 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
2013-06-03 15:01:42 +00:00
ayumin cef3f2ebd4 * lib/fileutils.rb: fix behavior when mkdir/mkdir_p accepted "/".
* 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
2013-06-03 14:20:15 +00:00
drbrain 874f8c0494 * lib/fileutils.rb: Revert r34669 which altered the way
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
2013-03-01 02:09:42 +00:00
mame 7dc77be299 * lib/fileutils.rb (copy_entry, wrap_traverse): preserve attributes of
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
2013-02-02 03:54:00 +00:00
mame 4077b9b89d * lib/fileutils.rb: chmod/chmod_R with a string mode (e.g., "+x")
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
2013-02-02 03:07:17 +00:00
zzak c8b0b5362c * lib/fileutils.rb (chmod): Add "X" to modes, convert format to table
[ruby-core:48965] [Bug #7288]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37652 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-11-14 04:26:20 +00:00
glass 2142287c86 * lib/fileutils.rb (module FileUtils): repatch [ruby-core:39622]
[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
2012-11-04 02:56:11 +00:00
ayumin 6eb316780f * lib/fileutils.rb: fix typo.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36727 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-08-18 15:55:15 +00:00
ayumin e6021a1be2 * lib/fileutils.rb (uptodate?): remove useless parameter.
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
2012-07-16 08:15:05 +00:00
drbrain dfa9522c33 * lib/fileutils.rb (cp_r): Fixed cp_r example. Patch by TJ Koblentz
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
2012-05-11 21:02:58 +00:00
akr 7d89ecdc52 * lib/fileutils.rb (copy_metadata): use File.lchown and File.lchmod to
update meta data of symlinks.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35499 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-04-30 14:37:54 +00:00
akr 5e3009aa45 * lib/fileutils.rb (fu_have_symlink?): specify TypeError for rescue
clause.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34987 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-03-12 11:09:11 +00:00
nobu 1100fdfc65 * lib/fileutils.rb: remove tailing spaces.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34975 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-03-11 21:48:45 +00:00
naruse 9a93699a49 * lib/fileutils.rb: use chomp(?/) instead of sub to optimize and avoid
to regexping invalid string.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34809 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-02-25 08:08:55 +00:00
shirosaki 5cfba33a77 * lib/fileutils.rb: revert a line modified accidentally at r34669.
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
2012-02-20 12:30:11 +00:00
tenderlove ace46301d8 * lib/fileutils.rb: refactored FileUtil methods to use the
`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
2012-02-17 17:59:47 +00:00
nobu 6a6c314fd0 * lib/fileutils.rb (FileUtils::Entry_#entries): use utility method
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
2011-12-28 02:22:52 +00:00
ayumin 6ec841b2df * lib/fileutils.rb (module FileUtils): improve performance of
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
2011-09-19 10:34:30 +00:00
drbrain 55aa4dce3b * lib/fileutils.rb: Document block behavior of FileUtils.cd. Patch by
Bil Kleb.  [Ruby 1.9 - Bug 4751]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31684 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-05-22 02:12:15 +00:00
drbrain 57580b76e8 * lib/fileutils.rb: Hide internal methods from RDoc. Patch by Darragh
Curran.  [Ruby 1.9 - Bug #4684]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31541 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-05-12 22:49:40 +00:00
kosaki 0a1e7d1568 * lib/fileutils.rb (FileUtils#chmod): accept symbolic mode argument.
The patch was written by takkanm. [ruby-core:26029][Feature #2190]

* lib/fileutils.rb (FileUtils#fu_mode): new helper function.
* lib/fileutils.rb (FileUtils#symbolic_modes_to_i): ditto.
* lib/fileutils.rb (FileUtils#mode_mask): ditto.
* lib/fileutils.rb (FileUtils#user_mask): ditto.

* test/fileutils/test_fileutils.rb (TestFileUtils#test_chmod_symbol_mode):
  new test for the above symbolic mode.
* test/fileutils/test_fileutils.rb (TestFileUtils#test_chmod_R): ditto.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31407 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-05-01 16:16:05 +00:00
knu 6692ef3c54 * lib/fileutils.rb (FileUtils#touch): Fix corrupted output when
:mtime is specified in addition to :nocreate (and :verbose).
  ref [ruby-dev:43401]




git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31287 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-04-15 06:05:25 +00:00
kosaki 8c5961f6f9 * lib/fileutils.rb (FileUtils#touch): fix corrupted output when
FileUtils.touch(:nocreate => true, :verbose => true) case.
  The patch was written by Hiroyuki Iwatsuki. [ruby-dev:43401]



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31273 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-04-14 10:58:10 +00:00
nobu c7837ed8d3 * lib/fileutils.rb (FileUtils::Entry_#copy_file): updated FileUtils.cp
to still copy file permissions when :preserve is false (as cp does
  this even when -p isn't set).

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31123 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-03-17 23:48:13 +00:00
shyouhei c1afbd39e1 * lib/fileutils.rb (FileUtils::remove_entry_secure): there is a
race condition in the case where the given path is a directory,
  and some other user can move that directory, and create a
  symlink while this method is executing.
  Reported by: Nicholas Jefferson <nicholas at pythonic.com.au>


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30896 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-02-18 10:42:50 +00:00
nobu 780678dafb * lib/fileutils.rb (FileUtils::LowMethods): make low level methods
in NoWrite and DryRun to do nothing.  [ruby-dev:43129]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30787 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-02-04 18:37:52 +00:00
nobu 878384483d * lib/fileutils.rb (FileUtils::Entry_#copy): check file name
spearator boundary.  [ruby-core:31360]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28685 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-07-20 03:27:59 +00:00
marcandre 4349da9c1b * lib/fileutils.rb: Fix warning
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28382 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-06-22 05:46:01 +00:00