dripdrop 0.10.0.beta2 → 0.10.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,31 @@
1
+ ## MAC OS
2
+ .DS_Store
3
+
4
+ ## TEXTMATE
5
+ *.tmproj
6
+ tmtags
7
+
8
+ ## EMACS
9
+ *~
10
+ \#*
11
+ .\#*
12
+
13
+ ## VIM
14
+ *.swp
15
+ *.swo
16
+ *.swn
17
+
18
+ ## PROJECT::GENERAL
19
+ coverage
20
+ rdoc
21
+ doc
22
+ pkg
23
+
24
+ #RBX
25
+ *.rbc
26
+
27
+ ## PROJECT::SPECIFIC
28
+ .rvmrc
29
+ Gemfile.lock
30
+ .bundle
31
+ *.gem
data/Gemfile ADDED
@@ -0,0 +1,5 @@
1
+ source "http://rubygems.org"
2
+
3
+ # Specify your gem's dependencies in dripdrop.gemspec
4
+ gemspec
5
+
data/README.md CHANGED
@@ -2,11 +2,11 @@
2
2
 
3
3
  ## INSTALLATION NOTES:
4
4
 
5
- 1. Install with 'gem install dripdrop --pre' as you probably want the beta gem.
6
- 2. Build eventmachine from [git master](https://github.com/eventmachine/eventmachine). It fixes a ZeroMQ bug that will cause you much pain if you don't have it.
7
- 3. Build zeromq2 from [git master](https://github.com/zeromq/zeromq2)
8
- 4. You probably want the yajl-ruby (or json-java if you're on jRuby) gem installed for optimal JSON generation. You don't have to use JSON with DripDrop, but it is the default.
9
- 5. If you have any problems, open an issue, a lot of stuff is in flux!
5
+ 1. This does NOT work with 1.8.7. 1.9.2/RBX/jRuby only.
6
+ 2. Build zeromq2 from [git master](https://github.com/zeromq/zeromq2) if you haven't already.
7
+ 3. Install with 'gem install dripdrop'.
8
+ 4. If on jRuby, http servers will be unavailable unless you have a jruby with cext support, and manually `gem install eventmachine_httpserver`
9
+ 5. If on 1.9.x `gem install ffi`
10
10
 
11
11
  ## About
12
12
 
data/Rakefile CHANGED
@@ -1,35 +1,11 @@
1
- require 'rubygems'
2
- require 'rake'
3
-
4
- begin
5
- require 'jeweler'
6
- Jeweler::Tasks.new do |gem|
7
- gem.name = "dripdrop"
8
- gem.summary = %Q{Evented framework for ZeroMQ and EventMachine Apps.}
9
- gem.description = %Q{Evented framework for ZeroMQ and EventMachine Apps. }
10
- gem.email = "andrew@andrewvc.com"
11
- gem.homepage = "http://github.com/andrewvc/dripdrop"
12
- gem.authors = ["Andrew Cholakian"]
13
- gem.add_dependency('eventmachine', '>= 0.12.10')
14
- gem.add_dependency('em-websocket')
15
- gem.add_dependency('em-zeromq', '>= 0.2.0')
16
- gem.add_development_dependency('rspec', '>= 2.4.0')
17
- end
18
- Jeweler::GemcutterTasks.new
19
- rescue LoadError
20
- puts "Jeweler (or a dependency) not available. Install it with: gem install jeweler"
21
- end
22
-
23
- task :test => :check_dependencies
24
-
25
- task :default => :test
1
+ require 'bundler'
2
+ Bundler::GemHelper.install_tasks
26
3
 
27
4
  require 'rake/rdoctask'
5
+ require 'dripdrop/version'
28
6
  Rake::RDocTask.new do |rdoc|
29
- version = File.exist?('VERSION') ? File.read('VERSION') : ""
30
-
31
7
  rdoc.rdoc_dir = 'rdoc'
32
- rdoc.title = "dripdrop #{version}"
8
+ rdoc.title = "dripdrop #{DripDrop::VERSION}"
33
9
  rdoc.rdoc_files.include('README*')
34
10
  rdoc.rdoc_files.include('lib/**/*.rb')
35
11
  end
@@ -37,4 +13,4 @@ end
37
13
  require 'rspec/core/rake_task'
38
14
  RSpec::Core::RakeTask.new(:spec) do |t|
39
15
  end
40
-
16
+ task :default => :spec
@@ -1,104 +1,37 @@
1
- # Generated by jeweler
2
- # DO NOT EDIT THIS FILE DIRECTLY
3
- # Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
4
1
  # -*- encoding: utf-8 -*-
2
+ $:.push File.expand_path("../lib", __FILE__)
3
+ require "dripdrop/version"
5
4
 
6
5
  Gem::Specification.new do |s|
7
- s.name = %q{dripdrop}
8
- s.version = "0.10.0.beta2"
9
-
10
- s.required_rubygems_version = Gem::Requirement.new("> 1.3.1") if s.respond_to? :required_rubygems_version=
11
- s.authors = ["Andrew Cholakian"]
12
- s.date = %q{2011-03-01}
13
- s.description = %q{Evented framework for ZeroMQ and EventMachine Apps. }
14
- s.email = %q{andrew@andrewvc.com}
6
+ s.name = "dripdrop"
7
+ s.version = DripDrop::VERSION
8
+ s.platform = RUBY_PLATFORM[/java/] || Gem::Platform::RUBY
9
+ s.authors = ["Andrew Cholakian"]
10
+ s.email = ["andrew@andrewvc.com"]
11
+ s.homepage = "https://github.com/andrewvc/dripdrop"
12
+ s.summary = %q{Evented framework for ZeroMQ and EventMachine Apps.}
13
+ s.description = %q{Evented framework for ZeroMQ and EventMachine Apps.}
15
14
  s.extra_rdoc_files = [
16
15
  "LICENSE",
17
16
  "README.md"
18
17
  ]
19
- s.files = [
20
- ".document",
21
- "LICENSE",
22
- "README.md",
23
- "Rakefile",
24
- "VERSION",
25
- "dripdrop.gemspec",
26
- "example/agent_test.rb",
27
- "example/combined.rb",
28
- "example/complex/README",
29
- "example/complex/client.rb",
30
- "example/complex/server.rb",
31
- "example/complex/service.rb",
32
- "example/complex/websocket.rb",
33
- "example/http.rb",
34
- "example/pubsub.rb",
35
- "example/pushpull.rb",
36
- "example/subclass.rb",
37
- "example/xreq_xrep.rb",
38
- "js/dripdrop.html",
39
- "js/dripdrop.js",
40
- "js/qunit.css",
41
- "js/qunit.js",
42
- "lib/dripdrop.rb",
43
- "lib/dripdrop/agent.rb",
44
- "lib/dripdrop/handlers/base.rb",
45
- "lib/dripdrop/handlers/http_client.rb",
46
- "lib/dripdrop/handlers/http_server.rb",
47
- "lib/dripdrop/handlers/mongrel2.rb",
48
- "lib/dripdrop/handlers/websocket_server.rb",
49
- "lib/dripdrop/handlers/zeromq.rb",
50
- "lib/dripdrop/message.rb",
51
- "lib/dripdrop/node.rb",
52
- "lib/dripdrop/node/nodelet.rb",
53
- "spec/gimite-websocket.rb",
54
- "spec/message_spec.rb",
55
- "spec/node/http_spec.rb",
56
- "spec/node/nodelet_spec.rb",
57
- "spec/node/routing_spec.rb",
58
- "spec/node/websocket_spec.rb",
59
- "spec/node/zmq_m2_spec.rb",
60
- "spec/node/zmq_pushpull_spec.rb",
61
- "spec/node/zmq_xrepxreq_spec.rb",
62
- "spec/node_spec.rb",
63
- "spec/spec_helper.rb"
64
- ]
65
- s.homepage = %q{http://github.com/andrewvc/dripdrop}
66
- s.require_paths = ["lib"]
67
- s.rubygems_version = %q{1.5.3}
68
- s.summary = %q{Evented framework for ZeroMQ and EventMachine Apps.}
69
- s.test_files = [
70
- "spec/gimite-websocket.rb",
71
- "spec/message_spec.rb",
72
- "spec/node/http_spec.rb",
73
- "spec/node/nodelet_spec.rb",
74
- "spec/node/routing_spec.rb",
75
- "spec/node/websocket_spec.rb",
76
- "spec/node/zmq_m2_spec.rb",
77
- "spec/node/zmq_pushpull_spec.rb",
78
- "spec/node/zmq_xrepxreq_spec.rb",
79
- "spec/node_spec.rb",
80
- "spec/spec_helper.rb"
81
- ]
82
18
 
83
- if s.respond_to? :specification_version then
84
- s.specification_version = 3
19
+ s.rubyforge_project = "dripdrop"
85
20
 
86
- if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
87
- s.add_runtime_dependency(%q<eventmachine>, [">= 0.12.10"])
88
- s.add_runtime_dependency(%q<em-websocket>, [">= 0"])
89
- s.add_runtime_dependency(%q<em-zeromq>, [">= 0.2.0"])
90
- s.add_development_dependency(%q<rspec>, [">= 2.4.0"])
91
- else
92
- s.add_dependency(%q<eventmachine>, [">= 0.12.10"])
93
- s.add_dependency(%q<em-websocket>, [">= 0"])
94
- s.add_dependency(%q<em-zeromq>, [">= 0.2.0"])
95
- s.add_dependency(%q<rspec>, [">= 2.4.0"])
96
- end
21
+ s.add_dependency "eventmachine", ">= 0.12.10"
22
+ s.add_dependency "em-websocket", ">= 0"
23
+ s.add_dependency "em-zeromq", ">= 0.2.1"
24
+ if s.platform.to_s == "java"
25
+ s.add_dependency "json", ">= 1.5.1"
97
26
  else
98
- s.add_dependency(%q<eventmachine>, [">= 0.12.10"])
99
- s.add_dependency(%q<em-websocket>, [">= 0"])
100
- s.add_dependency(%q<em-zeromq>, [">= 0.2.0"])
101
- s.add_dependency(%q<rspec>, [">= 2.4.0"])
27
+ s.add_dependency "yajl-ruby", ">= 0.8.1"
28
+ s.add_dependency "eventmachine_httpserver", ">= 0.2.1"
102
29
  end
30
+ s.add_development_dependency "rspec", ">= 2.4.0"
31
+
32
+ s.files = `git ls-files`.split("\n")
33
+ s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
34
+ s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
35
+ s.require_paths = ["lib"]
103
36
  end
104
37
 
@@ -21,10 +21,13 @@ class DripDrop
21
21
  ws.onopen { @onopen_handler.call(dd_conn) if @onopen_handler }
22
22
  ws.onclose { @onclose_handler.call(dd_conn) if @onclose_handler }
23
23
  ws.onerror {|reason|
24
- e = SocketError.new
25
- e.reason = reason
26
- e.connection = dd_conn
27
- handle_error(e)
24
+ begin
25
+ raise SocketError, reason
26
+ rescue SocketError => e
27
+ e.reason = reason
28
+ e.connection = dd_conn
29
+ handle_error(e,dd_conn)
30
+ end
28
31
  }
29
32
 
30
33
  ws.onmessage { |message|
@@ -65,7 +65,7 @@ class DripDrop
65
65
  if @block
66
66
  self.instance_eval(&@block)
67
67
  else
68
- raise "Could not start, no block or specified"
68
+ raise "Could not start, no block or action specified"
69
69
  end
70
70
  end
71
71
 
@@ -0,0 +1,3 @@
1
+ class DripDrop
2
+ VERSION = "0.10.0"
3
+ end
@@ -2,6 +2,7 @@ require 'spec_helper'
2
2
 
3
3
  require 'set'
4
4
 
5
+ if defined?(EM::HttpServer)
5
6
  describe "http" do
6
7
 
7
8
  def http_send_messages(to_send,addr=rand_addr('http'),&block)
@@ -73,3 +74,4 @@ describe "http" do
73
74
  it_should_behave_like "all http nodes"
74
75
  end
75
76
  end
77
+ end
@@ -72,6 +72,7 @@ describe DripDrop::Node do
72
72
  class TestException < StandardError; end
73
73
 
74
74
  it "should rescue exceptions in the EM reactor" do
75
+ pending "Not sure why em-java doesn't support this" if RUBY_PLATFORM == 'java'
75
76
  expectations = an_instance_of(TestException)
76
77
  reactor = run_reactor do
77
78
  self.class.should_receive(:error_handler).with(expectations)
metadata CHANGED
@@ -1,8 +1,8 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dripdrop
3
3
  version: !ruby/object:Gem::Version
4
- prerelease: 7
5
- version: 0.10.0.beta2
4
+ prerelease:
5
+ version: 0.10.0
6
6
  platform: ruby
7
7
  authors:
8
8
  - Andrew Cholakian
@@ -10,7 +10,7 @@ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
12
 
13
- date: 2011-03-01 00:00:00 -08:00
13
+ date: 2011-03-12 23:00:00 -08:00
14
14
  default_executable:
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
@@ -43,22 +43,45 @@ dependencies:
43
43
  requirements:
44
44
  - - ">="
45
45
  - !ruby/object:Gem::Version
46
- version: 0.2.0
46
+ version: 0.2.1
47
47
  type: :runtime
48
48
  version_requirements: *id003
49
49
  - !ruby/object:Gem::Dependency
50
- name: rspec
50
+ name: yajl-ruby
51
51
  prerelease: false
52
52
  requirement: &id004 !ruby/object:Gem::Requirement
53
+ none: false
54
+ requirements:
55
+ - - ">="
56
+ - !ruby/object:Gem::Version
57
+ version: 0.8.1
58
+ type: :runtime
59
+ version_requirements: *id004
60
+ - !ruby/object:Gem::Dependency
61
+ name: eventmachine_httpserver
62
+ prerelease: false
63
+ requirement: &id005 !ruby/object:Gem::Requirement
64
+ none: false
65
+ requirements:
66
+ - - ">="
67
+ - !ruby/object:Gem::Version
68
+ version: 0.2.1
69
+ type: :runtime
70
+ version_requirements: *id005
71
+ - !ruby/object:Gem::Dependency
72
+ name: rspec
73
+ prerelease: false
74
+ requirement: &id006 !ruby/object:Gem::Requirement
53
75
  none: false
54
76
  requirements:
55
77
  - - ">="
56
78
  - !ruby/object:Gem::Version
57
79
  version: 2.4.0
58
80
  type: :development
59
- version_requirements: *id004
60
- description: "Evented framework for ZeroMQ and EventMachine Apps. "
61
- email: andrew@andrewvc.com
81
+ version_requirements: *id006
82
+ description: Evented framework for ZeroMQ and EventMachine Apps.
83
+ email:
84
+ - andrew@andrewvc.com
62
85
  executables: []
63
86
 
64
87
  extensions: []
@@ -68,10 +91,11 @@ extra_rdoc_files:
68
91
  - README.md
69
92
  files:
70
93
  - .document
94
+ - .gitignore
95
+ - Gemfile
71
96
  - LICENSE
72
97
  - README.md
73
98
  - Rakefile
74
- - VERSION
75
99
  - dripdrop.gemspec
76
100
  - example/agent_test.rb
77
101
  - example/combined.rb
@@ -100,6 +124,7 @@ files:
100
124
  - lib/dripdrop/message.rb
101
125
  - lib/dripdrop/node.rb
102
126
  - lib/dripdrop/node/nodelet.rb
127
+ - lib/dripdrop/version.rb
103
128
  - spec/gimite-websocket.rb
104
129
  - spec/message_spec.rb
105
130
  - spec/node/http_spec.rb
@@ -112,7 +137,7 @@ files:
112
137
  - spec/node_spec.rb
113
138
  - spec/spec_helper.rb
114
139
  has_rdoc: true
115
- homepage: http://github.com/andrewvc/dripdrop
140
+ homepage: https://github.com/andrewvc/dripdrop
116
141
  licenses: []
117
142
 
118
143
  post_install_message:
@@ -129,25 +154,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
129
154
  required_rubygems_version: !ruby/object:Gem::Requirement
130
155
  none: false
131
156
  requirements:
132
- - - ">"
157
+ - - ">="
133
158
  - !ruby/object:Gem::Version
134
- version: 1.3.1
159
+ version: "0"
135
160
  requirements: []
136
161
 
137
- rubyforge_project:
138
- rubygems_version: 1.5.3
162
+ rubyforge_project: dripdrop
163
+ rubygems_version: 1.6.0
139
164
  signing_key:
140
165
  specification_version: 3
141
166
  summary: Evented framework for ZeroMQ and EventMachine Apps.
142
- test_files:
143
- - spec/gimite-websocket.rb
144
- - spec/message_spec.rb
145
- - spec/node/http_spec.rb
146
- - spec/node/nodelet_spec.rb
147
- - spec/node/routing_spec.rb
148
- - spec/node/websocket_spec.rb
149
- - spec/node/zmq_m2_spec.rb
150
- - spec/node/zmq_pushpull_spec.rb
151
- - spec/node/zmq_xrepxreq_spec.rb
152
- - spec/node_spec.rb
153
- - spec/spec_helper.rb
167
+ test_files: []
168
+
data/VERSION DELETED
@@ -1 +0,0 @@
1
- 0.10.0.beta2