7 http://rubyforge.org/projects/seattlerb/
11 http://seattlerb.org/mogilefs-client
15 http://rubyforge.org/tracker/?func=add&group_id=1513&atid=5921
17 Source repository (git):
19 git://git.bogomips.org/mogilefs-client.git
20 http://git.bogomips.org/mogilefs-client.git
22 Repository browser (cgit):
24 http://git.bogomips.org/cgit/mogilefs-client.git
28 A Ruby MogileFS client. MogileFS is a distributed filesystem written
29 by Danga Interactive. This client supports NFS and HTTP modes.
31 For information on MogileFS see:
33 http://danga.com/mogilefs/
35 == Installing mogilefs-client
37 First you need a MogileFS setup. You can find information on how to do
38 that at the above URL.
42 $ sudo gem install mogilefs-client
44 == Using mogilefs-client
46 # Create a new instance that will communicate with these trackers:
47 hosts = %w[192.168.1.69:6001 192.168.1.70:6001]
48 mg = MogileFS::MogileFS.new(:domain => 'test', :hosts => hosts)
50 # NFS requires the :root parameter (e.g. :root => '/mnt/mogilefs')
52 # Stores "A bunch of text to store" into 'some_key' with a class of 'text'.
53 mg.store_content 'some_key', 'text', "A bunch of text to store"
55 # Retrieve data from 'some_key'
56 data = mg.get_file_data 'some_key'
58 # Store the contents of 'image.jpeg' into the key 'my_image' with a class of
60 mg.store_file 'my_image', 'image', 'image.jpeg'
62 # Store the contents of 'image.jpeg' into the key 'my_image' with a class of
63 # 'image' using an open IO.
64 File.open 'image.jpeg' do |fp|
65 mg.store_file 'my_image', 'image', fp
68 # Remove the key 'my_image' and 'some_key'.
74 This client is only supported in HTTP mode. NFS mode was previously
75 supported but since MogileFS 2.x has dropped support for NFS, do not
76 expect it to remain working forever.