ffi-libfuse 0.0.1.pre → 0.1.0.rc20220550

Sign up to get free protection for your applications and to get access to all the features.
Files changed (57) hide show
  1. checksums.yaml +4 -4
  2. data/.yardopts +3 -1
  3. data/CHANGES.md +14 -0
  4. data/LICENSE +21 -0
  5. data/README.md +127 -44
  6. data/lib/ffi/accessors.rb +6 -6
  7. data/lib/ffi/boolean_int.rb +27 -0
  8. data/lib/ffi/devt.rb +23 -0
  9. data/lib/ffi/encoding.rb +38 -0
  10. data/lib/ffi/gnu_extensions.rb +1 -1
  11. data/lib/ffi/libfuse/ackbar.rb +6 -8
  12. data/lib/ffi/libfuse/adapter/context.rb +12 -10
  13. data/lib/ffi/libfuse/adapter/fuse2_compat.rb +52 -51
  14. data/lib/ffi/libfuse/adapter/fuse3_support.rb +0 -1
  15. data/lib/ffi/libfuse/adapter/ruby.rb +499 -148
  16. data/lib/ffi/libfuse/adapter/safe.rb +1 -1
  17. data/lib/ffi/libfuse/adapter.rb +1 -2
  18. data/lib/ffi/libfuse/callbacks.rb +1 -1
  19. data/lib/ffi/libfuse/filesystem/accounting.rb +116 -0
  20. data/lib/ffi/libfuse/filesystem/mapped_dir.rb +74 -0
  21. data/lib/ffi/libfuse/filesystem/mapped_files.rb +141 -0
  22. data/lib/ffi/libfuse/filesystem/pass_through_dir.rb +55 -0
  23. data/lib/ffi/libfuse/filesystem/pass_through_file.rb +45 -0
  24. data/lib/ffi/libfuse/filesystem/utils.rb +102 -0
  25. data/lib/ffi/libfuse/filesystem/virtual_dir.rb +306 -0
  26. data/lib/ffi/libfuse/filesystem/virtual_file.rb +94 -0
  27. data/lib/ffi/libfuse/filesystem/virtual_fs.rb +188 -0
  28. data/lib/ffi/libfuse/filesystem/virtual_node.rb +101 -0
  29. data/lib/ffi/libfuse/filesystem.rb +25 -0
  30. data/lib/ffi/libfuse/fuse2.rb +21 -21
  31. data/lib/ffi/libfuse/fuse3.rb +12 -12
  32. data/lib/ffi/libfuse/fuse_args.rb +69 -34
  33. data/lib/ffi/libfuse/fuse_buffer.rb +128 -26
  34. data/lib/ffi/libfuse/fuse_callbacks.rb +1 -5
  35. data/lib/ffi/libfuse/fuse_common.rb +55 -61
  36. data/lib/ffi/libfuse/fuse_config.rb +134 -143
  37. data/lib/ffi/libfuse/fuse_conn_info.rb +310 -134
  38. data/lib/ffi/libfuse/fuse_context.rb +45 -3
  39. data/lib/ffi/libfuse/fuse_operations.rb +43 -19
  40. data/lib/ffi/libfuse/fuse_version.rb +10 -6
  41. data/lib/ffi/libfuse/main.rb +80 -37
  42. data/lib/ffi/libfuse/thread_pool.rb +1 -1
  43. data/lib/ffi/libfuse/version.rb +1 -1
  44. data/lib/ffi/libfuse.rb +13 -4
  45. data/lib/ffi/ruby_object.rb +1 -1
  46. data/lib/ffi/stat/constants.rb +9 -0
  47. data/lib/ffi/stat/native.rb +36 -6
  48. data/lib/ffi/stat/time_spec.rb +28 -12
  49. data/lib/ffi/stat.rb +111 -22
  50. data/lib/ffi/stat_vfs.rb +59 -1
  51. data/lib/ffi/struct_wrapper.rb +22 -1
  52. data/sample/hello_fs.rb +54 -0
  53. data/sample/memory_fs.rb +5 -181
  54. data/sample/no_fs.rb +20 -21
  55. data/sample/pass_through_fs.rb +30 -0
  56. metadata +66 -7
  57. data/lib/ffi/libfuse/adapter/thread_local_context.rb +0 -36
metadata CHANGED
@@ -1,23 +1,65 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ffi-libfuse
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1.pre
4
+ version: 0.1.0.rc20220550
5
5
  platform: ruby
6
6
  authors:
7
7
  - Grant Gardner
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-09-15 00:00:00.000000000 Z
11
+ date: 2022-05-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: ffi
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '1'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '1'
27
+ - !ruby/object:Gem::Dependency
28
+ name: bundler-audit
15
29
  requirement: !ruby/object:Gem::Requirement
16
30
  requirements:
17
31
  - - ">="
18
32
  - !ruby/object:Gem::Version
19
33
  version: '0'
20
- type: :runtime
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ">="
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: minitest
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ">="
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ">="
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
55
+ - !ruby/object:Gem::Dependency
56
+ name: minitest-reporters
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - ">="
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
62
+ type: :development
21
63
  prerelease: false
