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

157 Коммитов

Автор SHA1 Сообщение Дата
nobu e3503ee218 Octal mode in un.rb
* lib/fileutils.rb (FileUtils#symbolic_modes_to_i): revert r55524.

* lib/un.rb (install, chmod): support octal mode string.  fix up
  r55513.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55530 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-06-28 22:03:00 +00:00
arton f2f16f2a35 Tue Jun 28 22:09:09 2017 Akio Tajima <artonx@yahoo.co.jp>
* lib/fileutils.rb: rescue Errno:EACCES for chown.
	  [Bug #12520]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55525 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-06-28 13:14:48 +00:00
nobu d34b3c9a0f Octal mode
* lib/fileutils.rb (symbolic_modes_to_i): support octal mode
  string.  fix up r55513.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55524 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-06-28 12:33:28 +00:00
nobu 2a5183c2e4 FileUtils#install: symbolic mode
* lib/fileutils.rb (FileUtils#install): accecpt symbolic mode, as
  well as chmod.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55513 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-06-27 07:58:34 +00:00
nobu 10fcca8f15 FileUtils#install: owner/group options
* lib/fileutils.rb (FileUtils#install): add owner and group
  options.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55512 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-06-27 07:55:17 +00:00
nobu 71db7bd3d3 Refactor
* lib/fileutils.rb (FileUtils::Entry_#copy_metadata): eliminate
  common statements.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55511 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-06-27 01:24:46 +00:00
nobu baa43cd0c2 fileutils.rb: keyword arguments
* 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
2016-03-01 02:26:44 +00:00
nobu 52bdb3ce02 fileutils.rb: LowMethods aliases
* 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
2016-02-29 12:22:17 +00:00
nobu efa39c3dbd fileutils.rb: reduce private
* 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
2016-02-29 08:36:30 +00:00
nobu 6b3e5bb061 fileutils.rb: reduce public
* 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
2016-02-29 08:36:29 +00:00
nobu 13dadf3f26 fileutils.rb: unify method definition style
* 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
2016-02-29 08:36:28 +00:00
naruse 3e92b635fb Add frozen_string_literal: false for all files
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
2015-12-16 05:07:31 +00:00
hsbt d7908f9a9c * lib/fileutils.rb: rename tailing to trailing.
[Misc #11548]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52285 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-10-26 08:30:20 +00:00
nobu 74842faf64 fileutils.rb: fix rename_cannot_overwrite_file
* 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
2015-08-26 16:05:39 +00:00
nobu 676fe089bd fileutils.rb: fix error message
* 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
2015-04-01 00:59:14 +00:00
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