win32-open3 0.2.9 → 0.3.0

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.3.0 - 22-Jun-2009
2
+ * Fixed an issue where the block form of the Open3.popen3 method did not
3
+ return the exit value.
4
+ * Fixed the version number.
5
+ * Added a test to validate the exit value in block form.
6
+ * Updated the gemspec description.
7
+
1
8
  == 0.2.9 - 8-Mar-2009
2
9
  * Fixed a bug within an internal function that could cause an exception.
3
10
  Thanks go to Ross Bunker for the spot and patch.
data/MANIFEST CHANGED
@@ -8,4 +8,4 @@
8
8
  * ext/extconf.rb
9
9
  * ext/win32/open3.c
10
10
  * ext/win32/open3.h
11
- * test/tc_open3.rb
11
+ * test/test_win32_open3.rb
data/Rakefile CHANGED
@@ -53,22 +53,39 @@ task :build_binary_gem => [:build] do
53
53
 
54
54
  spec = Gem::Specification.new do |gem|
55
55
  gem.name = "win32-open3"
56
- gem.version = "0.2.9"
56
+ gem.version = "0.3.0"
57
57
  gem.authors = ["Park Heesob", "Daniel Berger"]
58
58
  gem.email = "djberg96@gmail.com"
59
59
  gem.homepage = "http://www.rubyforge.org/projects/win32utils"
60
60
  gem.rubyforge_project = "win32utils"
61
61
  gem.platform = Gem::Platform::CURRENT
62
62
  gem.summary = 'Provides an Open3.popen3 implementation for MS Windows'
63
- gem.description = 'Provides an Open3.popen3 implementation for MS Windows'
64
63
  gem.has_rdoc = true
65
64
  gem.test_files = Dir['test/test*']
65
+
66
66
  files = Dir["lib/win32/open3.so"] + Dir["test/*"]
67
67
  files.delete_if{ |f| f.include?('CVS') }
68
68
  gem.files = files
69
- gem.extra_rdoc_files = ['README', 'CHANGES', 'MANIFEST', 'ext/win32/open3.c']
69
+
70
+ gem.extra_rdoc_files = [
71
+ 'README',
72
+ 'CHANGES',
73
+ 'MANIFEST',
74
+ 'doc/open3.txt',
75
+ 'ext/win32/open3.c'
76
+ ]
77
+
70
78
  gem.rubyforge_project = 'win32utils'
71
79
  gem.required_ruby_version = '>= 1.8.2'
80
+
81
+ gem.description = <<-EOF
82
+ The win32-open3 library provides a working implemetation of the open3
83
+ library for MS Windows. In addition, it provides the Open4 class, which
84
+ also returns pid information.
85
+
86
+ Note that this library is largely unnecessary with Ruby 1.9.x because of
87
+ its support for native threads.
88
+ EOF
72
89
  end
73
90
 
74
91
  Gem::Builder.new(spec).build
@@ -136,8 +136,7 @@ static VALUE win32_popen3(int argc, VALUE *argv, VALUE klass)
136
136
 
137
137
  // Ensure handles are closed in block form
138
138
  if(rb_block_given_p()){
139
- rb_ensure(rb_yield_splat, v_port, io_close, v_port);
140
- return win32_last_status;
139
+ return rb_ensure(rb_yield_splat, v_port, io_close, v_port);
141
140
  }
142
141
 
143
142
  return v_port;
@@ -1,4 +1,4 @@
1
- #define WIN32_OPEN3_VERSION "0.2.8"
1
+ #define WIN32_OPEN3_VERSION "0.3.0"
2
2
  #define MAX_STRING 512
3
3
 
4
4
  static VALUE io_alloc _((VALUE));
@@ -17,11 +17,12 @@ class TC_Win32_Open3 < Test::Unit::TestCase
17
17
  @stdin = nil
18
18
  @stdout = nil
19
19
  @stderr = nil
20
+ @value = nil
20
21
  end
21
22
 
22
23
  def test_open3_version
