public
Description: couchdb + ruby + fuse = couchdbfs
Homepage:
Clone URL: git://github.com/niky81/couchdbfs.git
couchdbfs / couchdbfs.rb
100644 27 lines (18 sloc) 0.536 kb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
$LOAD_PATH << File.expand_path(File.dirname(__FILE__))
 
require 'couchdbfs_lib'
 
if (File.basename($0) == File.basename(__FILE__))
  if (ARGV.size < 1)
    puts "Usage: #{$0} <directory> <options>"
    exit
  end
 
  dirname, yamlfile = ARGV.shift, ARGV.shift
 
  unless File.directory?(dirname)
    puts "Usage: #{dirname} is not a directory."
    exit
  end
 
  root = CouchdbDir.new()
 
  # Set the root FuseFS
  FuseFS.set_root(root)
 
  FuseFS.mount_under(dirname, *ARGV)
 
  FuseFS.run # This doesn't return until we're unmounted.
end