seaweedrb
a seaweed-fs ruby client
getting started
Run gem install seaweedrb
or include it in your project's Gemfile.
require 'seaweed'
Seaweed.connect host: "localhost", port: 9333
operations
# upload a file
file = Seaweed.upload "/path/to/test.txt"
# file methods
file.id # => "1,01766888e0"
file.pretty_url # => "http://localhost:8080/1/01766888e0/test.txt"
file.url # => "http://localhost:8080/1,01766888e0"
file.read # => "hello world!"
file.name # => "test.txt"
# find a file and delete it
file = Seaweed.find "1,01766888e0"
file.delete!