dickstreamer 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (5) hide show
  1. data/Manifest +3 -0
  2. data/Rakefile +10 -0
  3. data/dickstreamer.gemspec +29 -0
  4. data/dickstreamer.rb +40 -0
  5. metadata +71 -0
data/Manifest ADDED
@@ -0,0 +1,3 @@
1
+ Rakefile
2
+ dickstreamer.rb
3
+ Manifest
data/Rakefile ADDED
@@ -0,0 +1,10 @@
1
+ require 'rubygems'
2
+ require 'rake'
3
+ require 'echoe'
4
+
5
+ Echoe.new('dickstreamer', '0.0.1') do |p|
6
+ p.description = "Streaming dicks server inspired by dicks.rb. Submitted by one of bshagnasty's cohorts... Boliver T. Shagnasty rides again!"
7
+ p.author = "Boliver T. Shagnasty"
8
+ p.email = "dicks@libernil.org"
9
+ p.development_dependencies = []
10
+ end
@@ -0,0 +1,29 @@
1
+ # -*- encoding: utf-8 -*-
2
+
3
+ Gem::Specification.new do |s|
4
+ s.name = %q{dickstreamer}
5
+ s.version = "0.0.1"
6
+
7
+ s.required_rubygems_version = Gem::Requirement.new(">= 1.2") if s.respond_to? :required_rubygems_version=
8
+ s.authors = ["Boliver T. Shagnasty"]
9
+ s.date = %q{2010-11-30}
10
+ s.description = %q{Streaming dicks server inspired by dicks.rb. Submitted by one of bshagnasty's cohorts... Boliver T. Shagnasty rides again!}
11
+ s.email = %q{dicks@libernil.org}
12
+ s.files = ["Rakefile", "dickstreamer.rb", "Manifest", "dickstreamer.gemspec"]
13
+ s.homepage = %q{}
14
+ s.rdoc_options = ["--line-numbers", "--inline-source", "--title", "Dickstreamer"]
15
+ s.require_paths = ["lib"]
16
+ s.rubyforge_project = %q{dickstreamer}
17
+ s.rubygems_version = %q{1.3.7}
18
+ s.summary = %q{Streaming dicks server inspired by dicks.rb. Submitted by one of bshagnasty's cohorts... Boliver T. Shagnasty rides again!}
19
+
20
+ if s.respond_to? :specification_version then
21
+ current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
22
+ s.specification_version = 3
23
+
24
+ if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
25
+ else
26
+ end
27
+ else
28
+ end
29
+ end
data/dickstreamer.rb ADDED
@@ -0,0 +1,40 @@
1
+ #!/usr/bin/env ruby
2
+ # Boliver T. Shangnasty rides again!
3
+ # Submitted by an anonymous cohort.
4
+
5
+ require 'rubygems'
6
+ require 'eventmachine'
7
+
8
+ BALLS,SHAFT,HEAD = "8","=","D"
9
+
10
+ class DickHandler < EventMachine::Connection
11
+ def post_init
12
+ puts "new connection"
13
+
14
+ @operation = proc do
15
+ d = "#{BALLS}#{SHAFT * (rand(10)+1)}#{HEAD}"
16
+ send_data("#{d}\n")
17
+ end
18
+
19
+ @callback = proc do |res|
20
+ if res >= 0
21
+ EM.defer(@operation, @callback)
22
+ end
23
+ end
24
+
25
+ EM.defer(@operation, @callback)
26
+ end
27
+
28
+ def receive_data(data)
29
+ puts "discarding incoming data: #{data}"
30
+ end
31
+
32
+ def unbind
33
+ puts "closed connection"
34
+ end
35
+
36
+ end
37
+
38
+ EventMachine::run {
39
+ EventMachine::start_server("0.0.0.0", 8080, DickHandler)
40
+ }
metadata ADDED
@@ -0,0 +1,71 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: dickstreamer
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
+ - Boliver T. Shagnasty
13
+ autorequire:
14
+ bindir: bin
15
+ cert_chain: []
16
+
17
+ date: 2010-11-30 00:00:00 -06:00
18
+ default_executable:
19
+ dependencies: []
20
+
21
+ description: Streaming dicks server inspired by dicks.rb. Submitted by one of bshagnasty's cohorts... Boliver T. Shagnasty rides again!
22
+ email: dicks@libernil.org
23
+ executables: []
24
+
25
+ extensions: []
26
+
27
+ extra_rdoc_files: []
28
+
29
+ files:
30
+ - Rakefile
31
+ - dickstreamer.rb
32
+ - Manifest
33
+ - dickstreamer.gemspec
34
+ has_rdoc: true
35
+ homepage: ""
36
+ licenses: []
37
+
38
+ post_install_message:
39
+ rdoc_options:
40
+ - --line-numbers
41
+ - --inline-source
42
+ - --title
43
+ - Dickstreamer
44
+ require_paths:
45
+ - lib
46
+ required_ruby_version: !ruby/object:Gem::Requirement
47
+ none: false
48
+ requirements:
49
+ - - ">="
50
+ - !ruby/object:Gem::Version
51
+ segments:
52
+ - 0
53
+ version: "0"
54
+ required_rubygems_version: !ruby/object:Gem::Requirement
55
+ none: false
56
+ requirements:
57
+ - - ">="
58
+ - !ruby/object:Gem::Version
59
+ segments:
60
+ - 1
61
+ - 2
62
+ version: "1.2"
63
+ requirements: []
64
+
65
+ rubyforge_project: dickstreamer
66
+ rubygems_version: 1.3.7
67
+ signing_key:
68
+ specification_version: 3
69
+ summary: Streaming dicks server inspired by dicks.rb. Submitted by one of bshagnasty's cohorts... Boliver T. Shagnasty rides again!
70
+ test_files: []
71
+