Skip to content
This repository was archived by the owner on Jan 18, 2018. It is now read-only.

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 
 
 

README.md

DrEdit for Ruby

A walkthrough and more details are available on Google Drive SDK docs.

Setup Instructions

  1. Clone DrEdit's git repo and init submodules:

    git clone git@github.com:googledrive/dredit.git && cd dredit
    git submodule init
    git submodule update --recursive
    
  2. Create an API project in the Google APIs Console.

  3. Select the Services tab in your API Project, and enable the Drive API and Drive SDK.

  4. Select the API Access tab in your API Project, click Create an OAuth 2.0 client ID.

  5. In the Branding Information section, provide a name for your application (e.g. "DrEdit"), and click Next. Providing a product logo or a homepage URL is optional.

  6. In the Client ID Settings section, do the following:

    1. Select Web application for the Application type
    2. Click the more options link next to the heading, Your site or hostname.
    3. List the URI of your application's URL in the Authorized Request URIs and JavaScript Origins fields.
    4. Click Create Client ID.
  7. Register DrEdit as described in Enable the Drive SDK using the following values:

    1. Set the default MIME types text/plain and text/html, and the default extensions txt and html.
    2. Ensure that the set of redirect URIs includes the URI of your application. The same URL must be provided for the Open URL and Create URL fields.
    3. Add the Google API Scopes of https://www.googleapis.com/auth/userinfo.email, https://www.googleapis.com/auth/userinfo.profile and https://www.googleapis.com/auth/drive.install.
    4. For icons, use the example icons provided in the chromewebstore directory.
  8. Contents is on the ruby directory.

  9. Copy client_secrets.json.example to client_secrets.json, and edit it to replace the client_id, client_secret, and redirect_uris with the values from the Google APIs Console under the API Access tab for the project. Note: Make sure you use a valid Client ID for web applications. Do not use the Client ID for Drive SDK, which is reserved for future feature development.

  10. Run bundle install to ensure the requisite gems are installed.

  11. Run bundle exec ruby main.rb to start the app. Add -p <port> to override the default port if necessary.

  12. Test the application.

  13. Continue reading to find out how DrEdit is constructed, and how to modify it to work for your own application's needs.