Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

dropbox-sdk-v2

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

dropbox-sdk-v2

  • 0.0.3
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source

Dropbox SDK for Ruby

Gem Version Build Status MIT licensed

This is a small Ruby library for accessing the new Dropbox API. It provides a single class, Dropbox::Client, with methods that map to most of the Dropbox API endpoints. Currently all of the endpoints in the auth, files, and users namespaces are supported. Sharing methods are planned.

Requirements

  • Ruby 2.1.0 or later
  • The http gem

Installation

Run:

gem install dropbox-sdk-v2

Then, in your source files:

require 'dropbox'

Or just add this to your Gemfile:

gem 'dropbox-sdk-v2'

Usage

Also see the full YARD documentation.

Set up a client:

require 'dropbox'

dbx = Dropbox::Client.new(ENV['DROPBOX_ACCESS_TOKEN'])

Create a folder:

folder = dbx.create_folder('/myfolder') # => Dropbox::FolderMetadata
folder.id # => "id:a4ayc_80_OEAAAAAAAAAXz"
folder.name # => "myfolder"
folder.path_lower # => "/myfolder"

Upload a file:

# File body can be a String, File, or any Enumerable.
file = dbx.upload('/myfolder/file.txt', 'file body') # => Dropbox::FileMetadata
file.size # => 9
file.rev # => a1c10ce0dd78

Download a file:

file, body = dbx.download('/myfolder/file.txt') # => Dropbox::FileMetadata, HTTP::Response::Body
body.to_s # => "file body"

Delete a file:

dbx.delete('/myfolder/file.txt') # => Dropbox::FileMetadata

Contributing

All contributions are welcome. Please file an issue or submit a pull request.

This project strives for full test coverage. To run the test suite, make a Dropbox App with "app folder" access and generate an access token. Then run DROPBOX_SDK_ACCESS_TOKEN="..." rake test.

FAQs

Package last updated on 02 Jul 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc