public
Fork of eventmachine/eventmachine
Description: EventMachine - Sync from svn repo at rubyeventmachine.com
Homepage: http://www.rubyeventmachine.com
Clone URL: git://github.com/tmm1/eventmachine.git
Merge of branches/raggi
Most notable work and patches by Aman Gupta, Roger Pack, and James Tucker. 

Patches / Tickets also submitted by: Jeremy Evans, aanand, darix, mmmurf, 

danielaquino, macournoyer.
 - Moved docs into docs/ dir
 - Major refactor of rakefile, added generic rakefile helpers in tasks
 - Added example CPP build rakefile in tasks/cpp.rake
 - Moved rake tests out to tasks/tests.rake
 - Added svn ignores where appropriate
 - Fixed jruby build on older java platforms
 - Gem now builds from Rakefile rather than directly via extconf
 - Gem unified for jruby, C++ and pure ruby.
 - Correction for pure C++ build, removing ruby dependency
 - Fix for CYGWIN builds on ipv6
 - Major refactor for extconf.rb
 - Working mingw builds
 - extconf optionally uses pkg_config over manual configuration
 - extconf builds for 1.9 on any system that has 1.9
 - extconf no longer links pthread explicitly
 - looks for kqueue on all *nix systems
 - better error output on std::runtime_error, now says where it came from
 - Fixed some tests on jruby
 - Added test for general send_data flaw, required for a bugfix in jruby 
 build
 - Added timeout to epoll tests
 - Added fixes for java reactor ruby api
 - Small addition of some docs in httpclient.rb and httpcli2.rb
 - Some refactor and fixes in smtpserver.rb
 - Added parenthesis where possible to avoid excess ruby warnings
 - Refactor of $eventmachine_library logic for accuracy and maintenance, 
 jruby
 - EM::start_server now supports unix sockets
 - EM::connect now supports unix sockets
 - EM::defer @threadqueue now handled more gracefully
 - Added better messages on exceptions raised
 - Fix edge case in timer fires
 - Explicitly require buftok.rb
 - Add protocols to autoload, rather than require them all immediately
 - Fix a bug in pr_eventmachine for outbound_q
 - Refactors to take some of the use of defer out of tests.
 - Fixes in EM.defer under start/stop conditions. Reduced scope of 
 threads.



git-svn-id: http://rubyeventmachine.com/svn/trunk@788 
2c60eb90-88cd-488e-9351-1edcb1d70dbc
raggi (author)
Tue Sep 23 18:20:08 -0700 2008
commit  6d784298e886fc320b636e336ab02807e5f2340a
tree    e4a27dea88ba229e6432709d788ae95d16097283
parent  1843ca97e04ccb6ad011b5d10c6076afad657d62
...
1
 
2
3
4
...
12
13
14
 
 
 
 
 
 
 
 
 
 
 
 
 
 
15
 
 
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
 
 
34
 
 
 
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
 
 
 
 
 
 
 
59
60
 
 
61
62
63
64
65
66
67
68
69
70
71
72
73
 
 
 
 
 
 
 
74
75
76
77
 
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
 
 
 
 
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
 
 
 
 
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
 
 
 
 
 
 
 
 
275
276
277
278
279
280
281
 
 
 
 
 
 
 
 
 
 
 
 
 
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
...
 
1
2
3
4
...
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
 
 
 
 
 
 
 
 
 
 
33
 
 
 
 
 
 
34
35
36
37
38
39
40
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
41
42
43
44
45
46
47
48
49
50
51
52
 
 
 
 
 
 
 
 
 
 
 
 
53
54
55
56
57
58
59
60
 
61
62
63
64
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
65
66
67
68
69
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
 
 
 
 
 
 
 
 
 
 
 
 
 
124
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
125
126
127
128
129
130
 
131
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
132
133
134
135
136
137
138
139
140
141
 
 
 
 
 
142
143
144
145
146
147
148
149
150
151
152
153
154
155
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
156
 
0
@@ -1,4 +1,4 @@
0
-#! /usr/bin/env rake
0
+#!/usr/bin/env rake
0
 #--
0
 # Ruby/EventMachine
0
 # http://rubyeventmachine.com
0
@@ -12,461 +12,145 @@
0
 # $Id$
0
 #++
0
 
0
+### OLD RAKE: ###
0
+# # The tasks and external gemspecs we used to generate binary gems are now
0
+# # obsolete. Use Patrick Hurley's gembuilder to build binary gems for any
0
+# # desired platform.
0
+# # To build a binary gem on Win32, ensure that the include and lib paths
0
+# # both contain the proper references to OPENSSL. Use the static version
0
+# # of the libraries, not the dynamic, otherwise we expose the user to a
0
+# # runtime dependency.
0
+#
0
+# # To build a binary gem for win32, first build rubyeventmachine.so
0
+# # using VC6 outside of the build tree (the normal way: ruby extconf.rb,
0
+# # and then nmake). Then copy rubyeventmachine.so into the lib directory,
0
+# # and run rake gemwin32.
0
+#
0
 
0
+require 'rubygems' unless defined?(Gem)
0
+require 'rake' unless defined?(Rake)
0
 require 'rake/gempackagetask'
0
-require 'rake/clean'
0
-
0
-
0
-$can_minitar = false
0
-begin
0
- require 'archive/tar/minitar'
0
- require 'zlib'
0
- $can_minitar = true
0
-rescue LoadError
0
-end
0
 
0
-$: << "lib"
0
-require 'eventmachine_version'
0
-$version = EventMachine::VERSION
0
-$distdir = "eventmachine-#$version"
0
-$tardist = "#$distdir.tar.gz"
0
-$name = "eventmachine"
0
+Package = false # Build zips and tarballs?
0
+Dir.glob('tasks/*.rake').each { |r| Rake.application.add_import r }
0
 
0
+# e.g. rake EVENTMACHINE_LIBRARY=java for forcing java build tasks as defaults!
0
+$eventmachine_library = :java if RUBY_PLATFORM =~ /java/ || ENV['EVENTMACHINE_LIBRARY'] == 'java'
0
+$eventmachine_library = :pure_ruby if ENV['EVENTMACHINE_LIBRARY'] == 'pure_ruby'
0
 
