event_machine_flush 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGELOG ADDED
@@ -0,0 +1,3 @@
1
+ == 0.0.1 2010-04-22
2
+
3
+ * Hi.
data/LICENSE ADDED
@@ -0,0 +1,20 @@
1
+ Copyright (c) 2010 George Ogata
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining
4
+ a copy of this software and associated documentation files (the
5
+ "Software"), to deal in the Software without restriction, including
6
+ without limitation the rights to use, copy, modify, merge, publish,
7
+ distribute, sublicense, and/or sell copies of the Software, and to
8
+ permit persons to whom the Software is furnished to do so, subject to
9
+ the following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be
12
+ included in all copies or substantial portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.markdown ADDED
@@ -0,0 +1,22 @@
1
+ # Event Machine Flush
2
+
3
+ Tiny gem that adds the ability to flush an EventMachine::Connection's
4
+ output buffer.
5
+
6
+ Probably evil.
7
+
8
+ ## Usage
9
+
10
+ EventMachineFlush.flush(connection)
11
+
12
+ ## Note on Patches/Pull Requests
13
+
14
+ * Bug reports: http://github.com/oggy/event_machine_flush/issues
15
+ * Source: http://github.com/oggy/event_machine_flush
16
+ * Patches: Fork on Github, send pull request.
17
+ * Ensure patch includes tests.
18
+ * Leave the version alone, or bump it in a separate commit.
19
+
20
+ ## Copyright
21
+
22
+ Copyright (c) 2010 George Ogata. See LICENSE for details.
data/Rakefile ADDED
@@ -0,0 +1,2 @@
1
+ gem 'ritual'
2
+ require 'ritual'
@@ -0,0 +1,16 @@
1
+ #include "ruby.h"
2
+ #include "project.h"
3
+
4
+ extern "C" {
5
+ VALUE EventMachineFlush_flush(VALUE self, VALUE connection) {
6
+ unsigned long signature = NUM2ULONG(rb_iv_get(connection, "@signature"));
7
+ ConnectionDescriptor *ed = dynamic_cast<ConnectionDescriptor*>(Bindable_t::GetObject(signature));
8
+ ed->Write();
9
+ return Qnil;
10
+ }
11
+
12
+ void Init_event_machine_flush_ext() {
13
+ VALUE mEventMachineFlush = rb_define_module("EventMachineFlush");
14
+ rb_define_singleton_method(mEventMachineFlush, "flush", (VALUE(*)(...))EventMachineFlush_flush, 1);
15
+ }
16
+ }
data/ext/extconf.rb ADDED
@@ -0,0 +1,20 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ # Find the EventMachine gem.
4
+ require 'rubygems'
5
+ specs = Gem.source_index.find_name('eventmachine')
6
+ specs.size > 0 or
7
+ abort "can't find eventmachine gem"
8
+ @event_machine_path = specs.first.full_gem_path
9
+
10
+ # Stub out create_makefile and load EventMachine's extconf.rb. This
11
+ # ensures our build environment matches.
12
+ require 'mkmf'
13
+ alias original_create_makefile create_makefile
14
+ def create_makefile(*) end
15
+ require "#@event_machine_path/ext/extconf.rb"
16
+ alias create_makefile original_create_makefile
17
+
18
+ # Create our makefile.
19
+ $INCFLAGS << " -I#@event_machine_path/ext"
20
+ create_makefile "event_machine_flush_ext"
@@ -0,0 +1,3 @@
1
+ module EventMachineFlush
2
+ VERSION = [0, 0, 1]
3
+ end
@@ -0,0 +1,2 @@
1
+ require 'eventmachine'
2
+ require 'event_machine_flush_ext'
metadata ADDED
@@ -0,0 +1,89 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: event_machine_flush
3
+ version: !ruby/object:Gem::Version
4
+ prerelease: false
5
+ segments:
6
+ - 0
7
+ - 0
8
+ - 1
9
+ version: 0.0.1
10
+ platform: ruby
11
+ authors:
12
+ - George Ogata
13
+ autorequire:
14
+ bindir: bin
15
+ cert_chain: []
16
+
17
+ date: 2010-04-22 00:00:00 -04:00
18
+ default_executable:
19
+ dependencies:
20
+ - !ruby/object:Gem::Dependency
21
+ name: eventmachine
22
+ prerelease: false
23
+ requirement: &id001 !ruby/object:Gem::Requirement
24
+ requirements:
25
+ - - ~>
26
+ - !ruby/object:Gem::Version
27
+ segments:
28
+ - 0
29
+ - 12
30
+ - 10
31
+ version: 0.12.10
32
+ type: :runtime
33
+ version_requirements: *id001
34
+ description: |
35
+ For when you've abandoned all hope.
36
+
37
+ email:
38
+ - george.ogata@gmail.com
39
+ executables: []
40
+
41
+ extensions:
42
+ - ext/extconf.rb
43
+ extra_rdoc_files:
44
+ - LICENSE
45
+ - README.markdown
46
+ files:
47
+ - lib/event_machine_flush/version.rb
48
+ - lib/event_machine_flush.rb
49
+ - ext/event_machine_flush.cpp
50
+ - ext/extconf.rb
51
+ - LICENSE
52
+ - README.markdown
53
+ - Rakefile
54
+ - CHANGELOG
55
+ has_rdoc: true
56
+ homepage: http://github.com/oggy/event_machine_flush
57
+ licenses: []
58
+
59
+ post_install_message:
60
+ rdoc_options:
61
+ - --charset=UTF-8
62
+ require_paths:
63
+ - ext
64
+ - lib
65
+ required_ruby_version: !ruby/object:Gem::Requirement
66
+ requirements:
67
+ - - ">="
68
+ - !ruby/object:Gem::Version
69
+ segments:
70
+ - 0
71
+ version: "0"
72
+ required_rubygems_version: !ruby/object:Gem::Requirement
73
+ requirements:
74
+ - - ">="
75
+ - !ruby/object:Gem::Version
76
+ segments:
77
+ - 1
78
+ - 3
79
+ - 6
80
+ version: 1.3.6
81
+ requirements: []
82
+
83
+ rubyforge_project:
84
+ rubygems_version: 1.3.6
85
+ signing_key:
86
+ specification_version: 3
87
+ summary: Flush EventMachine::Connection output buffers immediately.
88
+ test_files: []
89
+