7 http://rubyforge.org/projects/seattlerb/
11 http://seattlerb.org/mogilefs-client
15 http://rubyforge.org/tracker/?func=add&group_id=1513&atid=5921
19 A Ruby MogileFS client. MogileFS is a distributed filesystem written
20 by Danga Interactive. This client supports NFS and HTTP modes.
22 For information on MogileFS see:
24 http://danga.com/mogilefs/
26 == Installing mogilefs-client
28 First you need a MogileFS setup. You can find information on how to do that at the above URL.
32 $ sudo gem install mogilefs-client
34 == Using mogilefs-client
36 # Create a new instance that will communicate with these trackers:
37 hosts = %w[192.168.1.69:6001 192.168.1.70:6001]
38 mg = MogileFS::MogileFS.new(:domain => 'test', :hosts => hosts
39 :root => '/mnt/mogilefs')
41 # Stores "A bunch of text to store" into 'some_key' with a class of 'text'.
42 mg.store_content 'some_key', 'text', "A bunch of text to store"
44 # Retrieve data from 'some_key'
45 data = mg.get_file_data 'some_key'
47 # Store the contents of 'image.jpeg' into the key 'my_image' with a class of
49 mg.store_file 'my_image', 'image', 'image.jpeg'
51 # Store the contents of 'image.jpeg' into the key 'my_image' with a class of
52 # 'image' using an open IO.
53 File.open 'image.jpeg' do |fp|
54 mg.store_file 'my_image', 'image', fp
57 # Remove the key 'my_image' and 'some_key'.
63 This client is only known to work in NFS mode. HTTP mode is implemented but
64 only lightly tested in production environments. If you find a bug,
65 please report it on the Rubyforge project.