23
- assert_equal('0.2.8', Open3::WIN32_OPEN3_VERSION)
24
- assert_equal('0.2.8', Open4::WIN32_OPEN3_VERSION)
24
+ assert_equal('0.3.0', Open3::WIN32_OPEN3_VERSION)
25
+ assert_equal('0.3.0', Open4::WIN32_OPEN3_VERSION)
25
26
  end
26
27
 
27
28
  def test_open3_basic
@@ -94,8 +95,19 @@ class TC_Win32_Open3 < Test::Unit::TestCase
94
95
  assert_nil(fout.gets)
95
96
  end
96
97
 
98
+ def test_exit_status_in_block_form_popen4
99
+ assert_nothing_raised{ @value = Open3.popen3('dir'){ |x,y,z| 1 } }
100
+ assert_equal(1, @value)
101
+ end
102
+
103
+ def test_exit_status_in_block_form_popen4
104
+ assert_nothing_raised{ @value = Open4.popen4('dir'){ |x,y,z,a| 1 } }
105
+ assert_equal(1, @value)
106
+ end
107
+
97
108
  def teardown
98
109
  @good_cmd = nil
99
110
  @bad_cmd = nil
111
+ @value = nil
100
112
  end
101
113
  end
@@ -1,19 +1,35 @@
1
1
  require 'rubygems'
2
2
 
3
3
  spec = Gem::Specification.new do |gem|