22
64
  version_requirements: !ruby/object:Gem::Requirement
23
65
  requirements:
@@ -25,7 +67,7 @@ dependencies:
25
67
  - !ruby/object:Gem::Version
26
68
  version: '0'
27
69
  - !ruby/object:Gem::Dependency
28
- name: pry
70
+ name: rake
29
71
  requirement: !ruby/object:Gem::Requirement
30
72
  requirements:
31
73
  - - ">="
@@ -88,9 +130,13 @@ extensions: []
88
130
  extra_rdoc_files: []
89
131
  files:
90
132
  - ".yardopts"
133
+ - CHANGES.md
134
+ - LICENSE
91
135
  - README.md
92
136
  - lib/ffi/accessors.rb
137
+ - lib/ffi/boolean_int.rb
93
138
  - lib/ffi/devt.rb
139
+ - lib/ffi/encoding.rb
94
140
  - lib/ffi/flock.rb
95
141
  - lib/ffi/gnu_extensions.rb
96
142
  - lib/ffi/libfuse.rb
@@ -104,8 +150,18 @@ files:
104
150
  - lib/ffi/libfuse/adapter/pathname.rb
105
151
  - lib/ffi/libfuse/adapter/ruby.rb
106
152
  - lib/ffi/libfuse/adapter/safe.rb
107
- - lib/ffi/libfuse/adapter/thread_local_context.rb
108
153
  - lib/ffi/libfuse/callbacks.rb
154
+ - lib/ffi/libfuse/filesystem.rb
155
+ - lib/ffi/libfuse/filesystem/accounting.rb
156
+ - lib/ffi/libfuse/filesystem/mapped_dir.rb
157
+ - lib/ffi/libfuse/filesystem/mapped_files.rb
158
+ - lib/ffi/libfuse/filesystem/pass_through_dir.rb
159
+ - lib/ffi/libfuse/filesystem/pass_through_file.rb
160
+ - lib/ffi/libfuse/filesystem/utils.rb
161
+ - lib/ffi/libfuse/filesystem/virtual_dir.rb
162
+ - lib/ffi/libfuse/filesystem/virtual_file.rb
163
+ - lib/ffi/libfuse/filesystem/virtual_fs.rb
164
+ - lib/ffi/libfuse/filesystem/virtual_node.rb
109
165
  - lib/ffi/libfuse/fuse2.rb
110
166
  - lib/ffi/libfuse/fuse3.rb
111
167
  - lib/ffi/libfuse/fuse_args.rb
@@ -136,13 +192,16 @@ files:
136
192
  - lib/ffi/stat_vfs.rb
137
193
  - lib/ffi/struct_array.rb
138
194
  - lib/ffi/struct_wrapper.rb
195
+ - sample/hello_fs.rb
139
196
  - sample/memory_fs.rb
140
197
  - sample/no_fs.rb
198
+ - sample/pass_through_fs.rb
141
199
  homepage:
142
200
  licenses:
143
201
  - MIT
144
202
  metadata:
145
203
  source_code_uri: http://github.com/lwoggardner/ffi-libfuse
204
+ rubygems_mfa_required: 'true'
146
205
  post_install_message:
147
206
  rdoc_options: []
148
207
  require_paths:
@@ -151,14 +210,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
151
210
  requirements:
152
211
  - - ">="
153
212
  - !ruby/object:Gem::Version
154
- version: 2.6.0
213
+ version: 2.7.0
155
214
  required_rubygems_version: !ruby/object:Gem::Requirement
156
215
  requirements:
157
216
  - - ">"
158
217
  - !ruby/object:Gem::Version
159
218
  version: 1.3.1
160
219
  requirements: []
161
- rubygems_version: 3.0.9
220
+ rubygems_version: 3.1.2
162
221
  signing_key:
163
222
  specification_version: 4
164
223
  summary: FFI Bindings for Libfuse
@@ -1,36 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require_relative '../fuse_context'
4
-
5
- module FFI
6
- module Libfuse
7
- module Adapter
8
- # Injects a wrapper via #{FuseCallbacks#fuse_wrappers} make the current {FuseContext} object available to
9
- # callbacks (except :destroy) via thread local variable :fuse_context
10
- module ThreadLocalContext
11
- # @!visibility private
12
- def fuse_wrappers(*wrappers)
13
- wrappers.unshift(
14
- {
15
- wrapper: proc { |_fm, *args, **_, &b| self.class.thread_local_context(*args, &b) },
16
- excludes: %i[destroy]
17
- }
18
- )
19
- return wrappers unless defined?(super)
20
-
21
- super(*wrappers)
22
- end
23
-
24
- module_function
25
-
26
- # Stores {FuseContext} in thread local variable :fuse_context before yielding
27
- def thread_local_context(*args)
28
- Thread.current[:fuse_context] = FuseContext.get
29
- yield(*args)
30
- ensure
31
- Thread.current[:fuse_context] = nil
32
- end
33
- end
34
- end
35
- end
36
- end