Dropscreen

A gem to sync screenshot files with Dropbox

Installation

Add this line to your application's Gemfile:

gem 'dropscreen'

And then execute:

$ bundle

Or install it yourself as:

$ gem install dropscreen

Authentication

You need to setup an app in dropbox and get a dropbox access token. Instructions are here: https://www.dropbox.com/developers/core/start/ruby

Usage

export the dropbox access token as an environment variable:

export DROPBOX_ACCESS_TOKEN=**insert dropbox access token here**

In your code

require 'dropscreen'

This uses the token from the environment variable and sets the root dir local and remote to be the local app dir and the permitted dropbox dir respectively.

dropscreen_client = Dropscreen::Client.new

Alternatively, you can pass in a hash with one or more of these options:

client = Dropscreen::Client.new(
  remote_base_dir: 'remote_base_dir',
  local_base_dir: 'local_base_dir'
)

Pulling files from dropbox

client.pull('some_folder'[, 'dest_folder'])

The destination folder will by default be the same name as the source folder, alternatively you can pass in a destination folder as the second param.

Pushing files to dropbox

client.push('some_folder'[, 'dest_folder'])

The destination folder will by default be the same name as the source folder, alternatively you can pass in a destination folder as the second param.

Remove files/folders from dropbox

client.remove(path)

Contributing

  1. Fork it ( http://github.com//dropscreen/fork )
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request