eventmachine 0.12.2 → 0.12.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (125) hide show
  1. data/Rakefile +191 -0
  2. data/{COPYING → docs/COPYING} +0 -0
  3. data/docs/ChangeLog +183 -0
  4. data/{DEFERRABLES → docs/DEFERRABLES} +1 -1
  5. data/{EPOLL → docs/EPOLL} +0 -0
  6. data/{GNU → docs/GNU} +0 -0
  7. data/docs/INSTALL +15 -0
  8. data/{KEYBOARD → docs/KEYBOARD} +0 -0
  9. data/{LEGAL → docs/LEGAL} +0 -0
  10. data/{LIGHTWEIGHT_CONCURRENCY → docs/LIGHTWEIGHT_CONCURRENCY} +1 -1
  11. data/{PURE_RUBY → docs/PURE_RUBY} +1 -1
  12. data/{README → docs/README} +1 -1
  13. data/{RELEASE_NOTES → docs/RELEASE_NOTES} +1 -1
  14. data/{SMTP → docs/SMTP} +1 -1
  15. data/{SPAWNED_PROCESSES → docs/SPAWNED_PROCESSES} +1 -1
  16. data/{TODO → docs/TODO} +1 -1
  17. data/ext/binder.cpp +1 -1
  18. data/ext/binder.h +1 -1
  19. data/ext/cmain.cpp +65 -74
  20. data/ext/cplusplus.cpp +1 -1
  21. data/ext/ed.cpp +41 -25
  22. data/ext/ed.h +10 -3
  23. data/ext/em.cpp +39 -12
  24. data/ext/em.h +13 -1
  25. data/ext/emwin.cpp +1 -1
  26. data/ext/emwin.h +1 -1
  27. data/ext/epoll.cpp +1 -1
  28. data/ext/epoll.h +1 -1
  29. data/ext/eventmachine.h +1 -1
  30. data/ext/eventmachine_cpp.h +1 -1
  31. data/ext/extconf.rb +86 -139
  32. data/ext/fastfilereader/extconf.rb +161 -0
  33. data/ext/fastfilereader/mapper.cpp +202 -0
  34. data/ext/fastfilereader/mapper.h +59 -0
  35. data/ext/fastfilereader/rubymain.cpp +127 -0
  36. data/ext/files.cpp +1 -1
  37. data/ext/files.h +1 -1
  38. data/ext/kb.cpp +1 -1
  39. data/ext/page.cpp +1 -1
  40. data/ext/page.h +1 -1
  41. data/ext/pipe.cpp +14 -7
  42. data/ext/project.h +1 -1
  43. data/ext/rubymain.cpp +56 -2
  44. data/ext/sigs.cpp +1 -1
  45. data/ext/sigs.h +1 -1
  46. data/ext/ssl.cpp +1 -1
  47. data/ext/ssl.h +1 -1
  48. data/java/src/com/rubyeventmachine/Application.java +196 -0
  49. data/java/src/com/rubyeventmachine/Connection.java +74 -0
  50. data/java/src/com/rubyeventmachine/ConnectionFactory.java +37 -0
  51. data/java/src/com/rubyeventmachine/DefaultConnectionFactory.java +46 -0
  52. data/java/src/com/rubyeventmachine/EmReactor.java +408 -0
  53. data/java/src/com/rubyeventmachine/EmReactorException.java +40 -0
  54. data/java/src/com/rubyeventmachine/EventableChannel.java +57 -0
  55. data/java/src/com/rubyeventmachine/EventableDatagramChannel.java +171 -0
  56. data/java/src/com/rubyeventmachine/EventableSocketChannel.java +244 -0
  57. data/java/src/com/rubyeventmachine/PeriodicTimer.java +38 -0
  58. data/java/src/com/rubyeventmachine/Timer.java +54 -0
  59. data/java/src/com/rubyeventmachine/tests/ApplicationTest.java +108 -0
  60. data/java/src/com/rubyeventmachine/tests/ConnectTest.java +124 -0
  61. data/java/src/com/rubyeventmachine/tests/EMTest.java +80 -0
  62. data/java/src/com/rubyeventmachine/tests/TestDatagrams.java +53 -0
  63. data/java/src/com/rubyeventmachine/tests/TestServers.java +74 -0
  64. data/java/src/com/rubyeventmachine/tests/TestTimers.java +89 -0
  65. data/lib/em/deferrable.rb +1 -1
  66. data/lib/em/eventable.rb +1 -1
  67. data/lib/em/future.rb +1 -1
  68. data/lib/em/messages.rb +1 -1
  69. data/lib/em/processes.rb +1 -1
  70. data/lib/em/spawnable.rb +1 -1
  71. data/lib/em/streamer.rb +1 -1
  72. data/lib/eventmachine.rb +138 -116
  73. data/lib/eventmachine_version.rb +2 -2
  74. data/lib/evma.rb +1 -1
  75. data/lib/evma/callback.rb +1 -1
  76. data/lib/evma/container.rb +1 -1
  77. data/lib/evma/factory.rb +1 -1
  78. data/lib/evma/protocol.rb +1 -1
  79. data/lib/evma/reactor.rb +1 -1
  80. data/lib/jeventmachine.rb +7 -2
  81. data/lib/pr_eventmachine.rb +2 -2
  82. data/lib/protocols/buftok.rb +1 -1
  83. data/lib/protocols/header_and_content.rb +1 -1
  84. data/lib/protocols/httpcli2.rb +16 -6
  85. data/lib/protocols/httpclient.rb +7 -1
  86. data/lib/protocols/line_and_text.rb +6 -2
  87. data/lib/protocols/linetext2.rb +12 -14
  88. data/lib/protocols/postgres.rb +1 -1
  89. data/lib/protocols/saslauth.rb +1 -1
  90. data/lib/protocols/smtpclient.rb +1 -1
  91. data/lib/protocols/smtpserver.rb +36 -23
  92. data/lib/protocols/stomp.rb +24 -1
  93. data/lib/protocols/tcptest.rb +1 -1
  94. data/tasks/cpp.rake +77 -0
  95. data/tasks/project.rake +78 -0
  96. data/tasks/tests.rake +192 -0
  97. data/tests/test_attach.rb +1 -1
  98. data/tests/test_basic.rb +65 -12
  99. data/tests/test_defer.rb +13 -29
  100. data/tests/test_epoll.rb +16 -21
  101. data/tests/test_errors.rb +1 -1
  102. data/tests/test_eventables.rb +4 -5
  103. data/tests/test_exc.rb +1 -1
  104. data/tests/test_futures.rb +1 -1
  105. data/tests/test_hc.rb +185 -236
  106. data/tests/test_httpclient.rb +1 -1
  107. data/tests/test_httpclient2.rb +28 -6
  108. data/tests/test_kb.rb +2 -2
  109. data/tests/test_ltp.rb +139 -141
  110. data/tests/test_ltp2.rb +1 -1
  111. data/tests/test_next_tick.rb +1 -1
  112. data/tests/test_processes.rb +1 -1
  113. data/tests/test_pure.rb +3 -2
  114. data/tests/test_running.rb +1 -1
  115. data/tests/test_sasl.rb +1 -1
  116. data/tests/test_send_file.rb +56 -51
  117. data/tests/test_servers.rb +26 -36
  118. data/tests/test_smtpclient.rb +46 -44
  119. data/tests/test_smtpserver.rb +1 -1
  120. data/tests/test_spawn.rb +1 -1
  121. data/tests/test_ssl_args.rb +68 -0
  122. data/tests/test_timers.rb +15 -9
  123. data/tests/test_ud.rb +1 -1
  124. data/tests/testem.rb +30 -4
  125. metadata +69 -34
