lib/batch_audio_convert/file_utils.rb
# Define destination name and transformation method to apply for a file.
Define destination name and transformation method to apply for a file.
Define destination name and transformation method to apply for a file .
def analyze_file(file)
    method_name = :default_copy
    destination_file = String.new(file)
    config[:extensions].each do |origin_ext, destination_ext|
      origin_ext = origin_ext.to_s
      destination_ext = destination_ext.to_s
      if file =~ /\.#{origin_ext}$/i
        destination_file.gsub! /\.#{origin_ext}$/i, ".#{destination_ext}"
        method_name = origin_ext + '_to_' + destination_ext
        break
      end
    end
    replace_folder_in_destination! destination_file
    return {:method_name => method_name, :destination_file => destination_file}
  end
def analyze_file ( file ) method_name = :default_copy destination_file = String . new ( file ) config [ :extensions ] . each do | origin_ext , destination_ext | origin_ext = origin_ext . to_s destination_ext = destination_ext . to_s if file =~ / \. #{ origin_ext } $ /i destination_file . gsub! / \. #{ origin_ext } $ /i , ".#{destination_ext}" method_name = origin_ext + '_to_' + destination_ext break end end replace_folder_in_destination! destination_file return { :method_name => method_name , :destination_file => destination_file } end
Define destination name and transformation method to apply for a file.
Define destination name and transformation method to apply for a file .
file