Sha256: a1fefb977c376e4e612301cf5d3ad61cdaf830b828371b72790edb650a29e075

Contents?: true

Size: 579 Bytes

Versions: 24

Compression:

Stored size: 579 Bytes

Contents

module Datapimp::DataSync
  def self.sync_google_spreadsheet(options, *args)
    require 'google_drive' unless defined?(::GoogleDrive)

    raise 'Must setup google client' unless Datapimp::Sync.google.spreadsheets

    key = args.shift
    name = args.shift || "Spreadsheet"

    raise 'Must supply a spreadsheet key' unless key

    spreadsheet = Datapimp::Sources::GoogleSpreadsheet.new(name, key: key)

    if options.output
      Pathname(options.output).open("w+") do |fh|
        fh.write(spreadsheet.to_s)
      end
    else
      puts spreadsheet.to_s
    end
  end
end

Version data entries

24 entries across 24 versions & 1 rubygems

Version Path
datapimp-1.0.29 lib/datapimp/cli/support/data_sync.rb
datapimp-1.0.28 lib/datapimp/cli/support/data_sync.rb
datapimp-1.0.27 lib/datapimp/cli/support/data_sync.rb
datapimp-1.0.26 lib/datapimp/cli/support/data_sync.rb
datapimp-1.0.25 lib/datapimp/cli/support/data_sync.rb
datapimp-1.0.24 lib/datapimp/cli/support/data_sync.rb
datapimp-1.0.23 lib/datapimp/cli/support/data_sync.rb
datapimp-1.0.22 lib/datapimp/cli/support/data_sync.rb
datapimp-1.0.21 lib/datapimp/cli/support/data_sync.rb
datapimp-1.0.20 lib/datapimp/cli/support/data_sync.rb
datapimp-1.0.15 lib/datapimp/cli/support/data_sync.rb
datapimp-1.0.14 lib/datapimp/cli/support/data_sync.rb
datapimp-1.0.13 lib/datapimp/cli/support/data_sync.rb
datapimp-1.0.12 lib/datapimp/cli/support/data_sync.rb
datapimp-1.0.11 lib/datapimp/cli/support/data_sync.rb
datapimp-1.0.10 lib/datapimp/cli/support/data_sync.rb
datapimp-1.0.9 lib/datapimp/cli/support/data_sync.rb
datapimp-1.0.8 lib/datapimp/cli/support/data_sync.rb
datapimp-1.0.6 lib/datapimp/cli/support/data_sync.rb
datapimp-1.0.5 lib/datapimp/cli/support/data_sync.rb