pogoplug

A simple Ruby wrapper on the PogoPlug API - download.pogoplug.com/dev/web.html

<img src=“https://travis-ci.org/trumant/pogoplug.png” />

Structured API Operations Supported

  • getVersion

  • loginUser

  • listDevices

  • listServices

  • listFiles

  • createFile

  • removeFile

Stream API Operations Supported

  • PUT - via PogoPlug::Client.create_file passing an IO

  • GET - via PogoPlug::Client.download

Examples

Retrieve the first page of files and folders from the root of a device and service

client = PogoPlug::Client.new
client.("[email protected]", "some_password")

devices = client.devices

fileListing = client.files(devices.first.id, devices.first.services.first.id)
fileListing.files

Write a file to PogoPlug and then download it

client = PogoPlug::Client.new
client.("[email protected]", "some_password")
devices = client.devices

parent_directory = client.files(devices.first.id, devices.first.services.first.id).files.select { |file| file.directory? }.first
file_to_create = PogoPlug::File.new(name: 'your_file_name.txt', type: File::Type::FILE, parent_id: parent_directory.id)

uploaded_file = client.create_file(devices.first.id, devices.first.services.first, file_to_create, File.open('your_file_name.txt', 'r'))

downloaded_file = client.download(devices.first.id, devices.first.services.first, uploaded_file)

Contributing to pogoplug

  • Check out the latest master to make sure the feature hasn’t been implemented or the bug hasn’t been fixed yet.

  • Check out the issue tracker to make sure someone already hasn’t requested it and/or contributed it.

  • Fork the project.

  • Start a feature/bugfix branch.

  • Commit and push until you are happy with your contribution.

  • Make sure to add tests for it. This is important so I don’t break it in a future version unintentionally.

  • Please try not to mess with the Rakefile, version, or history. If you want to have your own version, or is otherwise necessary, that is fine, but please isolate to its own commit so I can cherry-pick around it.

Copyright © 2013 Travis Truman. See LICENSE.txt for further details.