SpaceMonkey
Ruby Client for Space Monkey API.
Experimental. Space Monkey API is not public yet and it can change any time.
What is Space Monkey?
Space Monkey (https://www.spacemonkey.com/) is a 1TB Hard Drive with cloud backup. When your device is offline, you can access to the files distributed in cloud network. Their Kickstarter page has great video explaining what they do.
Installation
Add this line to your application's Gemfile:
gem 'space_monkey'
And then execute:
$ bundle
Or install it yourself as:
$ gem install space_monkey
Usage
Downloading a file
client = SpaceMonkey::Client.new
client.login('email@example.com', 'password')
photos = client.inode.path('Photos')
first_photo = client.photos.entries.first
File.open(first_photo.name, 'wb') do |file|
file.write client.file.download(first_photo, network_reads: true)
end
Uploading a file
client = SpaceMonkey::Client.new
client.account.login('email@example.com', 'password')
photos = client.inode.home
file = client.file.new(name: 'somefile.jpg')
io = File.open('to_upload.jpg')
uploaded = client.file.upload(file, inode, io)
What is supported
- Downloads
- Uploads
- Thumbnails
- Sharing
- Moving
- Deleting
- Bulk Actions
TODO
- figure out how to stream files httpclient allows it, but faraday does not
- create fake server for testing
Contributing
- Fork it ( https://github.com/mikz/space_monkey/fork )
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create a new Pull Request