0.0
No commit activity in last 3 years
No release in over 3 years
A simple gem for processing documents to html with google drive
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.3
>= 0
>= 0

Runtime

 Project Readme

GoogleDriver

A ruby gem for processing word and other common document formats to html using google drive's api

Using this gem

GoogleDriver::Api

The api object needs three values to be initalized:

oauth_scope:  (ex: https://www.googleapis.com/auth/drive)
issuer:       Privided by Google's api console (ex: 1111111111@developer.gserviceaccount.com)
p12_path:     Path to your Google provided API private key (ex: ./c37373737373737...-privatekey.p12)

api = GoogleDriver::Api.new(PRIVATE['scope'], PRIVATE['issuer'], PRIVATE['p12_path'])

Usage

doc = api.upload('./path/to/file')
mimetype = api.detect_mimetype('./path/to/file')
docs = api.upload_files(['./path/to/fileA', './path/to/fileB', './path/to/fileC'])
# => [Document(FileA), Document(FileB), Document(FileC)]

GoogleDriver::Document

Document instances are emitted by api.upload() and represent a document uploaded to Google Drive. The Document can be exported from Google in a number of export formats depending on the original filetype.

Usage

doc.list  # returns the available mimetypes that can be downloaded from Google Drive for this file
doc.download(mimety