lib/file/find.rb in file-find-0.3.5 vs lib/file/find.rb in file-find-0.3.6

- old
+ new

@@ -1,7 +1,6 @@ require 'date' -require 'rbconfig' # For alternate implementations of Ruby, such as JRuby, that cannot # build C extensions fall back to the Etc module. begin require 'sys/admin' @@ -9,11 +8,11 @@ require 'etc' end class File::Find # The version of the file-find library - VERSION = '0.3.5' + VERSION = '0.3.6' # :stopdoc: VALID_OPTIONS = %w/ atime ctime @@ -232,11 +231,10 @@ if prune_regex next if prune_regex.match(file) end - orig = file.dup file = File.join(path, file) stat_method = @follow ? :stat : :lstat # Skip files we cannot access, stale links, etc. @@ -345,11 +343,11 @@ else next unless stat_info.gid == @group end end - unless Config::CONFIG['host_os'] =~ /windows|mswin/i + unless File::ALT_SEPARATOR if @inum next unless stat_info.ino == @inum end end @@ -459,13 +457,13 @@ cmds.each do |cmd| match = cmd.match(regex) raise "Invalid symbolic permissions: '#{str}'" if match.nil? - junk, who, what, how = match.to_a + who, what, how = match.to_a[1..-1] - who = who.split(//).inject(who_num=0){ |num,b| num |= left[b]; num } - how = how.split(//).inject(how_num=0){ |num,b| num |= right[b]; num } + who = who.split(//).inject(0){ |num,b| num |= left[b]; num } + how = how.split(//).inject(0){ |num,b| num |= right[b]; num } mask = who & how case what when '+' perm = perm | mask