aboutsummaryrefslogtreecommitdiffstats
path: root/test/ruby/test_dir.rb
Commit message (Collapse)AuthorAgeFilesLines
* Revert "Dir.glob with FNM_EXTGLOB is optimized [Feature #13873]"naruse2017-10-271-4/+4
| | | | | | | | This reverts commit r60341,r60342,r60344,r60345. Breaking compabitility of the order of result breaks many tests. To avoid such effort to fix tests, the order should be kept. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60478 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* sort test resultnaruse2017-10-221-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60344 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* sort the test resultnaruse2017-10-221-2/+2
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60342 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Dir.glob with FNM_EXTGLOB is optimized [Feature #13873]naruse2017-10-221-1/+1
| | | | | | The order of resulted array is changed in some cases. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60341 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Revert "ignore server side error"naruse2017-10-211-1/+1
| | | | | | This reverts commit r60314. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60315 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* ignore server side errornaruse2017-10-211-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60314 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Revert "Dir.glob with FNM_EXTGLOB is optimized [Feature #13873]"naruse2017-10-211-1/+1
| | | | | | This reverts commit r60253 because it causes on error on Linux. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60255 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Dir.glob with FNM_EXTGLOB is optimized [Feature #13873]naruse2017-10-211-1/+1
| | | | | | The order of resulted array is changed in some cases. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60253 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Use the same variable name as in dir.ckazu2017-08-031-2/+2
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59487 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* dir.c: relative path Dir basenobu2017-08-031-0/+2
| | | | | | | * dir.c (glob_helper): fix globbing based on a relative path Dir. [Feature #13056] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59479 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* dir.c: relax base optionnobu2017-08-031-0/+3
| | | | | | | * dir.c (dir_glob_options): relax base option. ignore when nil or an empty string as :base option. [Feature #13056] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59476 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* dir.c: yield without base partnobu2017-05-261-4/+4
| | | | | | | * dir.c (glob_helper): yield globbed part only without the base directory path part if the base is given. [Feature#13056] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58901 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* dir.c: Dir.each_child and Dir.childrennobu2017-05-251-2/+12
| | | | | | | | * dir.c (dir_s_each_child, dir_s_children): Dir.each_child and Dir.children which are similar to Dir.foreach and Dir.entries respectively, except to exclude "." and "..". [Feature #11302] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58879 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* test_dir.rb: test Dir.entriesnobu2017-05-251-0/+1
| | | | | | | * test/ruby/test_dir.rb (test_entries): test class singleton method Dir.entries too. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58878 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Dir as base optionnobu2017-05-231-0/+6
| | | | | | | * dir.c (glob_helper): support Dir instance as `base` option. [Feature#13056] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58860 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* test_dir.rb: sortnobu2017-05-231-1/+1
| | | | | | | * test/ruby/test_dir.rb (test_glob_base): sort the globbed result to compare. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58859 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Dir.glob base optionnobu2017-05-231-0/+6
| | | | | | | * dir.c (dir_s_aref, dir_s_glob): add new optional keyword argument, `base`. [Feature#13056] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58858 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* dir.c: err at glob failurenobu2017-03-271-0/+18
| | | | | | | | | | | | | * dir.c (glob_helper): raise a SystemCallError exception when opendir() failed, except for ENOENT, ENOTDIR, and EACCES. this behavior predates 1.0; the comments in glob.c claimed that glob() returned -1 on error but actualy the pointer to a global variable, then dir_glob() did check only -1 as the comments, and ignored actual errors. [ruby-core:80226] [Bug #13276] dir.c: ruby_glob_funcs_t git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58156 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* file.c: home directory from systemnobu2016-11-261-2/+0
| | | | | | | * file.c (rb_default_home_dir): resolve home directory from the system database when HOME is not set. [Feature #12695] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56902 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* fix r56467nobu2016-10-211-1/+1
| | | | | | | * test/ruby/test_dir.rb (test_glob_gc_for_fd): needs RLIMIT_NOFILE. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56468 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* dir.c: retry glob with GCnobu2016-10-211-0/+14
| | | | | | | * dir.c (do_opendir): retry after GC when the limit for open file descriptors reached. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56467 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* file.c: home dir fall backnobu2016-05-081-0/+4
| | | | | | | | | * file.c (rb_home_dir_of): return the default home path if the user name is the current user name, on platforms where struct pwd is not supported. a temporary measure against [Bug #12226]. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54947 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* test_dir.rb: Dir.empty? with directoriesnobu2016-02-171-0/+4
| | | | | | * test/ruby/test_dir.rb (test_empty): check with directories. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53862 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* test_dir.rb: Dir.empty? with dot filenobu2016-02-171-9/+8
| | | | | | * test/ruby/test_dir.rb (test_empty): check with a dot file. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53861 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * test/ruby/test_dir.rb (TestDir#test_empty?): fix a platform dependent test.usa2016-02-171-1/+8
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53857 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* dir.c: Dir.empty?nobu2016-02-161-0/+9
| | | | | | | * dir.c (rb_dir_s_empty_p): add Dir.empty? method, which tells the argument is the name of an empty directory. [Feature #10121] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53841 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
* dir.c: glob brace expansion [Fix GH-1061]nobu2015-10-221-0/+5
| | | | | | | | | * dir.c (ruby_brace_expand): glob brace expansion edge case fix. When there are closing braces '}' before a open brace '{' it must be ignored and considered as literal. [ruby-core:71138] [Bug #11609] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52212 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * test/ruby/test_dir.rb (TestDir#test_fileno): s/?x/"x"/. Don'tkosaki2015-09-171-10/+10
| | | | | | use tricky code, please. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51886 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* test: File.symlink needs administrator privilegenobu2015-08-281-2/+2
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51714 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * include/ruby/ruby.h: $SAFE=3 is now obsolete.hsbt2015-06-171-17/+0
| | | | | | | | | | | * ext/socket/init.c, ext/socket/socket.c, ext/socket/tcpsocket.c ext/socket/udpsocket.c, gc.c, object.c, re.c, safe.c: removed code for $SAFE=3 * bootstraptest/test_method.rb, test/erb/test_erb.rb, test/ruby/test_dir.rb test/ruby/test_file.rb, test/ruby/test_method.rb, test/ruby/test_regexp.rb test/ruby/test_thread.rb: remove tests for $SAFE=3 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50932 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* dir.c: FNM_SHORTNAMEnobu2015-06-031-2/+4
| | | | | | | | * dir.c (dirent_match): match short names only when FNM_SHORTNAME flag is given, for the backward compatibility, and the new behavior is often dangerous. [ruby-core:69435] [Bug #11206] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50760 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* test_dir.rb: recursive globbingnobu2015-04-011-1/+2
| | | | | | | * test/ruby/test_dir.rb (test_symlink): add an assertion for recursive globbing. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50146 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* test_dir.rb: assert_entriesnobu2015-03-311-3/+7
| | | | | | | * test/ruby/test_dir.rb (assert_entries): extract common assertinos for Dir.entries and Dir#foreach. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50139 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* test_dir.rb: test_entriesnobu2015-03-311-0/+5
| | | | | | * test/ruby/test_dir.rb (test_entries): test for Dir#entries. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50138 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* test_dir.rb: fix arguments ordernobu2015-03-311-1/+1
| | | | | | | * test/ruby/test_dir.rb (test_foreach): fix arguments order, the expected result should be first. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50137 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* dir.c: don't raise after closenobu2015-03-231-0/+1
| | | | | | | * dir.c (dir_close): don't raise on dobule close for consistent to IO#close. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50064 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* dir.c: glob short namesnobu2015-03-081-1/+5
| | | | | | | | | * dir.c (glob_helper): match patterns against legacy short names too, not only ordinary names. [ruby-core:67954] [Bug #10819] * win32/dir.h (struct direct): add short name members. * win32/win32.c (opendir_internal, readdir_internal): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49892 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* dir.c: glob legacy short namenobu2015-02-031-0/+12
| | | | | | | | * dir.c (glob_helper): obtain real name with FindFirstFile API instead of matchin all entries, on Windows. [ruby-core:67954] [Bug #10819] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49478 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* dir.c: replace_real_basenamenobu2014-12-251-10/+2
| | | | | | | | | | * dir.c (replace_real_basename): get the real name and replace the base name with it by getattrlist(2) if available. suggested by Matthew Draper at [ruby-core:67116]. [Bug #10015] * dir.c (glob_helper): get the real name of the whole path, not only the last name. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48990 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* safe.c: preserve encodingnobu2014-11-251-0/+17
| | | | | | | * safe.c (rb_secure): preserve encoding of the called method name in error messages. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48571 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * configure.in (dirfd): Check function.akr2014-09-041-0/+10
| | | | | | | | | * dir.c (dir_fileno): New method. [ruby-dev:48265] [Feature #9880] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47387 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * test/ruby/test_dir.rb: added testcase of double slash path.hsbt2014-05-201-0/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46031 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* dir.c: match plain names as-isnobu2014-05-161-0/+6
| | | | | | | | | * dir.c (glob_pattern_type): separate names with alphabet but no magical from plain. * dir.c (glob_helper): match plain names as-is to treat super-root same as the root. [ruby-core:61552] [Bug #9648] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45965 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* dir.c: glob cases on case-insensitive systemnobu2014-02-041-0/+21
| | | | | | | | * dir.c (glob_helper): return the filename with actual cases on the filesystem if it is case-insensitive. [ruby-core:42469] [Feature #5994] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44807 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Revert "dir.c: glob cases on case-insensitive system"naruse2014-02-041-21/+0
| | | | | | | | | | This reverts commit r44796. * dir.c (glob_helper): return the filename with actual cases on the filesystem if it is case-insensitive. [ruby-core:42469] [Feature #5994] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44801 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* dir.c: glob cases on case-insensitive systemnobu2014-02-031-0/+21
| | | | | | | | * dir.c (glob_helper): return the filename with actual cases on the filesystem if it is case-insensitive. [ruby-core:42469] [Feature #5994] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44796 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* test_dir.rb: fix system dependent testnobu2013-12-151-1/+6
| | | | | | | * test/ruby/test_dir.rb (test_symlinks_not_resolved): fix system dependent test which has no meanings unless symlink is available. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44223 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Additional test coverage to Dir class. Dir['**/*'] should not resolve symlinks.nobu2013-12-141-0/+12
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44200 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* dir.c: check unknown keywordsnobu2013-11-301-0/+7
| | | | | | | * dir.c (dir_initialize): check unknown keywords. [ruby-dev:47152] [Bug #8060] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43935 b2dd03c8-39d4-4d8f-98ff-823fe69b080e