From e5c1f2e2180a741d0f5478144c4bf8429f0dcc48 Mon Sep 17 00:00:00 2001 From: Grant Gardner Date: Mon, 22 Dec 2014 22:36:06 +1100 Subject: [PATCH] Cleanup documentation --- Gemfile | 4 +++- History.rdoc | 6 ++++++ README.rdoc | 7 +++---- lib/fuse/fusedir.rb | 15 +++++++++++++++ lib/fuse/rfusefs-fuse.rb | 1 + lib/fusefs/pathmapper.rb | 2 +- lib/rfusefs.rb | 5 +++-- rfusefs.gemspec | 4 ++-- 8 files changed, 34 insertions(+), 10 deletions(-) diff --git a/Gemfile b/Gemfile index 16fd234..5176fc2 100644 --- a/Gemfile +++ b/Gemfile @@ -1,4 +1,6 @@ -source "http://rubygems.org" +source "http://bundler.rubygems.org" + +#gem 'rfuse', :path => "../rfuse" # Specify your gem's dependencies in rfusefs.gemspec gemspec diff --git a/History.rdoc b/History.rdoc index 2b41b31..f213226 100644 --- a/History.rdoc +++ b/History.rdoc @@ -1,3 +1,9 @@ +=== 1.0.3 / 2014-12-22 + +* Pushed some internals up to RFuse + +* Allow filesystems to implement signal handlers + === 1.0.1 / 2013-12-19 * Add FuseFS.main to create pretty usage messages diff --git a/README.rdoc b/README.rdoc index b333660..854c51e 100644 --- a/README.rdoc +++ b/README.rdoc @@ -29,8 +29,7 @@ See samples under /samples and also the following starter classes Then start your filesystem with -* {FuseFS.start} -* {FuseFS.main} +* {FuseFS.main} or {FuseFS.start} Finally to use the filesystem open up your favourite file browser/terminal and explore the contents under @@ -64,7 +63,7 @@ Happy Filesystem Hacking! * FUSE (http://fuse.sourceforge.org) * Ruby (>=1.9) -* rfuse (~> 1.0) +* rfuse (~> 1.1) == INSTALL: @@ -85,7 +84,7 @@ After checking out the source, run: * Copyright (c) 2005 Greg Millam. (FuseFS) * Copyright (c) 2009 Kyle Maxwell. (FuseFS) -* Copyright (c) 2012 Grant Gardner. (RFuseFS) +* Copyright (c) 2012 - 2014 Grant Gardner. (RFuseFS) Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the diff --git a/lib/fuse/fusedir.rb b/lib/fuse/fusedir.rb index fc75514..2436fa3 100644 --- a/lib/fuse/fusedir.rb +++ b/lib/fuse/fusedir.rb @@ -120,7 +120,21 @@ def to_statistics(free_space=nil,free_nodes=nil) # * {#file?}(from), {#can_write?}(to), {#can_delete?}(from) and if all true # * {#read_file}(from), {#write_to}(to), {#delete}(from) # * otherwise reject the rename + # + # === Signals + # + # The filesystem can handle a signal by providing a `sig` method. eg 'sighup' + # {#sigint} and {#sigterm} are handled by default to provide a means to exit the filesystem class FuseDir + + # @!method sigint() + # @return [void] + # Handle the INT signal and exit the filesystem + + # @!method sigterm() + # @return [void] + # Handle the TERM signal and exit the filesystem + INIT_TIMES = Array.new(3,0) # base,rest = split_path(path) @@ -307,6 +321,7 @@ def mounted();end # @return [void] def unmounted();end + end DEFAULT_FS = FuseDir.new() diff --git a/lib/fuse/rfusefs-fuse.rb b/lib/fuse/rfusefs-fuse.rb index baf852f..6040475 100644 --- a/lib/fuse/rfusefs-fuse.rb +++ b/lib/fuse/rfusefs-fuse.rb @@ -1,6 +1,7 @@ # RFuseFS - FuseFS over RFuse require 'rfuse' require 'fcntl' +require 'forwardable' module FuseFS #Which raw api should we use? diff --git a/lib/fusefs/pathmapper.rb b/lib/fusefs/pathmapper.rb index 0394d43..0f7e3ab 100644 --- a/lib/fusefs/pathmapper.rb +++ b/lib/fusefs/pathmapper.rb @@ -13,7 +13,7 @@ module FuseFS # class PathMapperFS < FuseDir - # Represents a mappted file or directory + # Represents a mapped file or directory class MNode # Merge extended attributes with the ones from the underlying file diff --git a/lib/rfusefs.rb b/lib/rfusefs.rb index fdce126..0a30686 100644 --- a/lib/rfusefs.rb +++ b/lib/rfusefs.rb @@ -130,11 +130,12 @@ def FuseFS.mount_under(mountpoint, *args) @fuse = Fuse.new(@fs,mountpoint,*args) end - # This is the main loop waiting on then executing filesystem operations from the + # This is the main loop waiting on, then executing, filesystem operations from the # kernel. # # Note: Running in a separate thread is generally not useful. In particular - # you cannot access your filesystem using ruby File operations. + # you cannot use Ruby File operations to access your filesystem from + # within the ruby process that calls run. # @note RFuseFS extension def FuseFS.run @fuse.run() diff --git a/rfusefs.gemspec b/rfusefs.gemspec index 0375703..1e8a39d 100644 --- a/rfusefs.gemspec +++ b/rfusefs.gemspec @@ -20,9 +20,9 @@ Gem::Specification.new do |s| s.has_rdoc = 'yard' s_extra_rdoc_files = 'History.rdoc' - s.add_dependency("rfuse", "~> 1.1.0.RC0") + s.add_dependency("rfuse", "~> 1.1") s.add_development_dependency("rake") - s.add_development_dependency("rspec","~> 2") + s.add_development_dependency("rspec","~> 3") s.add_development_dependency("yard") s.add_development_dependency("redcarpet") s.add_development_dependency("sqlite3")