0
-# The tasks and external gemspecs we used to generate binary gems are now
0
-# obsolete. Use Patrick Hurley's gembuilder to build binary gems for any
0
-# desired platform.
0
-# To build a binary gem on Win32, ensure that the include and lib paths
0
-# both contain the proper references to OPENSSL. Use the static version
0
-# of the libraries, not the dynamic, otherwise we expose the user to a
0
-# runtime dependency.
0
-
0
-=begin
0
-# To build a binary gem for win32, first build rubyeventmachine.so
0
-# using VC6 outside of the build tree (the normal way: ruby extconf.rb,
0
-# and then nmake). Then copy rubyeventmachine.so into the lib directory,
0
-# and run rake gemwin32.
0
-specwin32 = eval(File.read("eventmachine-win32.gemspec"))
0
-specwin32.version = $version
0
-desc "Build the RubyGem for EventMachine-win32"
0
-task :gemwin32 => ["pkg/eventmachine-win32-#{$version}.gem"]
0
-Rake::GemPackageTask.new(specwin32) do |g|
0
- if $can_minitar
0
- g.need_tar = false
0
- g.need_zip = false
0
- end
0
- g.package_dir = "pkg"
0
+# If running under rubygems...
0
+__DIR__ ||= File.expand_path(File.dirname(__FILE__))
0
+if Gem.path.any? {|path| %r(^#{Regexp.escape path}) =~ __DIR__}
0
+ task :default => :gem_build
0
+else
0
+ desc "Run tests."
0
+ task :default => [:build, :test]
0
 end
0
 
0
+desc ":default build when running under rubygems."
0
+task :gem_build => :build
0
 
0
-# To build a binary gem for unix platforms, first build rubyeventmachine.so
0
-# using gcc outside of the build tree (the normal way: ruby extconf.rb,
0
-# and then make). Then copy rubyeventmachine.so into the lib directory,
0
-# and run rake gembinary.
0
-specbinary = eval(File.read("eventmachine-binary.gemspec"))
0
-specbinary.version = $version
0
-desc "Build the RubyGem for EventMachine-Binary"
0
-task :gembinary => ["pkg/eventmachine-binary-#{$version}.gem"]
0
-Rake::GemPackageTask.new(specbinary) do |g|
0
- if $can_minitar
0
- g.need_tar = false
0
- g.need_zip = false
0
+desc "Build extension (or EVENTMACHIINE_LIBRARY) and place in lib"
0
+build_task = 'ext:build'
0
+build_task = 'java:build' if $eventmachine_library == :java
0
+build_task = :dummy_build if $eventmachine_library == :pure_ruby
0
+task :build => build_task do |t|
0
+ Dir.glob('{ext,java/src}/*.{so,bundle,dll,jar}').each do |f|
0
+ mv f, "lib"
0
   end
0
- g.package_dir = "pkg"
0
 end
0
 
0
+task :dummy_build
0
 
0
-spec = eval(File.read("eventmachine.gemspec"))
0
-=end
0
-
0
-spec = Gem::Specification.new do |s|
0
- s.name = "eventmachine"
0
- s.summary = "Ruby/EventMachine library"
0
- s.platform = Gem::Platform::RUBY
0
-
0
- s.has_rdoc = true
0
- s.rdoc_options = %w(--title EventMachine --main README --line-numbers)
0
- s.extra_rdoc_files = ["README",
0
- "RELEASE_NOTES",
0
- "COPYING",
0
- "EPOLL",
0
- "GNU",
0
- "LEGAL",
0
- "TODO",
0
- "KEYBOARD",
0
- "LIGHTWEIGHT_CONCURRENCY",
0
- "PURE_RUBY",
0
- "SMTP",
0
- "SPAWNED_PROCESSES",
0
- "DEFERRABLES"
0
- ]
0
-
0
- s.files = FileList["{bin,tests,lib,ext}/**/*"].exclude("rdoc").to_a
0
-
0
- s.require_paths = ["lib"]
0
-
0
- s.test_file = "tests/testem.rb"
0
- s.extensions = "ext/extconf.rb"
0
-
0
- s.author = "Francis Cianfrocca"
0
- s.email = "garbagecat10@gmail.com"
0
- s.rubyforge_project = %q(eventmachine)
0
- s.homepage = "http://rubyeventmachine.com"
0
-
0
-
0
- description = []
0
- File.open("README") do |file|
0
- file.each do |line|
0
- line.chomp!
0
- break if line.empty?
0
- description << "#{line.gsub(/\[\d\]/, '')}"
0
- end
0
- end
0
- s.description = description[1..-1].join(" ")
0
-end
0
-
0
-spec.version = $version
0
-desc "Build the EventMachine RubyGem"
0
-task :gem => ["pkg/eventmachine-#{$version}.gem"]
0
-Rake::GemPackageTask.new(spec) do |g|
0
- if $can_minitar
0
- g.need_tar = false
0
- g.need_zip = false
0
+# Basic clean definition, this is enhanced by imports aswell.
0
+task :clean do
0
+ chdir 'ext' do
0
+ sh 'make clean' if test ?e, 'Makefile'
0
   end
0
- g.package_dir = "pkg"
0
-end
0
-
0
-
0
-jspec = Gem::Specification.new do |s|
0
- s.name = "eventmachine-java"
0
- s.summary = "Ruby/EventMachine library"
0
- s.platform = Gem::Platform::RUBY
0
-
0
- s.has_rdoc = true
0
- s.rdoc_options = %w(--title EventMachine --main README --line-numbers)
0
- s.extra_rdoc_files = ["README", "RELEASE_NOTES", "COPYING", "GNU", "LEGAL", "TODO"]
0
-
0
- s.files = FileList["{lib}/**/*"].exclude("rdoc").to_a
0
-
0
- s.require_paths = ["lib"]
0
-
0
- s.author = "Francis Cianfrocca"
0
- s.email = "garbagecat10@gmail.com"
0
- s.rubyforge_project = %q(eventmachine)
0
- s.homepage = "http://rubyeventmachine.com"
0
-
0
-
0
- description = []
0
- File.open("README") do |file|
0
- file.each do |line|
0
- line.chomp!
0
- break if line.empty?
0
- description << "#{line.gsub(/\[\d\]/, '')}"
0
- end
0
- end
0
- s.description = description[1..-1].join(" ")
0
-end
0
-
0
-
0
-jspec.version = $version
0
-desc "Build the EventMachine RubyGem for JRuby"
0
-task :jgem => ["pkg/eventmachine-java-#{$version}.gem"]
0
-Rake::GemPackageTask.new(jspec) do |g|
0
- $>.puts "-----------------"
0
- $>.puts "Before executing the :jgem task, be sure to run :clean, and"
0
- $>.puts "then make sure an up-to-date em_reactor.jar is present in the"
0
- $>.puts "lib directory."
0
- $>.puts "-----------------"
0
- if $can_minitar
0
- g.need_tar = false
0
- g.need_zip = false
0
+ Dir.glob('**/Makefile').each { |file| rm file }
0
+ Dir.glob('**/*.{o,so,bundle,class,jar,dll,log}').each { |file| rm file }
0
+end
0
+
0
+Spec = Gem::Specification.new do |s|
0
+ s.name = "eventmachine"
0
+ s.summary = "Ruby/EventMachine library"
0
+ s.platform = Gem::Platform::RUBY
0
+
0
+ s.has_rdoc = true
0
+ s.rdoc_options = %w(--title EventMachine --main docs/README --line-numbers)
0
+ s.extra_rdoc_files = Dir['docs/*']
0
+
0
+ s.files = %w(Rakefile) + Dir["{bin,tests,lib,ext,java,tasks}/**/*"]
0
+
0
+ s.require_path = 'lib'
0
+
0
+ s.test_file = "tests/testem.rb"
0
+ s.extensions = "Rakefile"
0
+
0
+ s.author = "Francis Cianfrocca"
0
+ s.email = "garbagecat10@gmail.com"
0
+ s.rubyforge_project = 'eventmachine'
0
+ s.homepage = "http://rubyeventmachine.com"
0
+
0
+ # Pulled in from readme, as code to pull from readme was not working!
0
+ # Might be worth removing as no one seems to use gem info anyway.
0
+ s.description = <<-EOD
0
+EventMachine implements a fast, single-threaded engine for arbitrary network
0
+communications. It's extremely easy to use in Ruby. EventMachine wraps all
0
+interactions with IP sockets, allowing programs to concentrate on the
0
+implementation of network protocols. It can be used to create both network
0
+servers and clients. To create a server or client, a Ruby program only needs
0
+to specify the IP address and port, and provide a Module that implements the
0
+communications protocol. Implementations of several standard network protocols
0
+are provided with the package, primarily to serve as examples. The real goal
0
+of EventMachine is to enable programs to easily interface with other programs
0
+using TCP/IP, especially if custom protocols are required.
0
+ EOD
0
+
0
+ require 'lib/eventmachine_version'
0
+ s.version = EventMachine::VERSION
0
+end
0
+
0
+namespace :ext do
0
+ desc "Build C++ extension"
0
+ task :build => [:clean, :make]
0
+
0
+ desc "make extension"
0
+ task :make => [:makefile] do
0
+ chdir 'ext' do
0
+ sh 'make'
0
+ end
0
   end
0
- g.package_dir = "pkg"
0
-end
0
-
0
-
0
-desc "Clean extension and JAR builds out of the lib directory"
0
-task :clean do |t|
0
- files = %W(lib/*.so lib/*.jar)
0
- files = FileList[files.map { |file| File.join(".", file) }].to_a
0
- files.each {|f|
0
- $>.puts "unlinking file: #{f}"
0
- File.unlink f
0
- }
0
-end
0
 
0
-
0
-if $can_minitar
0
- desc "Build #$name .tar.gz distribution."
0
- task :tar => [ $tardist ]
0
- file $tardist => [ ] do |t|
0
- current = File.basename(Dir.pwd)
0
- Dir.chdir("..") do
0
- begin
0
- files = %W(ext/**/*.rb ext/**/*.cpp ext/**/*.h bin/**/* lib/**/* tests/**/* README COPYING
0
- GNU LEGAL RELEASE_NOTES INSTALL EPOLL TODO KEYBOARD
0
- LIGHTWEIGHT_CONCURRENCY PURE_RUBY SMTP SPAWNED_PROCESSES DEFERRABLES setup.rb )
0
- files = FileList[files.map { |file| File.join(current, file) }].to_a
0
- files = files.select {|f| f !~ /lib\/.*[\.](so|jar)\Z/i } # remove any so or jar files in the lib directory
0
- files.map! do |dd|
0
- ddnew = dd.gsub(/^#{current}/, $distdir)
0
- mtime = $release_date || File.stat(dd).mtime
0
- if File.directory?(dd)
0
- { :name => ddnew, :mode => 0755, :dir => true, :mtime => mtime }
0
- else
0
- if dd =~ %r{bin/}
0
- mode = 0755
0
- else
0
- mode = 0644
0
- end
0
- data = File.open(dd, "rb") { |ff| ff.read }
0
- { :name => ddnew, :mode => mode, :data => data, :size =>
0
- data.size, :mtime => mtime }
0
- end
0
- end
0
-
0
- ff = File.open(t.name.gsub(%r{^\.\./}o, ''), "wb")
0
- gz = Zlib::GzipWriter.new(ff)
0
- tw = Archive::Tar::Minitar::Writer.new(gz)
0
-
0
- files.each do |entry|
0
- if entry[:dir]
0
- tw.mkdir(entry[:name], entry)
0
- else
0
- tw.add_file_simple(entry[:name], entry) { |os| os.write(entry[:data]) }
0
- end
0
- end
0
- ensure
0
- tw.close if tw
0
- gz.finish if gz
0
- ff.close if ff
0
- end
0
+ desc 'Compile the makefile'
0
+ task :makefile do |t|
0
+ chdir 'ext' do
0
+ ruby 'extconf.rb'
0
     end
0
   end
0
- task $tardist => [ ]
0
 end
0
-
0
-
0
-
0
-
0
-
0
-# This is used by several rake tasks, that parameterize the
0
-# behavior so we can use the same tests to test both the
0
-# extension and non-extension versions.
0
-def run_tests t, libr, test_filename_filter="test_*.rb"
0
- require 'test/unit/testsuite'
0
- require 'test/unit/ui/console/testrunner'
0
-
0
- runner = Test::Unit::UI::Console::TestRunner
0
-
0
- $eventmachine_library = ((RUBY_PLATFORM =~ /java/) ? :java : libr)
0
- $LOAD_PATH.unshift('tests')
0
- $stderr.puts "Checking for test cases:" #if t.verbose
0
-
0
- if test_filename_filter.is_a?(Array)
0
- test_filename_filter.each {|testcase|
0
- $stderr.puts "\t#{testcase}"
0
- load "tests/#{testcase}"
0
- }
0
- else
0
- Dir["tests/#{test_filename_filter}"].each do |testcase|
0
- $stderr.puts "\t#{testcase}" #if t.verbose
0
- load testcase
0
+
0
+namespace :java do
0
+ # This task creates the JRuby JAR file and leaves it in the lib directory.
0
+ # This step is required before executing the jgem task.
0
+ desc "Build java extension"
0
+ task :build => [:jar] do |t|
0
+ chdir('java/src') do
0
+ mv 'em_reactor.jar', '../../lib/em_reactor.jar'
0
     end
0
   end
0
-
0
- suite = Test::Unit::TestSuite.new($name)
0
-
0
- ObjectSpace.each_object(Class) do |testcase|
0
- suite << testcase.suite if testcase < Test::Unit::TestCase
0
+
0
+ desc "compile .java to .class"
0
+ task :compile do
0
+ chdir('java/src') do
0
+ sh 'javac com/rubyeventmachine/*.java'
0
+ end
0
+ end
0
+
0
+ desc "compile .classes to .jar"
0
+ task :jar => [:compile] do
0
+ chdir('java/src') do
0
+ sh "jar -cf em_reactor.jar com/rubyeventmachine/*.class"
0
+ end
0
   end
0
-
0
- runner.run(suite)
0
-end
0
-
0
-desc "Run tests for #$name."
0
-task :test do |t|
0
- run_tests t, nil
0
-end
0
-
0
-desc "Run tests for #$name."
0
-task :test_partial do |t|
0
- run_tests t, :extension, [
0
- "test_basic.rb",
0
- "test_epoll.rb",
0
- "test_errors.rb",
0
- "test_eventables.rb",
0
- "test_exc.rb",
0
- "test_futures.rb",
0
- "test_hc.rb",
0
- "test_httpclient2.rb",
0
- "test_httpclient.rb",
0
- "test_kb.rb",
0
- #"test_ltp2.rb",
0
- "test_ltp.rb",
0
- "test_next_tick.rb",
0
- "test_processes.rb",
0
- "test_pure.rb",
0
- "test_running.rb",
0
- "test_sasl.rb",
0
- #"test_send_file.rb",
0
- "test_servers.rb",
0
- "test_smtpclient.rb",
0
- "test_smtpserver.rb",
0
- "test_spawn.rb",
0
- "test_timers.rb",
0
- "test_ud.rb",
0
- ]
0
-end
0
-
0
-
0
-desc "Run pure-ruby tests for #$name."
0
-task :testpr do |t|
0
- run_tests t, :pure_ruby
0
-end
0
-
0
-desc "Run extension tests for #$name."
0
-task :testext do |t|
0
- run_tests t, :extension
0
-end
0
-
0
-desc "PROVISIONAL: run tests for user-defined events"
0
-task :test_ud do |t|
0
- run_tests t, :extension, "test_ud.rb"
0
-end
0
-
0
-desc "PROVISIONAL: run tests for line/text protocol handler"
0
-task :test_ltp do |t|
0
- run_tests t, :extension, "test_ltp*.rb"
0
-end
0
-
0
-desc "PROVISIONAL: run tests for header/content protocol handler"
0
-task :test_hc do |t|
0
- run_tests t, :extension, "test_hc.rb"
0
-end
0
-
0
-desc "PROVISIONAL: run tests for exceptions"
0
-task :test_exc do |t|
0
- run_tests t, :extension, "test_exc.rb"
0
-end
0
-
0
-desc "Test protocol handlers"
0
-task :test_protocols => [ :test_hc, :test_ltp ]
0
-
0
-
0
-desc "Test HTTP client"
0
-task :test_httpclient do |t|
0
- run_tests t, :extension, "test_httpclient.rb"
0
-end
0
-
0
-desc "Test HTTP client2"
0
-task :test_httpclient2 do |t|
0
- run_tests t, :extension, "test_httpclient2.rb"
0
-end
0
-
0
-desc "Test futures"
0
-task :test_futures do |t|
0
- run_tests t, :extension, "test_future*.rb"
0
-end
0
-
0
-desc "Test Timers"
0
-task :test_timers do |t|
0
- run_tests t, :extension, "test_timer*.rb"
0
-end
0
-
0
-desc "Test Next Tick"
0
-task :test_next_tick do |t|
0
- run_tests t, :extension, "test_next_tick*.rb"
0
-end
0
-
0
-desc "Test Epoll"
0
-task :test_epoll do |t|
0
- run_tests t, :extension, "test_epoll*.rb"
0
-end
0
-
0
-desc "Test Servers"
0
-task :test_servers do |t|
0
- run_tests t, :extension, "test_servers*.rb"
0
-end
0
-
0
-desc "Test Basic"
0
-task :test_basic do |t|
0
- run_tests t, :extension, "test_basic*.rb"
0
-end
0
-
0
-desc "Test Send File"
0
-task :test_send_file do |t|
0
- run_tests t, :extension, "test_send_file*.rb"
0
-end
0
-
0
-desc "Test Running"
0
-task :test_running do |t|
0
- run_tests t, :extension, "test_running*.rb"
0
-end
0
-
0
-desc "Test Keyboard Events"
0
-task :test_keyboard do |t|
0
- run_tests t, :extension, "test_kb*.rb"
0
-end
0
-
0
-desc "Test Spawn"
0
-task :test_spawn do |t|
0
- run_tests t, :spawn, "test_spawn*.rb"
0
-end
0
-
0
-desc "Test SMTP"
0
-task :test_smtp do |t|
0
- run_tests t, :extension, "test_smtp*.rb"
0
-end
0
-
0
-desc "Test Errors"
0
-task :test_errors do |t|
0
- run_tests t, :extension, "test_errors*.rb"
0
-end
0
-
0
-desc "Test Pure Ruby"
0
-task :test_pure do |t|
0
- run_tests t, :extension, "test_pure*.rb"
0
-end
0
-
0
-desc "Test Processes"
0
-task :test_processes do |t|
0
- run_tests t, :extension, "test_process*.rb"
0
-end
0
-
0
-desc "Test SASL"
0
-task :test_sasl do |t|
0
- run_tests t, :extension, "test_sasl*.rb"
0
-end
0
-
0
-desc "Test Attach"
0
-task :test_attach do |t|
0
- run_tests t, :extension, "test_attach*.rb"
0
-end
0
-
0
-
0
-desc "Build everything"
0
-task :default => [ :gem ]
0
-
0
-
0
-
0
-# This task is useful for development.
0
-desc "Compile the extension."
0
-task :extension do |t|
0
- Dir.mkdir "nonversioned" unless File.directory?("nonversioned")
0
- Dir.chdir "nonversioned"
0
- system "ruby ../ext/extconf.rb"
0
- system "make clean"
0
- system "make"
0
- system "cp *.so ../lib" or system "copy *.so ../lib"
0
- Dir.chdir ".."
0
-end
0
-
0
-
0
-# This task creates the JRuby JAR file and leaves it in the lib directory.
0
-# This step is required before executing the jgem task.
0
-desc "Compile the JAR"
0
-task :jar do |t|
0
- p "JAR?"
0
 end
0
-