lib/legacy_converter.rb
# Converts the given file and stores it in the legacy directory
# @param action [String] the conversion to perform
# @param orig_content [String] the body of the file to convert
# @param language [String] the file's language
# @return [String] the path to the converted file
Converts the given file and stores it in the legacy directory
Converts the given file and stores it in the legacy directory
def convert_file action, orig_content, language='en'
      content = Heathen::Converter.new.convert(action, orig_content, language)
      filename = Digest::SHA2.hexdigest content
      store_file filename, content
      (@legacy_dir.basename + filename).to_s
    end
def convert_file action , orig_content , language = 'en' content = Heathen :: Converter . new . convert ( action , orig_content , language ) filename = Digest :: SHA2 . hexdigest content store_file filename , content ( @legacy_dir . basename + filename ) . to_s end
Converts the given file and stores it in the legacy directory
Converts the given file and stores it in the legacy directory
the path to the converted file
the path to the converted file
String
action
the conversion to perform
the conversion to perform
orig_content
the body of the file to convert
the body of the file to convert
language
the file's language
the file ' s language