dokan-ruby 0.0.1-mswin32
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/LICENSE +20 -0
- data/README.rdoc +39 -0
- data/Rakefile +63 -0
- data/VERSION +1 -0
- data/dokan-ruby.gemspec +66 -0
- data/ext/dokan-ruby-0.1.5.1229/API.txt +45 -0
- data/ext/dokan-ruby-0.1.5.1229/dokan_lib.c +1987 -0
- data/ext/dokan-ruby-0.1.5.1229/dokan_lib.so +0 -0
- data/ext/dokan-ruby-0.1.5.1229/extconf.rb +11 -0
- data/ext/dokan-ruby-0.1.5.1229/lib/dokanfs.rb +390 -0
- data/ext/dokan-ruby-0.1.5.1229/license.txt +19 -0
- data/ext/dokan-ruby-0.1.5.1229/list.h +144 -0
- data/ext/dokan-ruby-0.1.5.1229/readme.ja.txt +66 -0
- data/ext/dokan-ruby-0.1.5.1229/readme.txt +70 -0
- data/ext/dokan-ruby-0.1.5.1229/sample/hello.rb +39 -0
- data/ext/dokan-ruby-0.1.5.1229/sample/mirror.rb +178 -0
- data/ext/dokan-ruby-0.1.5.1229/sample/rssfs.rb +52 -0
- data/ext/dokan-ruby-0.1.5.1229/sample/sshfs.rb +163 -0
- data/ext/dokan-ruby-0.1.5.1229/sample/test.rb +115 -0
- data/lib/dokan-ruby.rb +1 -0
- data/test/dokan-ruby_test.rb +29 -0
- data/test/test_helper.rb +11 -0
- metadata +90 -0
@@ -0,0 +1,115 @@
|
|
1
|
+
|
2
|
+
require 'dokan_lib'
|
3
|
+
|
4
|
+
class Hello
|
5
|
+
|
6
|
+
def initialize
|
7
|
+
@hello = "hello, world"
|
8
|
+
end
|
9
|
+
|
10
|
+
def open(path, fileinfo)
|
11
|
+
puts "#open " + path
|
12
|
+
path == "/hello.txt" or path == "/"
|
13
|
+
end
|
14
|
+
|
15
|
+
def create(path, fileinfo)
|
16
|
+
puts "#create " + path
|
17
|
+
false
|
18
|
+
end
|
19
|
+
|
20
|
+
def truncate(path, length, fileinfo)
|
21
|
+
puts "#truncate " + path
|
22
|
+
false
|
23
|
+
end
|
24
|
+
|
25
|
+
def opendir(path, fileinfo)
|
26
|
+
puts "#opendir " + path
|
27
|
+
true
|
28
|
+
end
|
29
|
+
|
30
|
+
def mkdir(path, fileinfo)
|
31
|
+
puts "#mkdir " + path
|
32
|
+
false
|
33
|
+
end
|
34
|
+
|
35
|
+
def close(path, fileinfo)
|
36
|
+
puts "#close " + path
|
37
|
+
true
|
38
|
+
end
|
39
|
+
|
40
|
+
def cleanup(path, fileinfo)
|
41
|
+
puts "#cleanup " + path
|
42
|
+
true
|
43
|
+
end
|
44
|
+
|
45
|
+
def read(path, offset, length, fileinfo)
|
46
|
+
puts "#read " + path
|
47
|
+
if offset < @hello.length
|
48
|
+
@hello[offset, length]
|
49
|
+
else
|
50
|
+
false
|
51
|
+
end
|
52
|
+
end
|
53
|
+
|
54
|
+
def write(path, offset, data, fileinfo)
|
55
|
+
puts "#write " + path
|
56
|
+
false
|
57
|
+
end
|
58
|
+
|
59
|
+
def flush(path, fileinfo)
|
60
|
+
true
|
61
|
+
end
|
62
|
+
|
63
|
+
def stat(path, fileinfo)
|
64
|
+
puts "#fstat " + path
|
65
|
+
#[size, attr, ctime, atime, mtime]
|
66
|
+
if path == "/hello.txt"
|
67
|
+
[@hello.length, Dokan::NORMAL, 0, 0, 0]
|
68
|
+
elsif path == "/"
|
69
|
+
[0, Dokan::DIRECTORY, 0, 0, 0]
|
70
|
+
else
|
71
|
+
false
|
72
|
+
end
|
73
|
+
end
|
74
|
+
|
75
|
+
# def readdira(path, fileinfo)
|
76
|
+
# end
|
77
|
+
|
78
|
+
def readdir(path, fileinfo)
|
79
|
+
puts "#readdir " + path
|
80
|
+
["hello.txt"]
|
81
|
+
end
|
82
|
+
|
83
|
+
def setattr(path, attr, fileinfo)
|
84
|
+
puts "#setattr " + path
|
85
|
+
false
|
86
|
+
end
|
87
|
+
|
88
|
+
def utime(path, ctime, atime, mtime, fileinfo)
|
89
|
+
puts "#utime " + path
|
90
|
+
false
|
91
|
+
end
|
92
|
+
|
93
|
+
def remove(path, fileinfo)
|
94
|
+
puts "#remove " + path
|
95
|
+
false
|
96
|
+
end
|
97
|
+
|
98
|
+
def rename(path, newpath, fileinfo)
|
99
|
+
false
|
100
|
+
end
|
101
|
+
|
102
|
+
def rmdir(path, fileinfo)
|
103
|
+
false
|
104
|
+
end
|
105
|
+
|
106
|
+
def unmount(fileinfo)
|
107
|
+
puts "#unmount"
|
108
|
+
true
|
109
|
+
end
|
110
|
+
end
|
111
|
+
|
112
|
+
|
113
|
+
|
114
|
+
Dokan.mount("r", Hello.new)
|
115
|
+
|
data/lib/dokan-ruby.rb
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
require 'dokanfs'
|
@@ -0,0 +1,29 @@
|
|
1
|
+
require 'test_helper'
|
2
|
+
|
3
|
+
class DokanRubyTest < Test::Unit::TestCase
|
4
|
+
|
5
|
+
#should "probably rename this file and start testing for real" do
|
6
|
+
# flunk "hey buddy, you should probably rename this file and start testing for real"
|
7
|
+
#end
|
8
|
+
|
9
|
+
context "The hello.rb sample" do
|
10
|
+
|
11
|
+
setup do
|
12
|
+
@fs = Thread.new do
|
13
|
+
require 'hello.rb'
|
14
|
+
end
|
15
|
+
end
|
16
|
+
|
17
|
+
should "contain hello.txt" do
|
18
|
+
asert File.exists?("r:/hello.txt")
|
19
|
+
end
|
20
|
+
|
21
|
+
end
|
22
|
+
|
23
|
+
#should "mount the hello sample" do
|
24
|
+
#
|
25
|
+
# assert_equal( File.open("r:/hello.txt").read, "hello, world" )
|
26
|
+
# system("dokanctl.exe /u")
|
27
|
+
#end
|
28
|
+
|
29
|
+
end
|
data/test/test_helper.rb
ADDED
@@ -0,0 +1,11 @@
|
|
1
|
+
require 'rubygems'
|
2
|
+
require 'test/unit'
|
3
|
+
require 'shoulda'
|
4
|
+
|
5
|
+
$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
|
6
|
+
$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'ext/dokan-ruby-0.1.5.1229/sample'))
|
7
|
+
$LOAD_PATH.unshift(File.dirname(__FILE__))
|
8
|
+
require 'dokan-ruby'
|
9
|
+
|
10
|
+
class Test::Unit::TestCase
|
11
|
+
end
|
metadata
ADDED
@@ -0,0 +1,90 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: dokan-ruby
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1
|
5
|
+
platform: mswin32
|
6
|
+
authors:
|
7
|
+
- AncientLeGrey
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
|
12
|
+
date: 2009-10-16 00:00:00 +02:00
|
13
|
+
default_executable:
|
14
|
+
dependencies:
|
15
|
+
- !ruby/object:Gem::Dependency
|
16
|
+
name: shoulda
|
17
|
+
type: :development
|
18
|
+
version_requirement:
|
19
|
+
version_requirements: !ruby/object:Gem::Requirement
|
20
|
+
requirements:
|
21
|
+
- - ">="
|
22
|
+
- !ruby/object:Gem::Version
|
23
|
+
version: "0"
|
24
|
+
version:
|
25
|
+
description: Dokan ist a "file system in userspace" driver for Win32. With dokan-ruby bindings, you can implement your own filesystem in Ruby!
|
26
|
+
email: greyhound@freenet.de
|
27
|
+
executables: []
|
28
|
+
|
29
|
+
extensions: []
|
30
|
+
|
31
|
+
extra_rdoc_files:
|
32
|
+
- LICENSE
|
33
|
+
- README.rdoc
|
34
|
+
files:
|
35
|
+
- LICENSE
|
36
|
+
- README.rdoc
|
37
|
+
- Rakefile
|
38
|
+
- VERSION
|
39
|
+
- dokan-ruby.gemspec
|
40
|
+
- ext/dokan-ruby-0.1.5.1229/API.txt
|
41
|
+
- ext/dokan-ruby-0.1.5.1229/dokan_lib.c
|
42
|
+
- ext/dokan-ruby-0.1.5.1229/dokan_lib.so
|
43
|
+
- ext/dokan-ruby-0.1.5.1229/extconf.rb
|
44
|
+
- ext/dokan-ruby-0.1.5.1229/lib/dokanfs.rb
|
45
|
+
- ext/dokan-ruby-0.1.5.1229/license.txt
|
46
|
+
- ext/dokan-ruby-0.1.5.1229/list.h
|
47
|
+
- ext/dokan-ruby-0.1.5.1229/readme.ja.txt
|
48
|
+
- ext/dokan-ruby-0.1.5.1229/readme.txt
|
49
|
+
- ext/dokan-ruby-0.1.5.1229/sample/hello.rb
|
50
|
+
- ext/dokan-ruby-0.1.5.1229/sample/mirror.rb
|
51
|
+
- ext/dokan-ruby-0.1.5.1229/sample/rssfs.rb
|
52
|
+
- ext/dokan-ruby-0.1.5.1229/sample/sshfs.rb
|
53
|
+
- ext/dokan-ruby-0.1.5.1229/sample/test.rb
|
54
|
+
- lib/dokan-ruby.rb
|
55
|
+
- test/dokan-ruby_test.rb
|
56
|
+
- test/test_helper.rb
|
57
|
+
has_rdoc: true
|
58
|
+
homepage: http://github.com/AncientLeGrey/dokan-ruby
|
59
|
+
licenses: []
|
60
|
+
|
61
|
+
post_install_message:
|
62
|
+
rdoc_options:
|
63
|
+
- --exclude
|
64
|
+
- dokan_lib.c
|
65
|
+
require_paths:
|
66
|
+
- lib
|
67
|
+
- ext/dokan-ruby-0.1.5.1229
|
68
|
+
- ext/dokan-ruby-0.1.5.1229/lib
|
69
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
70
|
+
requirements:
|
71
|
+
- - ">="
|
72
|
+
- !ruby/object:Gem::Version
|
73
|
+
version: "0"
|
74
|
+
version:
|
75
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
76
|
+
requirements:
|
77
|
+
- - ">="
|
78
|
+
- !ruby/object:Gem::Version
|
79
|
+
version: "0"
|
80
|
+
version:
|
81
|
+
requirements: []
|
82
|
+
|
83
|
+
rubyforge_project:
|
84
|
+
rubygems_version: 1.3.5
|
85
|
+
signing_key:
|
86
|
+
specification_version: 3
|
87
|
+
summary: Ruby extension to write a windows file system (depending on Dokan library)
|
88
|
+
test_files:
|
89
|
+
- test/dokan-ruby_test.rb
|
90
|
+
- test/test_helper.rb
|