4
- gem.name = 'win32-open3'
5
- gem.version = '0.2.9'
6
- gem.authors = ['Park Heesob', '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 = 'Provides an Open3.popen3 implementation for MS Windows'
11
- gem.description = 'Provides an Open3.popen3 implementation for MS Windows'
12
- gem.test_file = 'test/test_win32_open3.rb'
13
- gem.has_rdoc = true
14
- gem.extra_rdoc_files = ['CHANGES', 'README', 'MANIFEST', 'doc/open3.txt', 'ext/win32/open3.c']
15
- gem.rubyforge_project = 'win32utils'
16
- gem.required_ruby_version = '>= 1.8.2'
4
+ gem.name = 'win32-open3'
5
+ gem.version = '0.3.0'
6
+ gem.authors = ['Park Heesob', '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 = 'Provides an Open3.popen3 implementation for MS Windows'
11
+ gem.test_file = 'test/test_win32_open3.rb'
12
+ gem.has_rdoc = true
13
+
14
+ gem.extra_rdoc_files = [
15
+ 'CHANGES',
16
+ 'README',
17
+ 'MANIFEST',
18
+ 'doc/open3.txt',
19
+ 'ext/win32/open3.c'
20
+ ]
21
+
22
+ gem.rubyforge_project = 'win32utils'
23
+ gem.required_ruby_version = '>= 1.8.2'
24
+
25
+ gem.description = <<-EOF
26
+ The win32-open3 library provides a working implemetation of the open3
27
+ library for MS Windows. In addition, it provides the Open4 class, which
28
+ also returns pid information.
29
+
30
+ Note that this library is largely unnecessary with Ruby 1.9.x because of
31
+ its support for native threads.
32
+ EOF
17
33
 
18
34
  files = Dir["**/*"]
19
35
  files.delete_if{ |item| item.include?('CVS') }
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: win32-open3
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.9
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Park Heesob
@@ -10,11 +10,11 @@ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
12
 
13
- date: 2009-03-07 23:00:00 -07:00
13
+ date: 2009-06-22 00:00:00 -06:00
14
14
  default_executable:
15
15
  dependencies: []
16
16
 
17
- description: Provides an Open3.popen3 implementation for MS Windows
17
+ description: " The win32-open3 library provides a working implemetation of the open3\n library for MS Windows. In addition, it provides the Open4 class, which\n also returns pid information.\n \n Note that this library is largely unnecessary with Ruby 1.9.x because of\n its support for native threads.\n"
18
18
  email: djberg96@gmail.com
19
19
  executables: []
20
20
 
@@ -28,34 +28,20 @@ extra_rdoc_files:
28
28
  - ext/win32/open3.c
29
29
  files:
30
30
  - CHANGES
31
- - doc
32
31
  - doc/open3.txt
33
- - examples
34
32
  - examples/win32_open3_example.rb
35
- - ext
36
33
  - ext/extconf.rb
37
- - ext/Makefile
38
- - ext/mkmf.log
39
- - ext/open3-i386-mswin32.def
40
- - ext/open3-i386-mswin32.exp
41
- - ext/open3-i386-mswin32.lib
42
- - ext/open3-i386-mswin32.pdb
43
- - ext/open3.obj
44
- - ext/vc60.pdb
45
- - ext/win32
46
34
  - ext/win32/open3.c
47
35
  - ext/win32/open3.h
48
- - lib
49
- - lib/win32
50
- - lib/win32/open3.so
51
36
  - MANIFEST
52
37
  - Rakefile
53
38
  - README
54
- - test
55
39
  - test/test_win32_open3.rb
56
40
  - win32-open3.gemspec
57
41
  has_rdoc: true
58
42
  homepage: http://www.rubyforge.org/projects/win32utils
43
+ licenses: []
44
+
59
45
  post_install_message:
60
46
  rdoc_options: []
61
47
 
@@ -76,9 +62,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
76
62
  requirements: []
77
63
 
78
64
  rubyforge_project: win32utils
79
- rubygems_version: 1.3.1
65
+ rubygems_version: 1.3.4
80
66
  signing_key:
81
- specification_version: 2
67
+ specification_version: 3
82
68
  summary: Provides an Open3.popen3 implementation for MS Windows
83
69
  test_files:
84
70
  - test/test_win32_open3.rb
@@ -1,181 +0,0 @@
1
-
2
- SHELL = /bin/sh
3
-
4
- #### Start of system configuration section. ####
5
-
6
- srcdir = win32
7
- topdir = C:/Ruby/lib/ruby/1.8/i386-mswin32
8
- hdrdir = $(topdir)
9
- VPATH = $(srcdir);$(topdir);$(hdrdir)
10
-
11
- DESTDIR = C:
12
- prefix = $(DESTDIR)/Ruby
13
- exec_prefix = $(prefix)
14
- sitedir = $(prefix)/lib/ruby/site_ruby
15
- rubylibdir = $(libdir)/ruby/$(ruby_version)
16
- archdir = $(rubylibdir)/$(arch)
17
- sbindir = $(exec_prefix)/sbin
18
- datadir = $(prefix)/share
19
- includedir = $(prefix)/include
20
- infodir = $(prefix)/info
21
- sysconfdir = $(prefix)/etc
22
- mandir = $(prefix)/man
23
- libdir = $(exec_prefix)/lib
24
- sharedstatedir = $(DESTDIR)/etc
25
- oldincludedir = $(DESTDIR)/usr/include
26
- sitearchdir = $(sitelibdir)/$(sitearch)
27
- localstatedir = $(DESTDIR)/var
28
- bindir = $(exec_prefix)/bin
29
- sitelibdir = $(sitedir)/$(ruby_version)
30
- libexecdir = $(exec_prefix)/libexec
31
-
32
- CC = cl -nologo
33
- LIBRUBY = $(RUBY_SO_NAME).lib
34
- LIBRUBY_A = $(RUBY_SO_NAME)-static.lib
35
- LIBRUBYARG_SHARED = $(LIBRUBY)
36
- LIBRUBYARG_STATIC = $(LIBRUBY_A)
37
-
38
- RUBY_EXTCONF_H =
39
- CFLAGS = -MD -Zi -O2b2xg- -G6
40
- INCFLAGS = -I. -I$(topdir) -I$(hdrdir) -I$(srcdir)
41
- DEFS =
42
- CPPFLAGS = -DHAVE_TYPE_RB_PID_T
43
- CXXFLAGS = $(CFLAGS)
44
- DLDFLAGS = -link -incremental:no -debug -opt:ref -opt:icf -dll $(LIBPATH) -def:$(DEFFILE) -implib:$(*F:.so=)-$(arch).lib -pdb:$(*F:.so=)-$(arch).pdb
45
- LDSHARED = cl -nologo -LD
46
- AR = lib -nologo
47
- EXEEXT = .exe
48
-
49
- RUBY_INSTALL_NAME = ruby
50
- RUBY_SO_NAME = msvcrt-ruby18
51
- arch = i386-mswin32
52
- sitearch = i386-msvcrt
53
- ruby_version = 1.8
54
- ruby = C:/Ruby/bin/ruby
55
- RUBY = $(ruby:/=\)
56
- RM = $(RUBY) -run -e rm -- -f
57
- MAKEDIRS = @$(RUBY) -run -e mkdir -- -p
58
- INSTALL = @$(RUBY) -run -e install -- -vp
59
- INSTALL_PROG = $(INSTALL) -m 0755
60
- INSTALL_DATA = $(INSTALL) -m 0644
61
- COPY = copy > nul
62
-
63
- #### End of system configuration section. ####
64
-
65
- preload =
66
-
67
- libpath = . $(libdir)
68
- LIBPATH = -libpath:"." -libpath:"$(libdir)"
69
- DEFFILE = $(TARGET)-$(arch).def
70
-
71
- CLEANFILES = mkmf.log
72
- DISTCLEANFILES = vc*.pdb $(DEFFILE)
73
-
74
- extout =
75
- extout_prefix =
76
- target_prefix = /win32
77
- LOCAL_LIBS =
78
- LIBS = $(LIBRUBYARG_SHARED) oldnames.lib user32.lib advapi32.lib shell32.lib ws2_32.lib
79
- SRCS = open3.c
80
- OBJS = open3.obj
81
- TARGET = open3
82
- DLLIB = $(TARGET).so
83
- EXTSTATIC =
84
- STATIC_LIB =
85
-
86
- RUBYCOMMONDIR = $(sitedir)$(target_prefix)
87
- RUBYLIBDIR = $(sitelibdir)$(target_prefix)
88
- RUBYARCHDIR = $(sitearchdir)$(target_prefix)
89
-
90
- TARGET_SO = $(DLLIB)
91
- CLEANLIBS = $(TARGET).so $(TARGET).il? $(TARGET).tds $(TARGET).map
92
- CLEANOBJS = *.obj *.lib *.s[ol] *.pdb *.exp *.bak
93
-
94
- all: $(DLLIB)
95
- static: $(STATIC_LIB)
96
-
97
- clean:
98
- @-$(RM) $(CLEANLIBS:/=\) $(CLEANOBJS:/=\) $(CLEANFILES:/=\)
99
-
100
- distclean: clean
101
- @-$(RM) Makefile $(RUBY_EXTCONF_H) conftest.* mkmf.log
102
- @-$(RM) core ruby$(EXEEXT) *~ $(DISTCLEANFILES:/=\)
103
-
104
- realclean: distclean
105
- install: install-so install-rb
106
-
107
- install-so: $(RUBYARCHDIR)
108
- install-so: $(RUBYARCHDIR)/$(DLLIB)
109
- $(RUBYARCHDIR)/$(DLLIB): $(DLLIB)
110
- $(INSTALL_PROG) $(DLLIB:/=\) $(RUBYARCHDIR:/=\)
111
- install-rb: pre-install-rb install-rb-default
112
- install-rb-default: pre-install-rb-default
113
- pre-install-rb: Makefile
114
- pre-install-rb-default: Makefile
115
- $(RUBYARCHDIR):
116
- $(MAKEDIRS) $@
117
-
118
- site-install: site-install-so site-install-rb
119
- site-install-so: install-so
120
- site-install-rb: install-rb
121
-
122
- .SUFFIXES: .c .m .cc .cxx .cpp .obj
123
-
124
- {$(srcdir)}.cc{}.obj:
125
- $(CXX) $(INCFLAGS) $(CXXFLAGS) $(CPPFLAGS) -c -Tp$(<:\=/)
126
-
127
- {$(topdir)}.cc{}.obj:
128
- $(CXX) $(INCFLAGS) $(CXXFLAGS) $(CPPFLAGS) -c -Tp$(<:\=/)
129
-
130
- {$(hdrdir)}.cc{}.obj:
131
- $(CXX) $(INCFLAGS) $(CXXFLAGS) $(CPPFLAGS) -c -Tp$(<:\=/)
132
-
133
- .cc.obj:
134
- $(CXX) $(INCFLAGS) $(CXXFLAGS) $(CPPFLAGS) -c -Tp$(<:\=/)
135
-
136
- {$(srcdir)}.cxx{}.obj:
137
- $(CXX) $(INCFLAGS) $(CXXFLAGS) $(CPPFLAGS) -c -Tp$(<:\=/)
138
-
139
- {$(topdir)}.cxx{}.obj:
140
- $(CXX) $(INCFLAGS) $(CXXFLAGS) $(CPPFLAGS) -c -Tp$(<:\=/)
141
-
142
- {$(hdrdir)}.cxx{}.obj:
143
- $(CXX) $(INCFLAGS) $(CXXFLAGS) $(CPPFLAGS) -c -Tp$(<:\=/)
144
-
145
- .cxx.obj:
146
- $(CXX) $(INCFLAGS) $(CXXFLAGS) $(CPPFLAGS) -c -Tp$(<:\=/)
147
-
148
- {$(srcdir)}.cpp{}.obj:
149
- $(CXX) $(INCFLAGS) $(CXXFLAGS) $(CPPFLAGS) -c -Tp$(<:\=/)
150
-
151
- {$(topdir)}.cpp{}.obj:
152
- $(CXX) $(INCFLAGS) $(CXXFLAGS) $(CPPFLAGS) -c -Tp$(<:\=/)
153
-
154
- {$(hdrdir)}.cpp{}.obj:
155
- $(CXX) $(INCFLAGS) $(CXXFLAGS) $(CPPFLAGS) -c -Tp$(<:\=/)
156
-
157
- .cpp.obj:
158
- $(CXX) $(INCFLAGS) $(CXXFLAGS) $(CPPFLAGS) -c -Tp$(<:\=/)
159
-
160
- {$(srcdir)}.c{}.obj:
161
- $(CC) $(INCFLAGS) $(CFLAGS) $(CPPFLAGS) -c -Tc$(<:\=/)
162
-
163
- {$(topdir)}.c{}.obj:
164
- $(CC) $(INCFLAGS) $(CFLAGS) $(CPPFLAGS) -c -Tc$(<:\=/)
165
-
166
- {$(hdrdir)}.c{}.obj:
167
- $(CC) $(INCFLAGS) $(CFLAGS) $(CPPFLAGS) -c -Tc$(<:\=/)
168
-
169
- .c.obj:
170
- $(CC) $(INCFLAGS) $(CFLAGS) $(CPPFLAGS) -c -Tc$(<:\=/)
171
-
172
- $(DLLIB): $(DEFFILE) $(OBJS)
173
- @-$(RM) $@
174
- $(LDSHARED) -Fe$(@) $(OBJS) $(LIBS) $(LOCAL_LIBS) $(DLDFLAGS)
175
-
176
-
177
-
178
- $(DEFFILE):
179
- $(RUBY) -e "puts 'EXPORTS', 'Init_$(TARGET)'" > $@
180
-
181
- $(OBJS): {.;$(srcdir);$(topdir);$(hdrdir)}ruby.h {.;$(srcdir);$(topdir);$(hdrdir)}defines.h
@@ -1,19 +0,0 @@
1
- have_type: checking for rb_pid_t in ruby.h... -------------------- yes
2
-
3
- "cl -nologo -I. -IC:/Ruby/lib/ruby/1.8/i386-mswin32 -I. -MD -Zi -O2b2xg- -G6 -c conftest.c"
4
- conftest.c
5
- checked program was:
6
- /* begin */
7
- 1: #define WIN32_LEAN_AND_MEAN
8
- 2: #define WIN32
9
- 3: #include <winsock2.h>
10
- 4: #include <windows.h>
11
- 5: #include <ruby.h>
12
- 6:
13
- 7: /*top*/
14
- 8: typedef rb_pid_t conftest_type;
15
- 9: static conftest_type conftestval[sizeof(conftest_type)?1:-1];
16
- /* end */
17
-
18
- --------------------
19
-
@@ -1,2 +0,0 @@
1
- EXPORTS
2
- Init_open3
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file