https://github.com/mikz/space_monkey
Ruby Client for Space Monkey API
https://github.com/mikz/space_monkey
Last synced: 12 days ago
JSON representation
Ruby Client for Space Monkey API
- Host: GitHub
- URL: https://github.com/mikz/space_monkey
- Owner: mikz
- License: mit
- Created: 2014-07-23T08:43:04.000Z (almost 11 years ago)
- Default Branch: master
- Last Pushed: 2014-07-31T09:15:11.000Z (almost 11 years ago)
- Last Synced: 2025-05-07T13:06:40.104Z (12 days ago)
- Language: Ruby
- Size: 219 KB
- Stars: 9
- Watchers: 2
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# SpaceMonkey [](https://travis-ci.org/mikz/space_monkey) [](https://coveralls.io/r/mikz/space_monkey)
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](https://www.kickstarter.com/projects/clintgc/space-monkey-taking-the-cloud-out-of-the-datacente) 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
```ruby
client = SpaceMonkey::Client.new
client.login('[email protected]', '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
```ruby
client = SpaceMonkey::Client.new
client.account.login('[email protected]', '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
- [x] Downloads
- [x] Uploads
- [x] Thumbnails
- [x] Sharing
- [ ] Moving
- [ ] Deleting
- [ ] Bulk Actions## TODO
1. figure out how to stream files
httpclient allows it, but faraday does not
2. create fake server for testing## Contributing
1. Fork it ( https://github.com/mikz/space_monkey/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 a new Pull Request