README: add a note about emailing me
[ruby-mogilefs-client.git] / README.txt
blobf03c45675ac918e1393f133fee8b81b554bcf41a
1 = mogilefs-client
3 A Ruby MogileFS client
5 Rubyforge Project:
7 http://rubyforge.org/projects/seattlerb/
9 Documentation:
11 http://seattlerb.rubyforge.org/mogilefs-client
13 File bugs:
15 http://rubyforge.org/tracker/?func=add&group_id=1513&atid=5921
17 Please email Eric Wong at normalperson@yhbt.net as well since
18 he finds web interfaces difficult to use.
20 Source repository (git):
22 git://git.bogomips.org/mogilefs-client.git
24 http://git.bogomips.org/mogilefs-client.git
26 Repository browser (cgit):
28 http://git.bogomips.org/cgit/mogilefs-client.git
30 == About
32 A Ruby MogileFS client.  MogileFS is a distributed filesystem written
33 by Danga Interactive.  This client only supports HTTP.
35 For information on MogileFS see:
37 http://danga.com/mogilefs/
39 == Installing mogilefs-client
41 First you need a MogileFS setup.  You can find information on how to do
42 that at the above URL.
44 Then install the gem:
46   $ sudo gem install mogilefs-client
48 == Using mogilefs-client
50   # Create a new instance that will communicate with these trackers:
51   hosts = %w[192.168.1.69:6001 192.168.1.70:6001]
52   mg = MogileFS::MogileFS.new(:domain => 'test', :hosts => hosts)
54   # Stores "A bunch of text to store" into 'some_key' with a class of 'text'.
55   mg.store_content 'some_key', 'text', "A bunch of text to store"
57   # Retrieve data from 'some_key'
58   data = mg.get_file_data 'some_key'
60   # Store the contents of 'image.jpeg' into the key 'my_image' with a class of
61   # 'image'.
62   mg.store_file 'my_image', 'image', 'image.jpeg'
64   # Store the contents of 'image.jpeg' into the key 'my_image' with a class of
65   # 'image' using an open IO.
66   File.open 'image.jpeg', 'rb' do |fp|
67     mg.store_file 'my_image', 'image', fp
68   end
70   # Remove the key 'my_image' and 'some_key'.
71   mg.delete 'my_image'
72   mg.delete 'some_key'
74 == WARNING!
76 This client is only supported in HTTP mode.  NFS mode was previously
77 supported in 1.3.x, but since MogileFS 2.x has dropped support for
78 NFS, this client has removed support for it.