event_emitter 0.0.5 → 0.0.6
Sign up to get free protection for your applications and to get access to all the features.
- data/History.txt +4 -0
- data/Manifest.txt +1 -0
- data/lib/event_emitter.rb +1 -1
- data/samples/class-method.rb +17 -0
- metadata +4 -3
data/History.txt
CHANGED
data/Manifest.txt
CHANGED
data/lib/event_emitter.rb
CHANGED
@@ -0,0 +1,17 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
$:.unshift File.expand_path '../lib', File.dirname(__FILE__)
|
3
|
+
require 'event_emitter'
|
4
|
+
|
5
|
+
class DB
|
6
|
+
def self.connect
|
7
|
+
self.emit :connect, :connected
|
8
|
+
end
|
9
|
+
end
|
10
|
+
|
11
|
+
EventEmitter.apply DB
|
12
|
+
|
13
|
+
DB.on :connect do |status|
|
14
|
+
puts status
|
15
|
+
end
|
16
|
+
|
17
|
+
DB.connect
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: event_emitter
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.6
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-11-
|
12
|
+
date: 2012-11-08 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rdoc
|
@@ -78,6 +78,7 @@ files:
|
|
78
78
|
- Rakefile
|
79
79
|
- lib/event_emitter.rb
|
80
80
|
- lib/event_emitter/emitter.rb
|
81
|
+
- samples/class-method.rb
|
81
82
|
- samples/instance-specific-method.rb
|
82
83
|
- samples/sample.rb
|
83
84
|
- script/console
|
@@ -103,7 +104,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
103
104
|
version: '0'
|
104
105
|
segments:
|
105
106
|
- 0
|
106
|
-
hash: -
|
107
|
+
hash: -270454799598392079
|
107
108
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
108
109
|
none: false
|
109
110
|
requirements:
|