rfusefs 1.0.2.RC0 → 1.1.0.rc202009.34

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: a3be9d9f33c4755ba71b12bce9a95e76e3ddd7f17066a9c39c248d56464638ec
4
+ data.tar.gz: 69335105b13cc54ae267045f4d8320a715b86680dde02acdb307dc8d7fe8235e
5
+ SHA512:
6
+ metadata.gz: fae5751cf1389148656db47b801c0d12479ccdd0eab7b0bb9f3a5c7c50661299458637594115b3f1d2076c2a5beb20d3863d8865f1fe33a3b2c81aad5e7de131
7
+ data.tar.gz: f042fcf45c0da85a3aafdd8bfe9f177aafd005b6286ffd484188631ad8ef8ee2b571f91a065d5e2f21e0464b26058a8d47de8bcdb676b9ab0bbc859addd2bfd4
@@ -0,0 +1,2 @@
1
+ -
2
+ CHANGES.md
@@ -0,0 +1,40 @@
1
+
2
+ 1.1.0 / 2020-10
3
+ ---------------
4
+
5
+ * With rfuse ~> 1.2
6
+ * Requires Ruby 2.5+
7
+ * Release via Travis CI
8
+
9
+ 1.0.3 / 2014-12-22
10
+ ----------------------
11
+
12
+ * Pushed some internals up to RFuse
13
+ * Allow filesystems to implement signal handlers
14
+
15
+ 1.0.1 / 2013-12-19
16
+ ------------------
17
+
18
+ * Add FuseFS.main to create pretty usage messages
19
+ * Support extended attributes in filesystems
20
+ * Updates and cleanup of PathMapperFS
21
+ * Provide SqliteMapperFS
22
+
23
+ 1.0.0 / 2012-08-07
24
+ ------------------
25
+
26
+ * Depend on new rfuse 1.0.0, Ruby 1.9
27
+ * API breaking changes
28
+ * order of arguments to {FuseFS.mount}, {FuseFS.start} changed
29
+ to account for better option handling in RFuse
30
+
31
+ 0.8.0 / 2011-02-19
32
+ ------------------
33
+
34
+ * Initial port from fusefs
35
+
36
+ * Improved raw methods
37
+ * new "times" api for including atime,mtime,ctime in stat results
38
+ * metadir allow mv directories
39
+ * includes PathMapperFS
40
+
data/LICENSE ADDED
@@ -0,0 +1,24 @@
1
+ (The MIT License)
2
+
3
+ * Copyright (c) 2005 Greg Millam. (FuseFS)
4
+ * Copyright (c) 2009 Kyle Maxwell. (FuseFS)
5
+ * Copyright (c) 2012 - 2020 Grant Gardner. (RFuseFS)
6
+
7
+
8
+ Permission is hereby granted, free of charge, to any person obtaining a copy
9
+ of this software and associated documentation files (the 'Software'), to deal
10
+ in the Software without restriction, including without limitation the rights
11
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
12
+ copies of the Software, and to permit persons to whom the Software is
13
+ furnished to do so, subject to the following conditions:
14
+
15
+ The above copyright notice and this permission notice shall be included in all
16
+ copies or substantial portions of the Software.
17
+
18
+ THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
21
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
23
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
24
+ SOFTWARE.
@@ -0,0 +1,83 @@
1
+ # rfusefs
2
+
3
+ * https://rubygems.org/gems/rfusefs
4
+ * https://github.com/lwoggardner/rfusefs
5
+
6
+ [<img src="https://badge.fury.io/rb/rfusefs.png" alt="Gem Version"
7
+ />](http://badge.fury.io/rb/rfusefs)
8
+ ## DESCRIPTION
9
+
10
+ RFuseFS is a port of the [FuseFS](http://rubygems.org/gems/fusefs/) library
11
+ aimed at allowing Ruby programmers to quickly and easily create virtual
12
+ filesystems with little more than a few lines of code.
13
+
14
+ RFuseFS is api compatible with FuseFS (0.7.0)
15
+
16
+ ## SYNOPSIS
17
+
18
+ FuseFS provides a layer of abstraction to a programmer who wants to create a
19
+ virtual filesystem via FUSE.
20
+
21
+ First define a virtual directory by subclassing {FuseFS::FuseDir}
22
+
23
+ See samples under /samples and also the following starter classes
24
+
25
+ * {FuseFS::FuseDir}
26
+ * {FuseFS::MetaDir}
27
+ * {FuseFS::DirLink}
28
+ * {FuseFS::PathMapperFS}
29
+ * {FuseFS::SqliteMapperFS}
30
+
31
+
32
+ Then start your filesystem with
33
+
34
+ * {FuseFS.main} or {FuseFS.start}
35
+
36
+
37
+ Finally to use the filesystem open up your favourite file browser/terminal and
38
+ explore the contents under <mountpoint>
39
+
40
+ Happy Filesystem Hacking!
41
+
42
+ ### the hello world filesystem in 14 LOC
43
+
44
+ require 'rfusefs'
45
+
46
+ class HelloDir
47
+
48
+ def contents(path)
49
+ ['hello.txt']
50
+ end
51
+
52
+ def file?(path)
53
+ path == '/hello.txt'
54
+ end
55
+
56
+ def read_file(path)
57
+ "Hello, World!\n"
58
+ end
59
+
60
+ end
61
+
62
+ # Usage: #{$0} mountpoint [mount_options]
63
+ FuseFS.main() { |options| HelloDir.new }
64
+
65
+ ## REQUIREMENTS:
66
+
67
+ * FUSE (http://fuse.sourceforge.net)
68
+ * Ruby (>= 2.5)
69
+ * rfuse (~> 1.2)
70
+
71
+
72
+ ## INSTALL:
73
+
74
+ * gem install rfusefs
75
+
76
+ ## DEVELOPERS:
77
+
78
+ After checking out the source, run:
79
+
80
+ $ bundle install # install dependencies
81
+ $ rake spec # run tests
82
+ $ rake yard # generate docs
83
+
data/TODO.md ADDED
@@ -0,0 +1,7 @@
1
+
2
+ TODO
3
+ --------------
4
+
5
+ * Test (or remove) samples
6
+
7
+
@@ -45,28 +45,14 @@ module FuseFS
45
45
  # end
46
46
  #
47
47
  def FuseFS.main(argv=ARGV,options=[],option_usage="",device=nil,exec=File.basename($0))
48
- options = RFuse.parse_options(argv,*options)
49
-
50
- if options[:mountpoint]
51
- begin
52
- fs = yield options
53
- rescue StandardError => ex
54
- puts ex.message
55
- puts ex.backtrace.join("\n")
56
- end
57
-
58
- puts RFuse.usage(device,exec) if options[:help] || !fs
59
- puts "Options:\n" if options[:help]
60
-
61
- FuseFS.start(fs,*argv) if fs || options[:help]
62
-
63
- puts option_usage if options[:help]
64
- else
65
- puts "rfusefs: failed, no mountpoint provided",RFuse.usage(device,exec)
48
+ RFuse.main(argv,options,option_usage,device,exec) do |options,argv|
49
+ root = yield options
50
+ FuseFS.set_root(root)
51
+ FuseFS.mount_under(*argv)
66
52
  end
67
53
  end
68
54
 
69
- # Start the FuseFS root at mountpoint with opts.
55
+ # Start the FuseFS root at mountpoint with opts.
70
56
  #
71
57
  # If not previously set, Signal traps for "TERM" and "INT" are added
72
58
  # to exit the filesystem
@@ -77,7 +63,6 @@ module FuseFS
77
63
  # @note RFuseFS extension
78
64
  # @return [void]
79
65
  def FuseFS.start(root,mountpoint,*opts)
80
- set_default_traps("TERM","INT") { FuseFS.exit }
81
66
  FuseFS.set_root(root)
82
67
  begin
83
68
  FuseFS.mount_under(mountpoint,*opts)
@@ -88,7 +73,7 @@ module FuseFS
88
73
  end
89
74
 
90
75
  # Forks {FuseFS.start} so you can access your filesystem with ruby File
91
- # operations (eg for testing).
76
+ # operations (eg for testing).
92
77
  # @note This is an *RFuseFS* extension
93
78
  # @return [void]
94
79
  def FuseFS.mount(root,mountpoint,*opts)
@@ -126,43 +111,40 @@ module FuseFS
126
111
  end
127
112
  end
128
113
 
129
- # Set the root virtual directory
114
+ # Set the root virtual directory
130
115
  # @param root [Object] an object implementing a subset of {FuseFS::API}
131
116
  # @return [void]
132
117
  def FuseFS.set_root(root)
133
- @fs=RFuseFS.new(root)
118
+ @fs=Fuse::Root.new(root)
134
119
  end
135
120
 
136
121
  # This will cause FuseFS to virtually mount itself under the given path. {set_root} must have
137
122
  # been called previously.
138
123
  # @param [String] mountpoint an existing directory where the filesystem will be virtually mounted
139
124
  # @param [Array<String>] args
125
+ # @return [Fuse] the mounted fuse filesystem
140
126
  # These are as expected by the "mount" command. Note in particular that the first argument
141
127
  # is expected to be the mount point. For more information, see http://fuse.sourceforge.net
142
128
  # and the manual pages for "mount.fuse"
143
- def FuseFS.mount_under(mountpoint, *args)
144
- @fuse = RFuse::FuseDelegator.new(@fs,mountpoint,*args)
129
+ def FuseFS.mount_under(mountpoint, *args)
130
+ @fuse = Fuse.new(@fs,mountpoint,*args)
145
131
  end
146
132
 
147
- # This is the main loop waiting on then executing filesystem operations from the
148
- # kernel.
149
- #
133
+ # This is the main loop waiting on, then executing, filesystem operations from the
134
+ # kernel.
135
+ #
150
136
  # Note: Running in a separate thread is generally not useful. In particular
151
- # you cannot access your filesystem using ruby File operations.
137
+ # you cannot use Ruby File operations to access your filesystem from
138
+ # within the ruby process that calls run.
152
139
  # @note RFuseFS extension
153
140
  def FuseFS.run
154
- @fs.mounted()
155
- @fuse.loop if @fuse.mounted?
156
- ensure
157
- @fs.unmounted()
141
+ @fuse.run()
158
142
  end
159
143
 
160
- # Exit the run loop and teardown FUSE
161
- # Most useful from Signal.trap() or Kernel.at_exit()
144
+ # Exit the run loop and teardown FUSE
145
+ # Most useful from Signal.trap() or Kernel.at_exit()
162
146
  def FuseFS.exit
163
- if @fuse
164
- @fuse.exit
165
- end
147
+ @fuse.exit if @fuse
166
148
  end
167
149
 
168
150
  # @return [Fixnum] the calling process uid
@@ -177,23 +159,16 @@ module FuseFS
177
159
  Thread.current[:fusefs_reader_gid]
178
160
  end
179
161
 
180
- # Not supported in RFuseFS (yet). The original FuseFS had special handling for editor
181
- # swap/backup but this does not seem to be required, eg for the demo filesystems.
182
- # If it is required it can be implemented in a filesystem
162
+ # Not supported in RFuseFS.
163
+ #
164
+ # The original FuseFS had special handling for editor swap/backup files
165
+ # which appears to be a workaround for a bug where zero length files
166
+ # where never written to. This "bug" is fixed since RFuseFS 1.0.2
167
+ #
183
168
  # @deprecated
184
169
  def self.handle_editor(bool)
185
170
  #do nothing
186
171
  end
187
172
 
188
- private
189
-
190
- def self.set_default_traps(*signals,&block)
191
- signals.each do |sig|
192
- old_proc = Signal.trap(sig,block)
193
- unless "DEFAULT".eql?(old_proc)
194
- Signal.trap(sig,old_proc)
195
- end
196
- end
197
- end
198
173
  end
199
174
 
metadata CHANGED
@@ -1,175 +1,164 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rfusefs
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.2.RC0
5
- prerelease: 6
4
+ version: 1.1.0.rc202009.34
6
5
  platform: ruby
7
6
  authors:
8
7
  - Grant Gardner
9
8
  autorequire:
10
9
  bindir: bin
11
10
  cert_chain: []
12
- date: 2014-01-02 00:00:00.000000000 Z
11
+ date: 2020-10-10 00:00:00.000000000 Z
13
12
  dependencies:
14
13
  - !ruby/object:Gem::Dependency
15
14
  name: rfuse
16
15
  requirement: !ruby/object:Gem::Requirement
17
- none: false
18
16
  requirements:
19
- - - ! '>='
17
+ - - "~>"
20
18
  - !ruby/object:Gem::Version
21
- version: 1.0.4
19
+ version: '1.2'
22
20
  type: :runtime
23
21
  prerelease: false
24
22
  version_requirements: !ruby/object:Gem::Requirement
25
- none: false
26
23
  requirements:
27
- - - ! '>='
24
+ - - "~>"
28
25
  - !ruby/object:Gem::Version
29
- version: 1.0.4
26
+ version: '1.2'
30
27
  - !ruby/object:Gem::Dependency
31
28
  name: rake
32
29
  requirement: !ruby/object:Gem::Requirement
33
- none: false
34
30
  requirements:
35
- - - ! '>='
31
+ - - ">="
36
32
  - !ruby/object:Gem::Version
37
33
  version: '0'
38
34
  type: :development
39
35
  prerelease: false
40
36
  version_requirements: !ruby/object:Gem::Requirement
41
- none: false
42
37
  requirements:
43
- - - ! '>='
38
+ - - ">="
44
39
  - !ruby/object:Gem::Version
45
40
  version: '0'
46
41
  - !ruby/object:Gem::Dependency
47
42
  name: rspec
48
43
  requirement: !ruby/object:Gem::Requirement
49
- none: false
50
44
  requirements:
51
- - - ! '>='
45
+ - - "~>"
52
46
  - !ruby/object:Gem::Version
53
- version: '0'
47
+ version: '3'
54
48
  type: :development
55
49
  prerelease: false
56
50
  version_requirements: !ruby/object:Gem::Requirement
57
- none: false
58
51
  requirements:
59
- - - ! '>='
52
+ - - "~>"
60
53
  - !ruby/object:Gem::Version
61
- version: '0'
54
+ version: '3'
62
55
  - !ruby/object:Gem::Dependency
63
56
  name: yard
64
57
  requirement: !ruby/object:Gem::Requirement
65
- none: false
66
58
  requirements:
67
- - - ! '>='
59
+ - - ">="
68
60
  - !ruby/object:Gem::Version
69
61
  version: '0'
70
62
  type: :development
71
63
  prerelease: false
72
64
  version_requirements: !ruby/object:Gem::Requirement
73
- none: false
74
65
  requirements:
75
- - - ! '>='
66
+ - - ">="
76
67
  - !ruby/object:Gem::Version
77
68
  version: '0'
78
69
  - !ruby/object:Gem::Dependency
79
70
  name: redcarpet
80
71
  requirement: !ruby/object:Gem::Requirement
81
- none: false
82
72
  requirements:
83
- - - ! '>='
73
+ - - ">="
84
74
  - !ruby/object:Gem::Version
85
75
  version: '0'
86
76
  type: :development
87
77
  prerelease: false
88
78
  version_requirements: !ruby/object:Gem::Requirement
89
- none: false
90
79
  requirements:
91
- - - ! '>='
80
+ - - ">="
92
81
  - !ruby/object:Gem::Version
93
82
  version: '0'
94
83
  - !ruby/object:Gem::Dependency
95
84
  name: sqlite3
96
85
  requirement: !ruby/object:Gem::Requirement
97
- none: false
98
86
  requirements:
99
- - - ! '>='
87
+ - - ">="
88
+ - !ruby/object:Gem::Version
89
+ version: '0'
90
+ type: :development
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - ">="
95
+ - !ruby/object:Gem::Version
96
+ version: '0'
97
+ - !ruby/object:Gem::Dependency
98
+ name: sys-filesystem
99
+ requirement: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - ">="
100
102
  - !ruby/object:Gem::Version
101
103
  version: '0'
102
104
  type: :development
103
105
  prerelease: false
104
106
  version_requirements: !ruby/object:Gem::Requirement
105
- none: false
106
107
  requirements:
107
- - - ! '>='
108
+ - - ">="
108
109
  - !ruby/object:Gem::Version
109
110
  version: '0'
111
+ - !ruby/object:Gem::Dependency
112
+ name: ffi-xattr
113
+ requirement: !ruby/object:Gem::Requirement
114
+ requirements:
115
+ - - ">="
116
+ - !ruby/object:Gem::Version
117
+ version: 0.1.1
118
+ type: :development
119
+ prerelease: false
120
+ version_requirements: !ruby/object:Gem::Requirement
121
+ requirements:
122
+ - - ">="
123
+ - !ruby/object:Gem::Version
124
+ version: 0.1.1
110
125
  description: A more Ruby like way to write FUSE filesystems - inspired by (compatible
111
126
  with) FuseFS, implemented over RFuse
112
127
  email:
113
128
  - grant@lastweekend.com.au
114
129
  executables: []
115
130
  extensions: []
116
- extra_rdoc_files: []
131
+ extra_rdoc_files:
132
+ - CHANGES.md
117
133
  files:
118
- - .gitignore
119
- - .travis.yml
120
- - Gemfile
121
- - History.rdoc
122
- - README.rdoc
123
- - Rakefile
124
- - TODO.txt
125
- - lib/fuse/fusedir.rb
126
- - lib/fuse/rfusefs-fuse.rb
134
+ - ".yardopts"
135
+ - CHANGES.md
136
+ - LICENSE
137
+ - README.md
138
+ - TODO.md
127
139
  - lib/fusefs.rb
128
- - lib/fusefs/dirlink.rb
129
- - lib/fusefs/metadir.rb
130
- - lib/fusefs/pathmapper.rb
131
- - lib/fusefs/sqlitemapper.rb
132
140
  - lib/rfusefs.rb
133
- - lib/rfusefs/version.rb
134
- - rfusefs.gemspec
135
- - samples/demo.rb
136
- - samples/dictfs.rb
137
- - samples/hello.rb
138
- - samples/openurifs.rb
139
- - samples/railsfs.rb
140
- - samples/sqlfs.rb
141
- - samples/yamlfs.rb
142
- - spec-fusefs/fusefs_spec.rb
143
- - spec/metadir_spec.rb
144
- - spec/mount_unmount_spec.rb
145
- - spec/pathmapper_spec.rb
146
- - spec/rfusefs_spec.rb
147
- - spec/sample_spec.rb
148
- - spec/spec_helper.rb
149
- - spec/sqlitemapper_spec.rb
150
141
  homepage: http://rubygems.org/gems/rfusefs
151
- licenses: []
142
+ licenses:
143
+ - MIT
144
+ metadata: {}
152
145
  post_install_message:
153
146
  rdoc_options: []
154
147
  require_paths:
155
148
  - lib
156
149
  required_ruby_version: !ruby/object:Gem::Requirement
157
- none: false
158
150
  requirements:
159
- - - ! '>='
151
+ - - ">="
160
152
  - !ruby/object:Gem::Version
161
- version: '0'
153
+ version: '2.5'
162
154
  required_rubygems_version: !ruby/object:Gem::Requirement
163
- none: false
164
155
  requirements:
165
- - - ! '>'
156
+ - - ">"
166
157
  - !ruby/object:Gem::Version
167
158
  version: 1.3.1
168
159
  requirements: []
169
- rubyforge_project:
170
- rubygems_version: 1.8.23
160
+ rubygems_version: 3.0.8
171
161
  signing_key:
172
- specification_version: 3
162
+ specification_version: 4
173
163
  summary: Filesystem in Ruby Userspace
174
164
  test_files: []
175
- has_rdoc: yard