rbmount 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/lib/rbmount.rb +28 -0
- data/lib/rbmount/c.rb +399 -0
- data/lib/rbmount/cache.rb +76 -0
- data/lib/rbmount/context.rb +343 -0
- data/lib/rbmount/fs.rb +234 -0
- data/lib/rbmount/iterator.rb +48 -0
- data/lib/rbmount/lock.rb +51 -0
- data/lib/rbmount/mount.rb +103 -0
- data/lib/rbmount/string.rb +166 -0
- data/lib/rbmount/table.rb +188 -0
- data/lib/rbmount/update.rb +73 -0
- metadata +86 -0
@@ -0,0 +1,73 @@
|
|
1
|
+
#--
|
2
|
+
# Copyleft shura. [ shura1991@gmail.com ]
|
3
|
+
#
|
4
|
+
# This file is part of rbmount.
|
5
|
+
#
|
6
|
+
# rbmount is free software: you can redistribute it and/or modify
|
7
|
+
# it under the terms of the GNU Affero General Public License as published
|
8
|
+
# by the Free Software Foundation, either version 3 of the License, or
|
9
|
+
# (at your option) any later version.
|
10
|
+
#
|
11
|
+
# rbmount is distributed in the hope that it will be useful,
|
12
|
+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
13
|
+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
14
|
+
# GNU Affero General Public License for more details.
|
15
|
+
#
|
16
|
+
# You should have received a copy of the GNU Affero General Public License
|
17
|
+
# along with rbmount. If not, see <http://www.gnu.org/licenses/>.
|
18
|
+
#++
|
19
|
+
|
20
|
+
require 'rbmount/c'
|
21
|
+
require 'rbmount/fs'
|
22
|
+
|
23
|
+
module Mount
|
24
|
+
class Update
|
25
|
+
def initialize
|
26
|
+
@pointer = Mount::C.mnt_new_update
|
27
|
+
raise unless @pointer
|
28
|
+
|
29
|
+
ObjectSpace.define_finalizer(self, method(:finalize))
|
30
|
+
end
|
31
|
+
|
32
|
+
def read_only= (is_read_only)
|
33
|
+
Mount::C.mnt_update_force_rdonly(@pointer, !!is_read_only)
|
34
|
+
end
|
35
|
+
|
36
|
+
def filename
|
37
|
+
Mount::C.mnt_update_get_filename(@pointer)
|
38
|
+
end
|
39
|
+
|
40
|
+
def fs
|
41
|
+
Mount::C.mnt_update_get_fs(@pointer).tap {|fsp|
|
42
|
+
break Mount::FS.allocate.tap {|f| f.instance_eval {
|
43
|
+
@pointer = fsp
|
44
|
+
ObjectSpace.define_finalizer(self, method(:finalize))
|
45
|
+
}}
|
46
|
+
}
|
47
|
+
end
|
48
|
+
|
49
|
+
def mflags
|
50
|
+
Mount::C.mnt_update_get_mflags(@pointer)
|
51
|
+
end
|
52
|
+
|
53
|
+
def ready?
|
54
|
+
Mount::C.mnt_update_is_ready(@pointer)
|
55
|
+
end
|
56
|
+
|
57
|
+
def fs= (mountflags, target, fsp=nil)
|
58
|
+
Mount::C.mnt_update_set_fs(@pointer, mountflags, target, (fsp ? fsp.to_c : fsp))
|
59
|
+
end
|
60
|
+
|
61
|
+
def table (lc=nil)
|
62
|
+
Mount::C.mnt_update_table(@pointer, (lc ? lc.to_c : lc))
|
63
|
+
end
|
64
|
+
|
65
|
+
def finalize
|
66
|
+
Mount::C.mnt_free_update(@pointer)
|
67
|
+
end
|
68
|
+
|
69
|
+
def to_c
|
70
|
+
@pointer
|
71
|
+
end
|
72
|
+
end
|
73
|
+
end
|
metadata
ADDED
@@ -0,0 +1,86 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: rbmount
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
prerelease: false
|
5
|
+
segments:
|
6
|
+
- 0
|
7
|
+
- 0
|
8
|
+
- 1
|
9
|
+
version: 0.0.1
|
10
|
+
platform: ruby
|
11
|
+
authors:
|
12
|
+
- shura
|
13
|
+
autorequire:
|
14
|
+
bindir: bin
|
15
|
+
cert_chain: []
|
16
|
+
|
17
|
+
date: 2011-08-04 00:00:00 +02:00
|
18
|
+
default_executable:
|
19
|
+
dependencies:
|
20
|
+
- !ruby/object:Gem::Dependency
|
21
|
+
name: ffi
|
22
|
+
prerelease: false
|
23
|
+
requirement: &id001 !ruby/object:Gem::Requirement
|
24
|
+
none: false
|
25
|
+
requirements:
|
26
|
+
- - ">="
|
27
|
+
- !ruby/object:Gem::Version
|
28
|
+
segments:
|
29
|
+
- 0
|
30
|
+
version: "0"
|
31
|
+
type: :runtime
|
32
|
+
version_requirements: *id001
|
33
|
+
description: libmount ruby bindings
|
34
|
+
email: shura1991@gmail.com
|
35
|
+
executables: []
|
36
|
+
|
37
|
+
extensions: []
|
38
|
+
|
39
|
+
extra_rdoc_files: []
|
40
|
+
|
41
|
+
files:
|
42
|
+
- lib/rbmount/c.rb
|
43
|
+
- lib/rbmount/table.rb
|
44
|
+
- lib/rbmount/cache.rb
|
45
|
+
- lib/rbmount/iterator.rb
|
46
|
+
- lib/rbmount/fs.rb
|
47
|
+
- lib/rbmount/mount.rb
|
48
|
+
- lib/rbmount/context.rb
|
49
|
+
- lib/rbmount/update.rb
|
50
|
+
- lib/rbmount/string.rb
|
51
|
+
- lib/rbmount/lock.rb
|
52
|
+
- lib/rbmount.rb
|
53
|
+
has_rdoc: true
|
54
|
+
homepage: http://github.com/shurizzle/rbmount
|
55
|
+
licenses: []
|
56
|
+
|
57
|
+
post_install_message:
|
58
|
+
rdoc_options: []
|
59
|
+
|
60
|
+
require_paths:
|
61
|
+
- lib
|
62
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
63
|
+
none: false
|
64
|
+
requirements:
|
65
|
+
- - ">="
|
66
|
+
- !ruby/object:Gem::Version
|
67
|
+
segments:
|
68
|
+
- 0
|
69
|
+
version: "0"
|
70
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
71
|
+
none: false
|
72
|
+
requirements:
|
73
|
+
- - ">="
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
segments:
|
76
|
+
- 0
|
77
|
+
version: "0"
|
78
|
+
requirements: []
|
79
|
+
|
80
|
+
rubyforge_project:
|
81
|
+
rubygems_version: 1.3.7
|
82
|
+
signing_key:
|
83
|
+
specification_version: 3
|
84
|
+
summary: libmount ruby bindings
|
85
|
+
test_files: []
|
86
|
+
|