rfuse 1.1.0 → 1.2.0.rc202009.70

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: c681e2e8d70b6ac4e8df3fff15a400024294c67c
4
- data.tar.gz: 6da4b5e6fe5c4d4688757ab771a8eb08f107089e
2
+ SHA256:
3
+ metadata.gz: a4316e7a23c3d42460aa0297c33570955fc1c1e9c60ec03230d7a8110ffb4702
4
+ data.tar.gz: 470e84fd620c1d849d2608f97878a0c9f136a57f4b3737268a3ec50240f60cb4
5
5
  SHA512:
6
- metadata.gz: cc1ac1367049aeb0d192eaa69b52774a97c899ac62047553eba6e84c0ebaea1b0e5f98ef1d106f2730725e1a247a5c975be27c652374039ee94b3893fbc3a650
7
- data.tar.gz: 8389030790e7823114dbd36e19080c58152a67e5236e2dee4b2ca2843c793e0279fba91b10acd82431351f7969150f9c93b4dfee2262c6b81b2eef08a01a9bdf
6
+ metadata.gz: 74171d0e439ba07310408f6b8079637c94143fc93ac2572ba2bc033fd25568beb9d99bbb8fc31991d2193425f3e9188d34aaf53c84340182796fa5233cb5ea21
7
+ data.tar.gz: a17e0fa72d379bca898f059c44625443b795626342e5c6bfa900b86e8d7e6768e363158427022c4cebdf6668ff622dd2060f3d350afe92b2240658b7cdd076b7
data/CHANGES.md CHANGED
@@ -1,3 +1,15 @@
1
+ 1.2.0 - 2020/09
2
+ -------------------
3
+ * Fix builds on recent linux
4
+ * Require Ruby 2.4+
5
+ * Release via Travis
6
+
7
+ 1.1.2 - 2015/11/28
8
+ ------------------
9
+
10
+ * Bugfixes
11
+ * Re-enable travis
12
+
1
13
  1.1.0 - 2014/MM/DD
2
14
  ------------------
3
15
 
data/README.md CHANGED
@@ -2,6 +2,7 @@ RFuse
2
2
  ===============
3
3
 
4
4
  http://rubygems.org/gems/rfuse
