Class: Command

Inherits:
Thor
  • Object
show all
Includes:
Thor::Actions
Defined in:
lib/csvconverter/command.rb

Direct Known Subclasses

CSV2StringsCommand, Strings2CSVCommand

Instance Method Summary collapse

Instance Method Details

#csv_downloadObject



9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# File 'lib/csvconverter/command.rb', line 9

def csv_download
  filename = options['gd_filename']
  gd = GoogleDoc.new
  if options['output_filename']
    file_path = gd.download filename.to_s, options['output_filename']      
  else
    file_path = gd.download filename.to_s
  end
  if file_path
    say "File '#{filename}' downloaded to '#{file_path}'"
  else
    say "Could not download the requested file: #{filename}"
  end
  file_path
end