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 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/test_server.rb
7
- * examples/test_server_async.rb
8
- * examples/test_client.rb
9
- * examples/test_client_async.rb
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/tc_pipe.rb
14
- * test/tc_pipe_client.rb
15
- * test/tc_pipe_server.rb
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
- = Description
1
+ == Description
2
2
  A Ruby interface for named pipes on Windows.
3
3
 
4
- = Prerequisites
4
+ == Prerequisites
5
5
  * windows-pr 0.8.5 or later
6
6
 
7
- = Installation
8
- == Local
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
- = Synopsis
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
- = What's a named pipe?
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
- = What good is it?
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. And if you come up
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
- = Future Plans
41
- * Add transactions
39
+ == Future Plans
40
+ Add transactions
42
41
 
43
- = License
44
- Ruby's
42
+ == License
43
+ Artistic
45
44
 
46
- = Warranty
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
- = Copyright
52
- (C) 2003-2008, Daniel J. Berger, All Rights Reserved.
50
+ == Copyright
51
+ (C) 2003-2009, Daniel J. Berger, All Rights Reserved.
53
52
 
54
- = Authors
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 'Install the win32-pipe library'
26
- task :install_c => [:build] do
27
- Dir.chdir('ext'){
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 "Clean any build files for win32-pipe"
33
- task :clean do
34
- Dir.chdir('ext') do
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 "Build win32-pipe (but don't install it)"
45
- task :build => [:clean] do
46
- Dir.chdir('ext') do
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 "Run the sample program"
54
- task :example do |t|
55
- Dir.chdir('examples'){
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('test') do |test|
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
- # test_client.rb
2
+ # example_client.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_client' task.
@@ -1,5 +1,5 @@
1
1
  #########################################################################
2
- # test_client_async.rb
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'
@@ -1,5 +1,5 @@
1
1
  #########################################################################
2
- # test_server.rb
2
+ # example_server.rb
3
3
  #
4
4
  # A simple named pipe server. Start this up in its own terminal window.
5
5
  # You may have to use the task manager to kill it if you don't connect
@@ -1,5 +1,5 @@
1
1
  #######################################################################
2
- # test_server_async.rb
2
+ # example_server_async.rb
3
3
  #
4
4
  # A simple, asynchronous named pipe server. Start this up in its own
5
5
  # terminal window. You can run this program via the
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.0'
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 = "\\\\.\\pipe\\" + 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
- # tc_pipe.rb
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.0', Pipe::VERSION)
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 } # Must have 1 argument
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
 
@@ -1,5 +1,5 @@
1
1
  ##########################################################################
2
- # tc_pipe_client.rb
2
+ # test_win32_pipe_client.rb
3
3
  #
4
4
  # Test suite for the Pipe::Client class. This test suite should be run
5
5
  # as part of the 'rake test' task.
@@ -1,5 +1,5 @@
1
1
  ##########################################################################
2
- # tc_pipe_server.rb
2
+ # test_win32_pipe_server.rb
3
3
  #
4
4
  # Test suite for the Pipe::Server class. This test suite should be run
5
5
  # as part of the 'rake test' task.
data/win32-pipe.gemspec CHANGED
@@ -1,26 +1,28 @@
1
- require "rubygems"
1
+ require 'rubygems'
2
2
 
3
3
  spec = Gem::Specification.new do |gem|
4
- gem.name = "win32-pipe"
5
- gem.version = "0.2.0"
6
- gem.author = "Daniel J. Berger"
7
- gem.email = "djberg96@gmail.com"
8
- gem.homepage = "http://www.rubyforge.org/projects/win32utils"
9
- gem.platform = Gem::Platform::RUBY
10
- gem.summary = "An interface for named pipes on MS Windows"
11
- gem.description = "An interface for named pipes on MS Windows"
12
- gem.test_files = Dir["test/tc_*.rb"]
13
- gem.has_rdoc = true
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
- files = Dir["doc/*"] + Dir["examples/*"] + Dir["lib/win32/**/*.rb"]
18
- files += Dir["test/*"] + Dir["[A-Z]*"]
19
- files.delete_if{ |item| item.include?("CVS") }
20
- gem.files = files
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
- if $0 == __FILE__
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.0
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
- - examples/test_client.rb
33
- - examples/test_client_async.rb
34
- - examples/test_server.rb
35
- - examples/test_server_async.rb
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
- test_files:
52
- - test/tc_pipe.rb
53
- - test/tc_pipe_client.rb
54
- - test/tc_pipe_server.rb
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
- extra_rdoc_files:
58
- - CHANGES
59
- - README
60
- - MANIFEST
61
- executables: []
62
-
63
- extensions: []
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
- dependencies: []
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