rfuse 1.0.5 → 1.1.0.RC0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.yardopts +2 -0
- data/CHANGES.md +12 -0
- data/README.md +7 -9
- data/ext/rfuse/context.c +13 -2
- data/ext/rfuse/file_info.c +4 -1
- data/ext/rfuse/filler.c +1 -1
- data/ext/rfuse/rfuse.c +24 -6
- data/lib/rfuse/version.rb +1 -1
- data/lib/rfuse.rb +362 -41
- data/rfuse.gemspec +1 -1
- data/sample/test-ruby.rb +7 -36
- data/spec/basic_spec.rb +4 -6
- data/spec/fuse_file_info_spec.rb +6 -6
- data/spec/main_spec.rb +161 -0
- data/spec/options_spec.rb +22 -22
- data/spec/ruby_loop_spec.rb +15 -17
- data/spec/run_spec.rb +60 -0
- data/spec/signals_spec.rb +108 -0
- data/spec/spec_helper.rb +56 -10
- data/spec/xattr_spec.rb +1 -1
- metadata +29 -49
- data/.travis.disabled.yml +0 -8
data/spec/spec_helper.rb
CHANGED
@@ -15,6 +15,14 @@ class FileModeMatcher
|
|
15
15
|
end
|
16
16
|
end
|
17
17
|
|
18
|
+
module DoubleAliases
|
19
|
+
def mock(*args, &block)
|
20
|
+
double(*args, &block)
|
21
|
+
end
|
22
|
+
alias stub mock
|
23
|
+
end
|
24
|
+
|
25
|
+
|
18
26
|
module RFuseHelper
|
19
27
|
# Runs the single threaded fuse loop
|
20
28
|
# on a pre configured mock fuse filesystem
|
@@ -22,22 +30,34 @@ module RFuseHelper
|
|
22
30
|
# that is expected to return success
|
23
31
|
def with_fuse(mnt,mockfs,*options,&fork_block)
|
24
32
|
|
25
|
-
|
26
|
-
|
33
|
+
fuse = RFuse::FuseDelegator.new(mockfs,mnt,*options)
|
34
|
+
fuse.mounted?.should be(true)
|
35
|
+
fork_fuse(fuse) do
|
27
36
|
begin
|
28
37
|
fork_block.call() if fork_block
|
29
38
|
ensure
|
30
|
-
|
31
|
-
system("fusermount -u #{mnt}")
|
39
|
+
fusermount(mnt)
|
32
40
|
end
|
33
|
-
|
41
|
+
end
|
42
|
+
fuse.open_files.should be_empty()
|
43
|
+
fuse.mounted?.should be(false)
|
44
|
+
end
|
45
|
+
|
46
|
+
def fork_fuse(fuse,&fork_block)
|
47
|
+
|
48
|
+
fpid = Kernel.fork() { fork_block.call() }
|
34
49
|
|
35
|
-
fuse = RFuse::FuseDelegator.new(mockfs,mnt,*options)
|
36
50
|
fuse.loop
|
37
|
-
|
51
|
+
|
52
|
+
pid,result = Process.waitpid2(fpid)
|
38
53
|
result.should be_success
|
39
|
-
|
40
|
-
|
54
|
+
end
|
55
|
+
|
56
|
+
def fusermount(mnt)
|
57
|
+
unless system("fusermount -u #{mnt} >/dev/null 2>&1")
|
58
|
+
sleep(0.5)
|
59
|
+
system("fusermount -u #{mnt}")
|
60
|
+
end
|
41
61
|
end
|
42
62
|
|
43
63
|
def file_mode(mode)
|
@@ -60,4 +80,30 @@ module RFuseHelper
|
|
60
80
|
end
|
61
81
|
|
62
82
|
end
|
63
|
-
|
83
|
+
|
84
|
+
RSpec.configure do |config|
|
85
|
+
config.expect_with :rspec do |c|
|
86
|
+
c.syntax = [:should, :expect]
|
87
|
+
end
|
88
|
+
config.mock_with :rspec do |c|
|
89
|
+
c.syntax = [:should, :expect]
|
90
|
+
end
|
91
|
+
|
92
|
+
config.after(:suite) do
|
93
|
+
Dir.glob(Dir.tmpdir + "/rfuse-spec*") do |dir|
|
94
|
+
count = 0
|
95
|
+
begin
|
96
|
+
system("fusermount -u #{dir} >/dev/null 2>&1")
|
97
|
+
FileUtils.rmdir(dir)
|
98
|
+
rescue Errno::EBUSY
|
99
|
+
#puts "Cleaning up #{dir} is busy, retrying..."
|
100
|
+
sleep(0.5)
|
101
|
+
count = count + 1
|
102
|
+
retry unless count > 3
|
103
|
+
end
|
104
|
+
end
|
105
|
+
end
|
106
|
+
|
107
|
+
config.include RFuseHelper
|
108
|
+
config.include DoubleAliases
|
109
|
+
end
|
data/spec/xattr_spec.rb
CHANGED
@@ -40,7 +40,7 @@ describe RFuse::Fuse do
|
|
40
40
|
xattr.remove('user.one')
|
41
41
|
# And now with a non-ruby system #TODO. There'd be a way to guard this properly
|
42
42
|
if system("getfattr --version")
|
43
|
-
system("getfattr -d #{mountpoint}/myfile").should
|
43
|
+
system("getfattr -d #{mountpoint}/myfile > /dev/null").should be(true)
|
44
44
|
else
|
45
45
|
puts "Warning Skipping getfattr test"
|
46
46
|
end
|
metadata
CHANGED
@@ -1,126 +1,111 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rfuse
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
5
|
-
prerelease:
|
4
|
+
version: 1.1.0.RC0
|
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-
|
11
|
+
date: 2014-08-09 00:00:00.000000000 Z
|
13
12
|
dependencies:
|
14
13
|
- !ruby/object:Gem::Dependency
|
15
14
|
name: rake
|
16
15
|
requirement: !ruby/object:Gem::Requirement
|
17
|
-
none: false
|
18
16
|
requirements:
|
19
|
-
- -
|
17
|
+
- - ">="
|
20
18
|
- !ruby/object:Gem::Version
|
21
19
|
version: '0'
|
22
20
|
type: :development
|
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
26
|
version: '0'
|
30
27
|
- !ruby/object:Gem::Dependency
|
31
28
|
name: rake-compiler
|
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:
|
47
|
+
version: 3.0.0
|
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:
|
54
|
+
version: 3.0.0
|
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: ffi-xattr
|
96
85
|
requirement: !ruby/object:Gem::Requirement
|
97
|
-
none: false
|
98
86
|
requirements:
|
99
|
-
- -
|
87
|
+
- - ">="
|
100
88
|
- !ruby/object:Gem::Version
|
101
89
|
version: '0'
|
102
90
|
type: :development
|
103
91
|
prerelease: false
|
104
92
|
version_requirements: !ruby/object:Gem::Requirement
|
105
|
-
none: false
|
106
93
|
requirements:
|
107
|
-
- -
|
94
|
+
- - ">="
|
108
95
|
- !ruby/object:Gem::Version
|
109
96
|
version: '0'
|
110
97
|
- !ruby/object:Gem::Dependency
|
111
98
|
name: sys-filesystem
|
112
99
|
requirement: !ruby/object:Gem::Requirement
|
113
|
-
none: false
|
114
100
|
requirements:
|
115
|
-
- -
|
101
|
+
- - ">="
|
116
102
|
- !ruby/object:Gem::Version
|
117
103
|
version: '0'
|
118
104
|
type: :development
|
119
105
|
prerelease: false
|
120
106
|
version_requirements: !ruby/object:Gem::Requirement
|
121
|
-
none: false
|
122
107
|
requirements:
|
123
|
-
- -
|
108
|
+
- - ">="
|
124
109
|
- !ruby/object:Gem::Version
|
125
110
|
version: '0'
|
126
111
|
description: Write userspace filesystems in Ruby
|
@@ -132,9 +117,8 @@ extensions:
|
|
132
117
|
extra_rdoc_files:
|
133
118
|
- CHANGES.md
|
134
119
|
files:
|
135
|
-
- .gitignore
|
136
|
-
- .
|
137
|
-
- .yardopts
|
120
|
+
- ".gitignore"
|
121
|
+
- ".yardopts"
|
138
122
|
- CHANGES.md
|
139
123
|
- Gemfile
|
140
124
|
- LICENSE
|
@@ -169,39 +153,35 @@ files:
|
|
169
153
|
- sample/test-ruby.rb
|
170
154
|
- spec/basic_spec.rb
|
171
155
|
- spec/fuse_file_info_spec.rb
|
156
|
+
- spec/main_spec.rb
|
172
157
|
- spec/options_spec.rb
|
173
158
|
- spec/ruby_loop_spec.rb
|
159
|
+
- spec/run_spec.rb
|
160
|
+
- spec/signals_spec.rb
|
174
161
|
- spec/spec_helper.rb
|
175
162
|
- spec/xattr_spec.rb
|
176
163
|
homepage: http://rubygems.org/gems/rfuse
|
177
164
|
licenses: []
|
165
|
+
metadata: {}
|
178
166
|
post_install_message:
|
179
167
|
rdoc_options: []
|
180
168
|
require_paths:
|
181
169
|
- lib
|
182
170
|
required_ruby_version: !ruby/object:Gem::Requirement
|
183
|
-
none: false
|
184
171
|
requirements:
|
185
|
-
- -
|
172
|
+
- - ">="
|
186
173
|
- !ruby/object:Gem::Version
|
187
174
|
version: '0'
|
188
|
-
segments:
|
189
|
-
- 0
|
190
|
-
hash: -3665206299893394824
|
191
175
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
192
|
-
none: false
|
193
176
|
requirements:
|
194
|
-
- -
|
177
|
+
- - ">"
|
195
178
|
- !ruby/object:Gem::Version
|
196
|
-
version:
|
197
|
-
segments:
|
198
|
-
- 0
|
199
|
-
hash: -3665206299893394824
|
179
|
+
version: 1.3.1
|
200
180
|
requirements: []
|
201
181
|
rubyforge_project:
|
202
|
-
rubygems_version:
|
182
|
+
rubygems_version: 2.2.2
|
203
183
|
signing_key:
|
204
|
-
specification_version:
|
184
|
+
specification_version: 4
|
205
185
|
summary: Ruby language binding for FUSE
|
206
186
|
test_files: []
|
207
187
|
has_rdoc: yard
|