@@ -1,4 +1,4 @@
1
- # $Id: test_timers.rb 715 2008-06-20 21:26:14Z francis $
1
+ # $Id$
2
2
  #
3
3
  # Author:: Francis Cianfrocca (gmail: blackhedd)
4
4
  # Homepage:: http://rubyeventmachine.com
@@ -73,10 +73,10 @@ class TestTimers < Test::Unit::TestCase
73
73
  def test_periodic_timer
74
74
  x = 0
75
75
  EventMachine.run {
76
- EventMachine::PeriodicTimer.new(0.1, proc {
76
+ EventMachine::PeriodicTimer.new(0.1) do
77
77
  x += 1
78
- EventMachine.stop if x == 4
79
- })
78
+ EventMachine.stop if x == 4
79
+ end
80
80
  }
81
81
  assert( x == 4 )
82
82
  end
@@ -84,7 +84,7 @@ class TestTimers < Test::Unit::TestCase
84
84
  def test_periodic_timer_cancel
85
85
  x = 0
86
86
  EventMachine.run {
87
- pt = EventMachine::PeriodicTimer.new(5, proc { x += 1 })
87
+ pt = EventMachine::PeriodicTimer.new(0.25, proc { x += 1 })
88
88
  pt.cancel
89
89
  EventMachine::Timer.new(0.5) {EventMachine.stop}
90
90
  }