5
+ ![Gem Version](https://badge.fury.io/rb/rfuse.png)
5
6
 
6
7
  Ruby FUSE binding
7
8
 
@@ -14,8 +15,8 @@ For a more ruby-ish API for creating filesystems see {http://rubygems.org/gems/r
14
15
  Dependencies
15
16
  --------------
16
17
 
17
- * Ruby 1.8 or 1.9
18
- * Fuse 2.8
18
+ * Ruby 2.5+
19
+ * Fuse 2.8+
19
20
 
20
21
  Installation
21
22
  ---------------
@@ -1156,8 +1156,7 @@ static int rf_opendir(const char *path,struct fuse_file_info *ffi)
1156
1156
  */
1157
1157
  static VALUE unsafe_releasedir(VALUE *args)
1158
1158
  {
1159
-
1160
- return rb_funcall(args[0],rb_intern("releasedir"),3,&args[1]);
1159
+ return rb_funcall3(args[0],rb_intern("releasedir"),3,&args[1]);
1161
1160
  }
1162
1161
 
1163
1162
  static int rf_releasedir(const char *path,struct fuse_file_info *ffi)
@@ -1191,7 +1190,7 @@ static int rf_releasedir(const char *path,struct fuse_file_info *ffi)
1191
1190
  */
1192
1191
  static VALUE unsafe_fsyncdir(VALUE *args)
1193
1192
  {
1194
- return rb_funcall(args[0],rb_intern("fsyncdir"),4,&args[1]);
1193
+ return rb_funcall2(args[0],rb_intern("fsyncdir"),4,&args[1]);
1195
1194
  }
1196
1195
 
1197
1196
  static int rf_fsyncdir(const char *path,int meta,struct fuse_file_info *ffi)
@@ -74,7 +74,7 @@ module RFuse
74
74
  def self.parse_options(argv,*local_opts)
75
75
  result = Hash.new(nil)
76
76
 
77
- first_opt_index = (argv.find_index() { |opt| opt =~ /-.*/ } || argv.length )
77
+ first_opt_index = (argv.find_index() { |opt| opt =~ /^-.*/ } || argv.length )
78
78
 
79
79
  result[:device] = argv.shift if first_opt_index > 1
80
80
  result[:mountpoint] = argv[0] if argv.length > 0
@@ -1,3 +1,3 @@
1
1
  module RFuse
2
- VERSION = "1.1.0"
2
+ VERSION = "1.2.0"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rfuse
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0
4
+ version: 1.2.0.rc202009.70
5
5
  platform: ruby
6
6
  authors:
7
7
  - Grant Gardner
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-12-22 00:00:00.000000000 Z
11
+ date: 2020-09-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake
@@ -42,16 +42,16 @@ dependencies:
42
42
  name: rspec
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - "~>"
45
+ - - ">="
46
46
  - !ruby/object:Gem::Version
47
- version: 3.0.0
47
+ version: '0'
48
48
  type: :development
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - "~>"
52
+ - - ">="
53
53
  - !ruby/object:Gem::Version
54
- version: 3.0.0
54
+ version: '0'
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: yard
57
57
  requirement: !ruby/object:Gem::Requirement
@@ -117,14 +117,10 @@ extensions:
117
117
  extra_rdoc_files:
118
118
  - CHANGES.md
119
119
  files:
120
- - ".gitignore"
121
120
  - ".yardopts"
122
121
  - CHANGES.md
123
- - Gemfile
124
122
  - LICENSE
125
123
  - README.md
126
- - Rakefile
127
- - ext/.gitignore
128
124
  - ext/rfuse/bufferwrapper.c
129
125
  - ext/rfuse/bufferwrapper.h
130
126
  - ext/rfuse/context.c
@@ -149,19 +145,9 @@ files:
149
145
  - lib/rfuse/compat.rb
150
146
  - lib/rfuse/version.rb
151
147
  - lib/rfuse_ng.rb
152
- - rfuse.gemspec
153
- - sample/test-ruby.rb
154
- - spec/basic_spec.rb
155
- - spec/fuse_file_info_spec.rb
156
- - spec/main_spec.rb
157
- - spec/options_spec.rb
158
- - spec/ruby_loop_spec.rb
159
- - spec/run_spec.rb
160
- - spec/signals_spec.rb
161
- - spec/spec_helper.rb
162
- - spec/xattr_spec.rb
163
148
  homepage: http://rubygems.org/gems/rfuse
164
- licenses: []
149
+ licenses:
150
+ - GPL-2.0
165
151
  metadata: {}
166
152
  post_install_message:
167
153
  rdoc_options: []
@@ -171,17 +157,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
171
157
  requirements:
172
158
  - - ">="
173
159
  - !ruby/object:Gem::Version
174
- version: '0'
160
+ version: '2.5'
175
161
  required_rubygems_version: !ruby/object:Gem::Requirement
176
162
  requirements:
177
- - - ">="
163
+ - - ">"
178
164
  - !ruby/object:Gem::Version
179
- version: '0'
165
+ version: 1.3.1
180
166
  requirements: []
181
- rubyforge_project:
182
- rubygems_version: 2.4.3
167
+ rubygems_version: 3.0.8
183
168
  signing_key:
184
169
  specification_version: 4
185
170
  summary: Ruby language binding for FUSE
186
171
  test_files: []
187
- has_rdoc: yard
data/.gitignore DELETED
@@ -1,5 +0,0 @@
1
- *.o
2
- *.so
3
- *.gem
4
- doc
5
- .yardoc
data/Gemfile DELETED
@@ -1,4 +0,0 @@
1
- source "http://rubygems.org"
2
-
3
- # Specify your gem's dependencies in rfuse.gemspec
4
- gemspec
data/Rakefile DELETED
@@ -1,17 +0,0 @@
1
- #!/usr/bin/env rake
2
- require "bundler/gem_tasks"
3
- require 'yard'
4
- require 'rspec/core/rake_task'
5
- require 'rake/extensiontask'
6
-
7
- CLOBBER.include("pkg","doc")
8
- RSpec::Core::RakeTask.new(:spec)
9
-
10
- YARD::Rake::YardocTask.new
11
-
12
- Rake::ExtensionTask.new('rfuse') do |ext|
13
- ext.lib_dir = "lib/rfuse"
14
- end
15
-
16
- task :spec => :compile
17
- task :default => :spec
@@ -1,2 +0,0 @@
1
- Makefile
2
- *.out
@@ -1,31 +0,0 @@
1
- # -*- encoding: utf-8 -*-
2
- $:.push File.expand_path("../lib", __FILE__)
3
- require "rfuse/version"
4
-
5
- Gem::Specification.new do |s|
6
- s.name = "rfuse"
7
- s.version = RFuse::VERSION
8
- s.platform = Gem::Platform::RUBY
9
- s.authors = ["Grant Gardner"]
10
- s.email = ["grant@lastweekend.com.au"]
11
- s.homepage = "http://rubygems.org/gems/rfuse"
12
- s.summary = %q{Ruby language binding for FUSE}
13
- s.description = %q{Write userspace filesystems in Ruby}
14
-
15
- s.files = `git ls-files`.split("\n")
16
- s.extensions = 'ext/rfuse/extconf.rb'
17
- s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
18
- s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
19
- s.require_paths = ["lib"]
20
-
21
- s.has_rdoc = 'yard'
22
- s.extra_rdoc_files = 'CHANGES.md'
23
-
24
- s.add_development_dependency("rake")
25
- s.add_development_dependency("rake-compiler")
26
- s.add_development_dependency("rspec","~> 3.0.0")
27
- s.add_development_dependency("yard")
28
- s.add_development_dependency("redcarpet")
29
- s.add_development_dependency("ffi-xattr")
30
- s.add_development_dependency("sys-filesystem")
31
- end
@@ -1,310 +0,0 @@
1
- #!/usr/bin/ruby
2
-
3
- # TestFS for RFuse
4
-
5
- require "rfuse"
6
-
7
- class MyDir < Hash
8
- attr_accessor :name, :mode , :actime, :modtime, :uid, :gid
9
- def initialize(name,mode)
10
- @uid=0
11
- @gid=0
12
- @actime=Time.now
13
- @modtime=Time.now
14
- @xattr=Hash.new
15
- @name=name
16
- @mode=mode
17
- end
18
-
19
- def stat
20
- RFuse::Stat.directory(mode,:uid => uid, :gid => gid, :atime => actime, :mtime => modtime,
21
- :size => size)
22
- end
23
-
24
- def listxattr()
25
- @xattr.keys()
26
- end
27
- def setxattr(name,value,flag)
28
- @xattr[name]=value #TODO:don't ignore flag
29
- end
30
- def getxattr(name)
31
- return @xattr[name]
32
- end
33
- def removexattr(name)
34
- @xattr.delete(name)
35
- end
36
- def size
37
- return 48 #for testing only
38
- end
39
- def isdir
40
- true
41
- end
42
- def insert_obj(obj,path)
43
- d=self.search(File.dirname(path))
44
- if d.isdir then
45
- d[obj.name]=obj
46
- else
47
- raise Errno::ENOTDIR.new(d.name)
48
- end
49
- return d
50
- end
51
- def remove_obj(path)
52
- d=self.search(File.dirname(path))
53
- d.delete(File.basename(path))
54
- end
55
- def search(path)
56
- p=path.split('/').delete_if {|x| x==''}
57
- if p.length==0 then
58
- return self
59
- else
60
- return self.follow(p)
61
- end
62
- end
63
- def follow (path_array)
64
- if path_array.length==0 then
65
- return self
66
- else
67
- d=self[path_array.shift]
68
- if d then
69
- return d.follow(path_array)
70
- else
71
- raise Errno::ENOENT.new
72
- end
73
- end
74
- end
75
- def to_s
76
- return "Dir: " + @name + "(" + @mode.to_s + ")"
77
- end
78
- end
79
-
80
- class MyFile
81
- attr_accessor :name, :mode, :actime, :modtime, :uid, :gid, :content
82
- def initialize(name,mode,uid,gid)
83
- @actime=0
84
- @modtime=0
85
- @xattr=Hash.new
86
- @content=""
87
- @uid=uid
88
- @gid=gid
89
- @name=name
90
- @mode=mode
91
- end
92
-
93
- def stat
94
- RFuse::Stat.file(mode,:uid => uid, :gid => gid, :atime => actime, :mtime => modtime,
95
- :size => size)
96
- end
97
-
98
- def listxattr()
99
- @xattr.keys
100
- end
101
-
102
- def setxattr(name,value,flag)
103
- @xattr[name]=value #TODO:don't ignore flag
104
- end
105
-
106
- def getxattr(name)
107
- return @xattr[name]
108
- end
109
- def removexattr(name)
110
- @xattr.delete(name)
111
- end
112
- def size
113
- return content.size
114
- end
115
- def isdir
116
- false
117
- end
118
- def follow(path_array)
119
- if path_array.length != 0 then
120
- raise Errno::ENOTDIR.new
121
- else
122
- return self
123
- end
124
- end
125
- def to_s
126
- return "File: " + @name + "(" + @mode.to_s + ")"
127
- end
128
- end
129
-
130
- class MyFuse
131
-
132
- def initialize(root)
133
- @root=root
134
- end
135
-
136
- # The new readdir way, c+p-ed from getdir
137
- def readdir(ctx,path,filler,offset,ffi)
138
- d=@root.search(path)
139
- if d.isdir then
140
- d.each {|name,obj|
141
- filler.push(name,obj.stat,0)
142
- }
143
- else
144
- raise Errno::ENOTDIR.new(path)
145
- end
146
- end
147
-
148
- def getattr(ctx,path)
149
- d = @root.search(path)
150
- return d.stat
151
- end #getattr
152
-
153
- def mkdir(ctx,path,mode)
154
- @root.insert_obj(MyDir.new(File.basename(path),mode),path)
155
- end #mkdir
156
-
157
- def mknod(ctx,path,mode,major,minor)
158
- @root.insert_obj(MyFile.new(File.basename(path),mode,ctx.uid,ctx.gid),path)
159
- end #mknod
160
-
161
- def open(ctx,path,ffi)
162
- end
163
-
164
- #def release(ctx,path,fi)
165
- #end
166
-
167
- #def flush(ctx,path,fi)
168
- #end
169
-
170
- def chmod(ctx,path,mode)
171
- d=@root.search(path)
172
- d.mode=mode
173
- end
174
-
175
- def chown(ctx,path,uid,gid)
176
- d=@root.search(path)
177
- d.uid=uid
178
- d.gid=gid
179
- end
180
-
181
- def truncate(ctx,path,offset)
182
- d=@root.search(path)
183
- d.content = d.content[0..offset]
184
- end
185
-
186
- def utime(ctx,path,actime,modtime)
187
- d=@root.search(path)
188
- d.actime=actime
189
- d.modtime=modtime
190
- end
191
-
192
- def unlink(ctx,path)
193
- @root.remove_obj(path)
194
- end
195
-
196
- def rmdir(ctx,path)
197
- @root.remove_obj(path)
198
- end
199
-
200
- #def symlink(ctx,path,as)
201
- #end
202
-
203
- def rename(ctx,path,as)
204
- d = @root.search(path)
205
- @root.remove_obj(path)
206
- @root.insert_obj(d,path)
207
- end
208
-
209
- #def link(ctx,path,as)
210
- #end
211
-
212
- def read(ctx,path,size,offset,fi)
213
- d = @root.search(path)
214
- if (d.isdir)
215
- raise Errno::EISDIR.new(path)
216
- return nil
217
- else
218
- return d.content[offset..offset + size - 1]
219
- end
220
- end
221
-
222
- def write(ctx,path,buf,offset,fi)
223
- d=@root.search(path)
224
- if (d.isdir)
225
- raise Errno::EISDIR.new(path)
226
- else
227
- d.content[offset..offset+buf.length - 1] = buf
228
- end
229
- return buf.length
230
- end
231
-
232
- def setxattr(ctx,path,name,value,size,flags)
233
- d=@root.search(path)
234
- d.setxattr(name,value,flags)
235
- end
236
-
237
- def getxattr(ctx,path,name)
238
- d=@root.search(path)
239
- if (d)
240
- value=d.getxattr(name)
241
- if (!value)
242
- value=""
243
- #raise Errno::ENOENT.new #TODO raise the correct error :
244
- #NOATTR which is not implemented in Linux/glibc
245
- end
246
- else
247
- raise Errno::ENOENT.new
248
- end
249
- return value
250
- end
251
-
252
- def listxattr(ctx,path)
253
- d=@root.search(path)
254
- value= d.listxattr()
255
- return value
256
- end
257
-
258
- def removexattr(ctx,path,name)
259
- d=@root.search(path)
260
- d.removexattr(name)
261
- end
262
-
263
- #def opendir(ctx,path,ffi)
264
- #end
265
-
266
- #def releasedir(ctx,path,ffi)
267
- #end
268
-
269
- #def fsyncdir(ctx,path,meta,ffi)
270
- #end
271
-
272
- # Some random numbers to show with df command
273
- def statfs(ctx,path)
274
- s = RFuse::StatVfs.new()
275
- s.f_bsize = 1024
276
- s.f_frsize = 1024
277
- s.f_blocks = 1000000
278
- s.f_bfree = 500000
279
- s.f_bavail = 990000
280
- s.f_files = 10000
281
- s.f_ffree = 9900
282
- s.f_favail = 9900
283
- s.f_fsid = 23423
284
- s.f_flag = 0
285
- s.f_namemax = 10000
286
- return s
287
- end
288
-
289
- def ioctl(ctx, path, cmd, arg, ffi, flags, data)
290
- # FT: I was not been able to test it.
291
- print "*** IOCTL: command: ", cmd, "\n"
292
- end
293
-
294
- def poll(ctx, path, ffi, ph, reventsp)
295
- print "*** POLL: ", path, "\n"
296
- # This is how we notify the caller if something happens:
297
- ph.notifyPoll();
298
- # when the GC harvests the object it calls fuse_pollhandle_destroy
299
- # by itself.
300
- end
301
-
302
- def init(ctx,rfuseconninfo)
303
- print "RFuse TestFS started\n"
304
- print "init called\n"
305
- print "proto_major:#{rfuseconninfo.proto_major}\n"
306
- end
307
-
308
- end #class Fuse
309
-
310
- RFuse.main(ARGV) { fs = MyFuse.new(MyDir.new("",0777)) }