Top Level Namespace

Includes:
Digest, FileUtils::Verbose

Defined Under Namespace

Modules: ID3 Classes: AudioFile, File, Hash, IO, RestrictedOrderedHash, String

Constant Summary collapse

ZEROBYTE =
"\0"

Instance Method Summary collapse

Instance Method Details

#move(a, b) ⇒ Object



39
40
41
# File 'lib/helpers/ruby_1.8_1.9_compatibility.rb', line 39

def move(a,b)
  File.move(a,b)
end

#recursive_dir_descend(dir, regexp, action) ⇒ Object


recursiveDirectoryDescend

do action for files matching regexp

could be extended to array of (regexp,action) pairs


10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
# File 'lib/helpers/recursive_helper.rb', line 10

def recursive_dir_descend(dir,regexp,action)
 # print "dir : #{dir}\n"

  olddir = Dir.pwd
  dirp = Dir.open(dir)
  Dir.chdir(dir)
  pwd = Dir.pwd
  @dirN += 1

  for file in dirp
    file.chomp
    next if file =~ /^\.\.?$/
    filename = "#{pwd}/#{file}"

    if File::directory?(filename)
       recursive_dir_descend(filename,regexp,action)
    else
       @fileN += 1
       if file =~ regexp
           # evaluate action
           eval action
       end
    end
  end
  Dir.chdir(olddir)
end