lib/curve_importer.rb
# Copies the source CSV file to the given +to+ path, converting Windows CRLF
# line endings to Unix LF.
Copies the source CSV file to the given +to+ path, converting Windows CRLF
line endings to Unix LF.
Copies the source CSV file to the given + to + path converting Windows CRLF line endings to Unix LF .
def cp_csv(to, from)
    if to.directory? || ! to.to_s.match(/\.(csv|ad)$/)
      to = to.join(from.basename)
    end
    to.parent.mkpath unless to.parent.directory?
    File.write(to, File.read(from).gsub(/\r\n/, "\n"))
  end
def cp_csv ( to , from ) if to . directory? || ! to . to_s . match ( / \. (csv|ad)$ / ) to = to . join ( from . basename ) end to . parent . mkpath unless to . parent . directory? File . write ( to , File . read ( from ) . gsub ( / \r \n / , "\n" ) ) end
Copies the source CSV file to the given +to+ path, converting Windows CRLF
line endings to Unix LF.
Copies the source CSV file to the given + to + path converting Windows CRLF line endings to Unix LF .
to
<not_specific>
from
<not_specific>