win32-pipe 0.2.0 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGES +7 -0
- data/MANIFEST +7 -7
- data/README +18 -19
- data/Rakefile +14 -31
- data/examples/{test_client.rb → example_client.rb} +1 -1
- data/examples/{test_client_async.rb → example_client_async.rb} +1 -1
- data/examples/{test_server.rb → example_server.rb} +1 -1
- data/examples/{test_server_async.rb → example_server_async.rb} +1 -1
- data/lib/win32/pipe.rb +3 -2
- data/test/{tc_pipe.rb → test_win32_pipe.rb} +3 -3
- data/test/{tc_pipe_client.rb → test_win32_pipe_client.rb} +1 -1
- data/test/{tc_pipe_server.rb → test_win32_pipe_server.rb} +1 -1
- data/win32-pipe.gemspec +22 -20
- metadata +64 -50
data/CHANGES
CHANGED
@@ -1,3 +1,10 @@
|
|
1
|
+
== 0.2.1 - 9-Aug-2009
|
2
|
+
* License changed to Artistic 2.0.
|
3
|
+
* Test and example files renamed.
|
4
|
+
* Gemspec updates, including license and description.
|
5
|
+
* Updates to the Rakefile, including the removal of old C rake tasks, as
|
6
|
+
well as the addition of tasks to run the example programs.
|
7
|
+
|
1
8
|
== 0.2.0 - 28-May-2008
|
2
9
|
* Now pure Ruby.
|
3
10
|
* Major interface change. Pipe::Server.new and Pipe::Client.new replace the
|
data/MANIFEST
CHANGED
@@ -3,13 +3,13 @@
|
|
3
3
|
* CHANGES
|
4
4
|
* Rakefile
|
5
5
|
* win32-pipe.gemspec
|
6
|
-
* examples/
|
7
|
-
* examples/
|
8
|
-
* examples/
|
9
|
-
* examples/
|
6
|
+
* examples/example_server.rb
|
7
|
+
* examples/example_server_async.rb
|
8
|
+
* examples/example_client.rb
|
9
|
+
* examples/example_client_async.rb
|
10
10
|
* lib/win32/pipe.rb
|
11
11
|
* lib/win32/pipe/client.rb
|
12
12
|
* lib/win32/pipe/server.rb
|
13
|
-
* test/
|
14
|
-
* test/
|
15
|
-
* test/
|
13
|
+
* test/test_win32_pipe.rb
|
14
|
+
* test/test_win32_pipe_client.rb
|
15
|
+
* test/test_win32_pipe_server.rb
|
data/README
CHANGED
@@ -1,17 +1,16 @@
|
|
1
|
-
|
1
|
+
== Description
|
2
2
|
A Ruby interface for named pipes on Windows.
|
3
3
|
|
4
|
-
|
4
|
+
== Prerequisites
|
5
5
|
* windows-pr 0.8.5 or later
|
6
6
|
|
7
|
-
|
8
|
-
|
9
|
-
rake install (non-gem) or rake install_gem (gem)
|
10
|
-
|
11
|
-
== Remote
|
7
|
+
== Installation
|
8
|
+
=== Gem Installation
|
12
9
|
gem install win32-pipe
|
10
|
+
=== Local
|
11
|
+
rake install
|
13
12
|
|
14
|
-
|
13
|
+
== Synopsis
|
15
14
|
require 'win32/pipe'
|
16
15
|
include Win32
|
17
16
|
|
@@ -27,30 +26,30 @@
|
|
27
26
|
pipe_client.write("Hello World")
|
28
27
|
pipe_client.close
|
29
28
|
|
30
|
-
|
29
|
+
== What's a named pipe?
|
31
30
|
A pipe with a name - literally. In practice, it will feel more like a cross
|
32
31
|
between a socket and a pipe. At least, it does to me.
|
33
32
|
|
34
|
-
|
33
|
+
== What good is it?
|
35
34
|
My hope is that it can be used in certain circumstances where a fork might
|
36
35
|
be desirable, but which is not possible on Windows. It could also be handy
|
37
|
-
for the traditional "piping data to a server" usage.
|
36
|
+
for the traditional "piping data to a server" usage. And if you come up
|
38
37
|
with anything cool, please let us all know!
|
39
38
|
|
40
|
-
|
41
|
-
|
39
|
+
== Future Plans
|
40
|
+
Add transactions
|
42
41
|
|
43
|
-
|
44
|
-
|
42
|
+
== License
|
43
|
+
Artistic
|
45
44
|
|
46
|
-
|
45
|
+
== Warranty
|
47
46
|
This package is provided "as is" and without any express or
|
48
47
|
implied warranties, including, without limitation, the implied
|
49
48
|
warranties of merchantability and fitness for a particular purpose.
|
50
49
|
|
51
|
-
|
52
|
-
(C) 2003-
|
50
|
+
== Copyright
|
51
|
+
(C) 2003-2009, Daniel J. Berger, All Rights Reserved.
|
53
52
|
|
54
|
-
|
53
|
+
== Authors
|
55
54
|
Daniel Berger
|
56
55
|
Park Heesob
|
data/Rakefile
CHANGED
@@ -22,44 +22,27 @@ task :install do
|
|
22
22
|
FileUtils.cp(server_file, sub_installdir, :verbose => true)
|
23
23
|
end
|
24
24
|
|
25
|
-
desc '
|
26
|
-
task :
|
27
|
-
|
28
|
-
sh 'nmake install'
|
29
|
-
}
|
25
|
+
desc 'Run the asynchronous client example program'
|
26
|
+
task :example_async_client do
|
27
|
+
ruby '-Ilib examples/example_client_async.rb'
|
30
28
|
end
|
31
29
|
|
32
|
-
desc
|
33
|
-
task :
|
34
|
-
|
35
|
-
if File.exists?('pipe.so') ||
|
36
|
-
File.exists?('win32/pipe.so')
|
37
|
-
then
|
38
|
-
sh 'nmake distclean'
|
39
|
-
rm 'win32/pipe.so' if File.exists?('win32/pipe.so')
|
40
|
-
end
|
41
|
-
end
|
30
|
+
desc 'Run the client example program'
|
31
|
+
task :example_client do
|
32
|
+
ruby '-Ilib examples/example_client.rb'
|
42
33
|
end
|
43
34
|
|
44
|
-
desc
|
45
|
-
task :
|
46
|
-
|
47
|
-
ruby 'extconf.rb'
|
48
|
-
sh 'nmake'
|
49
|
-
mv 'pipe.so', 'win32' # For the test suite
|
50
|
-
end
|
35
|
+
desc 'Run the asynchronous server example program'
|
36
|
+
task :example_async_server do
|
37
|
+
ruby '-Ilib examples/example_server_async.rb'
|
51
38
|
end
|
52
39
|
|
53
|
-
desc
|
54
|
-
task :
|
55
|
-
|
56
|
-
sh 'ruby test.rb'
|
57
|
-
}
|
40
|
+
desc 'Run the server example program'
|
41
|
+
task :example_server do
|
42
|
+
ruby '-Ilib examples/example_server.rb'
|
58
43
|
end
|
59
44
|
|
60
|
-
Rake::TestTask.new
|
61
|
-
test.libs << 'lib/win32'
|
62
|
-
test.libs << 'lib/win32/pipe'
|
63
|
-
test.test_files = FileList['test/tc*']
|
45
|
+
Rake::TestTask.new do |test|
|
64
46
|
test.warning = true
|
47
|
+
test.verbose = true
|
65
48
|
end
|
@@ -1,5 +1,5 @@
|
|
1
1
|
#########################################################################
|
2
|
-
#
|
2
|
+
# example_client_async.rb
|
3
3
|
#
|
4
4
|
# Simple client test. Be sure to start the server first in a separate
|
5
5
|
# terminal. You can run this example via the 'rake example_async_client'
|
data/lib/win32/pipe.rb
CHANGED
@@ -16,10 +16,11 @@ module Win32
|
|
16
16
|
include Windows::File
|
17
17
|
include Windows::Error
|
18
18
|
|
19
|
+
# Error typically raised if any of the Pipe methods fail.
|
19
20
|
class Error < StandardError; end
|
20
21
|
|
21
22
|
# The version of this library
|
22
|
-
VERSION = '0.2.
|
23
|
+
VERSION = '0.2.1'
|
23
24
|
|
24
25
|
PIPE_BUFFER_SIZE = 512 #:nodoc:
|
25
26
|
PIPE_TIMEOUT = 5000 #:nodoc:
|
@@ -94,7 +95,7 @@ module Win32
|
|
94
95
|
# The default open mode is FILE_ATTRIBUTE_NORMAL | FILE_FLAG_WRITE_THROUGH.
|
95
96
|
#
|
96
97
|
def initialize(name, pipe_mode = DEFAULT_PIPE_MODE, open_mode = DEFAULT_OPEN_MODE)
|
97
|
-
@name
|
98
|
+
@name = "\\\\.\\pipe\\" + name
|
98
99
|
|
99
100
|
@pipe_mode = pipe_mode.nil? ? DEFAULT_PIPE_MODE : pipe_mode
|
100
101
|
@open_mode = open_mode.nil? ? DEFAULT_OPEN_MODE : open_mode
|
@@ -1,5 +1,5 @@
|
|
1
1
|
##########################################################################
|
2
|
-
#
|
2
|
+
# test_win32_pipe.rb
|
3
3
|
#
|
4
4
|
# Test suite for the win32-pipe library. This test suite should be run
|
5
5
|
# via the 'rake test' task.
|
@@ -14,7 +14,7 @@ class TC_Win32_Pipe < Test::Unit::TestCase
|
|
14
14
|
end
|
15
15
|
|
16
16
|
def test_version
|
17
|
-
assert_equal('0.2.
|
17
|
+
assert_equal('0.2.1', Pipe::VERSION)
|
18
18
|
end
|
19
19
|
|
20
20
|
def test_name
|
@@ -79,7 +79,7 @@ class TC_Win32_Pipe < Test::Unit::TestCase
|
|
79
79
|
|
80
80
|
def test_write
|
81
81
|
assert_respond_to(@pipe, :write)
|
82
|
-
assert_raises(ArgumentError){ @pipe.write }
|
82
|
+
assert_raises(ArgumentError){ @pipe.write } # Must have 1 argument
|
83
83
|
assert_raises(Pipe::Error){ @pipe.write("foo") } # Nothing to write to
|
84
84
|
end
|
85
85
|
|
data/win32-pipe.gemspec
CHANGED
@@ -1,26 +1,28 @@
|
|
1
|
-
require
|
1
|
+
require 'rubygems'
|
2
2
|
|
3
3
|
spec = Gem::Specification.new do |gem|
|
4
|
-
gem.name
|
5
|
-
gem.version
|
6
|
-
gem.author
|
7
|
-
|
8
|
-
gem.
|
9
|
-
gem.
|
10
|
-
gem.
|
11
|
-
gem.
|
12
|
-
gem.test_files
|
13
|
-
gem.has_rdoc
|
4
|
+
gem.name = 'win32-pipe'
|
5
|
+
gem.version = '0.2.1'
|
6
|
+
gem.author = 'Daniel J. Berger'
|
7
|
+
gem.license = 'Artistic 2.0'
|
8
|
+
gem.email = 'djberg96@gmail.com'
|
9
|
+
gem.homepage = 'http://www.rubyforge.org/projects/win32utils'
|
10
|
+
gem.platform = Gem::Platform::RUBY
|
11
|
+
gem.summary = 'An interface for named pipes on MS Windows'
|
12
|
+
gem.test_files = Dir['test/test_*.rb']
|
13
|
+
gem.has_rdoc = true
|
14
|
+
gem.files = Dir['**/*'].reject{ |f| f.include?('CVS') }
|
15
|
+
|
16
|
+
gem.rubyforge_project = 'win32utils'
|
14
17
|
gem.extra_rdoc_files = ['CHANGES', 'README', 'MANIFEST']
|
15
|
-
gem.rubyforge_project = "win32utils"
|
16
18
|
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
19
|
+
gem.add_dependency('windows-pr', '>= 1.0.6')
|
20
|
+
|
21
|
+
gem.description = <<-EOF
|
22
|
+
The win32-pipe library provides an interface for named pipes on Windows.
|
23
|
+
A named pipe is a named, one-way or duplex pipe for communication
|
24
|
+
between the pipe server and one or more pipe clients.
|
25
|
+
EOF
|
21
26
|
end
|
22
27
|
|
23
|
-
|
24
|
-
Gem.manage_gems
|
25
|
-
Gem::Builder.new(spec).build
|
26
|
-
end
|
28
|
+
Gem::Builder.new(spec).build
|
metadata
CHANGED
@@ -1,68 +1,82 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
|
-
rubygems_version: 0.9.4
|
3
|
-
specification_version: 1
|
4
2
|
name: win32-pipe
|
5
3
|
version: !ruby/object:Gem::Version
|
6
|
-
version: 0.2.
|
7
|
-
date: 2008-05-28 00:00:00 -06:00
|
8
|
-
summary: An interface for named pipes on MS Windows
|
9
|
-
require_paths:
|
10
|
-
- lib
|
11
|
-
email: djberg96@gmail.com
|
12
|
-
homepage: http://www.rubyforge.org/projects/win32utils
|
13
|
-
rubyforge_project: win32utils
|
14
|
-
description: An interface for named pipes on MS Windows
|
15
|
-
autorequire:
|
16
|
-
default_executable:
|
17
|
-
bindir: bin
|
18
|
-
has_rdoc: true
|
19
|
-
required_ruby_version: !ruby/object:Gem::Version::Requirement
|
20
|
-
requirements:
|
21
|
-
- - ">"
|
22
|
-
- !ruby/object:Gem::Version
|
23
|
-
version: 0.0.0
|
24
|
-
version:
|
4
|
+
version: 0.2.1
|
25
5
|
platform: ruby
|
26
|
-
signing_key:
|
27
|
-
cert_chain:
|
28
|
-
post_install_message:
|
29
6
|
authors:
|
30
7
|
- Daniel J. Berger
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
|
12
|
+
date: 2009-08-09 00:00:00 -06:00
|
13
|
+
default_executable:
|
14
|
+
dependencies:
|
15
|
+
- !ruby/object:Gem::Dependency
|
16
|
+
name: windows-pr
|
17
|
+
type: :runtime
|
18
|
+
version_requirement:
|
19
|
+
version_requirements: !ruby/object:Gem::Requirement
|
20
|
+
requirements:
|
21
|
+
- - ">="
|
22
|
+
- !ruby/object:Gem::Version
|
23
|
+
version: 1.0.6
|
24
|
+
version:
|
25
|
+
description: " The win32-pipe library provides an interface for named pipes on Windows.\n A named pipe is a named, one-way or duplex pipe for communication\n between the pipe server and one or more pipe clients. \n"
|
26
|
+
email: djberg96@gmail.com
|
27
|
+
executables: []
|
28
|
+
|
29
|
+
extensions: []
|
30
|
+
|
31
|
+
extra_rdoc_files:
|
32
|
+
- CHANGES
|
33
|
+
- README
|
34
|
+
- MANIFEST
|
31
35
|
files:
|
32
|
-
-
|
33
|
-
- examples/
|
34
|
-
- examples/
|
35
|
-
- examples/
|
36
|
+
- CHANGES
|
37
|
+
- examples/example_client.rb
|
38
|
+
- examples/example_client_async.rb
|
39
|
+
- examples/example_server.rb
|
40
|
+
- examples/example_server_async.rb
|
36
41
|
- lib/win32/pipe/client.rb
|
37
42
|
- lib/win32/pipe/server.rb
|
38
43
|
- lib/win32/pipe.rb
|
39
|
-
- test/tc_pipe.rb
|
40
|
-
- test/tc_pipe_client.rb
|
41
|
-
- test/tc_pipe_server.rb
|
42
|
-
- CHANGES
|
43
|
-
- examples
|
44
|
-
- ext
|
45
|
-
- lib
|
46
44
|
- MANIFEST
|
47
45
|
- Rakefile
|
48
46
|
- README
|
49
|
-
- test
|
47
|
+
- test/test_win32_pipe.rb
|
48
|
+
- test/test_win32_pipe_client.rb
|
49
|
+
- test/test_win32_pipe_server.rb
|
50
50
|
- win32-pipe.gemspec
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
-
|
51
|
+
has_rdoc: true
|
52
|
+
homepage: http://www.rubyforge.org/projects/win32utils
|
53
|
+
licenses:
|
54
|
+
- Artistic 2.0
|
55
|
+
post_install_message:
|
55
56
|
rdoc_options: []
|
56
57
|
|
57
|
-
|
58
|
-
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
58
|
+
require_paths:
|
59
|
+
- lib
|
60
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
61
|
+
requirements:
|
62
|
+
- - ">="
|
63
|
+
- !ruby/object:Gem::Version
|
64
|
+
version: "0"
|
65
|
+
version:
|
66
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
67
|
+
requirements:
|
68
|
+
- - ">="
|
69
|
+
- !ruby/object:Gem::Version
|
70
|
+
version: "0"
|
71
|
+
version:
|
65
72
|
requirements: []
|
66
73
|
|
67
|
-
|
68
|
-
|
74
|
+
rubyforge_project: win32utils
|
75
|
+
rubygems_version: 1.3.5
|
76
|
+
signing_key:
|
77
|
+
specification_version: 3
|
78
|
+
summary: An interface for named pipes on MS Windows
|
79
|
+
test_files:
|
80
|
+
- test/test_win32_pipe.rb
|
81
|
+
- test/test_win32_pipe_client.rb
|
82
|
+
- test/test_win32_pipe_server.rb
|