@@ -121,14 +121,20 @@ class TestTimers < Test::Unit::TestCase
121
121
  elsif EM.library_type == :java
122
122
  ten_thousand_timers.call
123
123
  else
124
- assert_raise( RuntimeError ) {
125
- ten_thousand_timers.call
126
- }
124
+ begin
125
+ assert_raise( RuntimeError ) {
126
+ ten_thousand_timers.call
127
+ }
128
+ rescue Object
129
+ p $!
130
+ assert(false, $!.message)
131
+ end
127
132
  end
128
133
  EM.stop
129
134
  }
130
135
 
131
- EM.set_max_timers( 10001 )
136
+ assert(!EM.reactor_running?, 'Reactor running when it should not be.')
137
+ EM.set_max_timers( 10001 )
132
138
 
133
139
  EM.run {
134
140
  ten_thousand_timers.call
@@ -1,4 +1,4 @@
1
- # $Id: test_ud.rb 668 2008-01-04 23:00:34Z blackhedd $
1
+ # $Id$
2
2
  #
3
3
  # Author:: Francis Cianfrocca (gmail: blackhedd)
4
4
  # Homepage:: http://rubyeventmachine.com
@@ -1,5 +1,31 @@
1
- # $Id: testem.rb 668 2008-01-04 23:00:34Z blackhedd $
2
- #
3
- # STUB
4
- #
1
+ # $Id$
5
2
 
3
+ require 'test/unit'
4
+
5
+ module EmTestRunner
6
+ @em_root = File.expand_path(File.dirname(__FILE__) + '/../')
7
+ @lib_dir = File.join(@em_root, 'lib')
8
+ @ext_dir = File.join(@em_root, 'ext')
9
+ @java_dir = File.join(@em_root, 'java')
10
+
11
+ def self.run(glob = 'test_*.rb')
12
+ $:.unshift(@lib_dir)
13
+ $:.unshift(@ext_dir)
14
+ $:.unshift(@java_dir)
15
+
16
+ case glob
17
+ when Array
18
+ files = glob
19
+ else
20
+ files = Dir[File.dirname(__FILE__) + '/' + glob]
21
+ end
22
+
23
+ files.each do |tc|
24
+ require tc
25
+ end
26
+ end
27
+ end
28
+
29
+ if __FILE__ == $0
30
+ EmTestRunner.run
31
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: eventmachine
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.12.2
4
+ version: 0.12.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Francis Cianfrocca
@@ -9,31 +9,34 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2008-09-25 00:00:00 +01:00
12
+ date: 2009-02-08 00:00:00 -08:00
13
13
  default_executable:
14
14
  dependencies: []
15
15
 
16
- description: ""
16
+ description: EventMachine implements a fast, single-threaded engine for arbitrary network communications. It's extremely easy to use in Ruby. EventMachine wraps all interactions with IP sockets, allowing programs to concentrate on the implementation of network protocols. It can be used to create both network servers and clients. To create a server or client, a Ruby program only needs to specify the IP address and port, and provide a Module that implements the communications protocol. Implementations of several standard network protocols are provided with the package, primarily to serve as examples. The real goal of EventMachine is to enable programs to easily interface with other programs using TCP/IP, especially if custom protocols are required.
17
17
  email: garbagecat10@gmail.com
18
18
  executables: []
19
19
 
20
20
  extensions:
21
- - ext/extconf.rb
21
+ - Rakefile
22
22
  extra_rdoc_files:
23
- - README
24
- - RELEASE_NOTES
25
- - COPYING
26
- - EPOLL
27
- - GNU
28
- - LEGAL
29
- - TODO
30
- - KEYBOARD
31
- - LIGHTWEIGHT_CONCURRENCY
32
- - PURE_RUBY
33
- - SMTP
34
- - SPAWNED_PROCESSES
35
- - DEFERRABLES
23
+ - docs/ChangeLog
24
+ - docs/COPYING
25
+ - docs/DEFERRABLES
26
+ - docs/EPOLL
27
+ - docs/GNU
28
+ - docs/INSTALL
29
+ - docs/KEYBOARD
30
+ - docs/LEGAL
31
+ - docs/LIGHTWEIGHT_CONCURRENCY
32
+ - docs/PURE_RUBY
33
+ - docs/README
34
+ - docs/RELEASE_NOTES
35
+ - docs/SMTP
36
+ - docs/SPAWNED_PROCESSES
37
+ - docs/TODO
36
38
  files:
39
+ - Rakefile
37
40
  - tests/test_attach.rb
38
41
  - tests/test_basic.rb
39
42
  - tests/test_defer.rb
@@ -58,6 +61,7 @@ files:
58
61
  - tests/test_smtpclient.rb
59
62
  - tests/test_smtpserver.rb
60
63
  - tests/test_spawn.rb
64
+ - tests/test_ssl_args.rb
61
65
  - tests/test_timers.rb
62
66
  - tests/test_ud.rb
63
67
  - tests/testem.rb
@@ -108,6 +112,11 @@ files:
108
112
  - ext/eventmachine.h
109
113
  - ext/eventmachine_cpp.h
110
114
  - ext/extconf.rb
115
+ - ext/fastfilereader
116
+ - ext/fastfilereader/extconf.rb
117
+ - ext/fastfilereader/mapper.cpp
118
+ - ext/fastfilereader/mapper.h
119
+ - ext/fastfilereader/rubymain.cpp
111
120
  - ext/files.cpp
112
121
  - ext/files.h
113
122
  - ext/kb.cpp
@@ -120,19 +129,45 @@ files:
120
129
  - ext/sigs.h
121
130
  - ext/ssl.cpp
122
131
  - ext/ssl.h
123
- - README
124
- - RELEASE_NOTES
125
- - COPYING
126
- - EPOLL
127
- - GNU
128
- - LEGAL
129
- - TODO
130
- - KEYBOARD
131
- - LIGHTWEIGHT_CONCURRENCY
132
- - PURE_RUBY
133
- - SMTP
134
- - SPAWNED_PROCESSES
135
- - DEFERRABLES
132
+ - java/src
133
+ - java/src/com
134
+ - java/src/com/rubyeventmachine
135
+ - java/src/com/rubyeventmachine/Application.java
136
+ - java/src/com/rubyeventmachine/Connection.java
137
+ - java/src/com/rubyeventmachine/ConnectionFactory.java
138
+ - java/src/com/rubyeventmachine/DefaultConnectionFactory.java
139
+ - java/src/com/rubyeventmachine/EmReactor.java
140
+ - java/src/com/rubyeventmachine/EmReactorException.java
141
+ - java/src/com/rubyeventmachine/EventableChannel.java
142
+ - java/src/com/rubyeventmachine/EventableDatagramChannel.java
143
+ - java/src/com/rubyeventmachine/EventableSocketChannel.java
144
+ - java/src/com/rubyeventmachine/PeriodicTimer.java
145
+ - java/src/com/rubyeventmachine/tests
146
+ - java/src/com/rubyeventmachine/tests/ApplicationTest.java
147
+ - java/src/com/rubyeventmachine/tests/ConnectTest.java
148
+ - java/src/com/rubyeventmachine/tests/EMTest.java
149
+ - java/src/com/rubyeventmachine/tests/TestDatagrams.java
150
+ - java/src/com/rubyeventmachine/tests/TestServers.java
151
+ - java/src/com/rubyeventmachine/tests/TestTimers.java
152
+ - java/src/com/rubyeventmachine/Timer.java
153
+ - tasks/cpp.rake
154
+ - tasks/project.rake
155
+ - tasks/tests.rake
156
+ - docs/ChangeLog
157
+ - docs/COPYING
158
+ - docs/DEFERRABLES
159
+ - docs/EPOLL
160
+ - docs/GNU
161
+ - docs/INSTALL
162
+ - docs/KEYBOARD
163
+ - docs/LEGAL
164
+ - docs/LIGHTWEIGHT_CONCURRENCY
165
+ - docs/PURE_RUBY
166
+ - docs/README
167
+ - docs/RELEASE_NOTES
168
+ - docs/SMTP
169
+ - docs/SPAWNED_PROCESSES
170
+ - docs/TODO
136
171
  has_rdoc: true
137
172
  homepage: http://rubyeventmachine.com
138
173
  post_install_message:
@@ -140,7 +175,7 @@ rdoc_options:
140
175
  - --title
141
176
  - EventMachine
142
177
  - --main
143
- - README
178
+ - docs/README
144
179
  - --line-numbers
145
180
  require_paths:
146
181
  - lib
@@ -159,9 +194,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
159
194
  requirements: []
160
195
 
161
196
  rubyforge_project: eventmachine
162
- rubygems_version: 1.2.0
197
+ rubygems_version: 1.3.1
163
198
  signing_key:
164
199
  specification_version: 2
165
200
  summary: Ruby/EventMachine library
166
- test_files:
167
- - tests/testem.rb
201
+ test_files: []
202
+