lib/onix/code_list_extractor.rb
# generate a set of TSV files in the given directory. Creates the directory
# if it doesn't exist and will overwrite existing files.
#
generate a set of TSV files in the given directory. Creates the directory
if it doesn't exist and will overwrite existing files.
generate a set of TSV files in the given directory . Creates the directory if it doesn ' t exist and will overwrite existing files .
def run(dir)
      FileUtils.mkdir_p(dir) unless File.directory?(dir)
      each_list do |number, data|
        file = number.to_s.rjust(3, "0") + ".tsv"
        path = File.join(dir, file)
        File.open(path, "w") { |f| f.write data}
      end
    end
def run ( dir ) FileUtils . mkdir_p ( dir ) unless File . directory? ( dir ) each_list do | number , data | file = number . to_s . rjust ( 3 , "0" ) + ".tsv" path = File . join ( dir , file ) File . open ( path , "w" ) { | f | f . write data } end end
generate a set of TSV files in the given directory.
generate a set of TSV files in the given directory .
#puts number
dir