ruby_events 0.0.7 → 0.0.8

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. data/README.markdown +1 -5
  2. data/Rakefile +1 -2
  3. data/lib/ruby_events.rb +2 -2
  4. metadata +9 -4
data/README.markdown CHANGED
@@ -79,11 +79,7 @@ Effectively, you can use the events as callbacks on any method:
79
79
 
80
80
  a.events.fire_on_method(:merge, :merged)
81
81
  a.events.listen(:merged) do |items|
82
- # This is the hard part: because the items variable is actually just an
83
- # array of all variables passed to the function that fired the event,
84
- # you need to access the argument you're interested in; in this case,
85
- # Hash.merge only takes one argument, and we'll be using it.
86
- items[0][:three] = 3
82
+ items[:three] = 3
87
83
  puts 'The hash will have the extra item.'
88
84
  items
89
85
  end
data/Rakefile CHANGED
@@ -1,7 +1,6 @@
1
1
  #
2
2
  # To change this template, choose Tools | Templates
3
3
  # and open the template in the editor.
4
-
5
4
 
6
5
  require 'rubygems'
7
6
  require 'rake'
@@ -12,7 +11,7 @@ require 'rake/testtask'
12
11
 
13
12
  spec = Gem::Specification.new do |s|
14
13
  s.name = 'ruby_events'
15
- s.version = '0.0.7'
14
+ s.version = '0.0.8'
16
15
  s.has_rdoc = true
17
16
  s.extra_rdoc_files = ['README.markdown']
18
17
  s.summary = 'A really simple event implementation that hooks into the Object class. Now all your objects can join in the fun of firing events!'
data/lib/ruby_events.rb CHANGED
@@ -9,7 +9,7 @@ module RubyEvents
9
9
  class Events
10
10
  # The current version of RubyEvents.
11
11
  def self.version
12
- '0.0.7'
12
+ '0.0.8'
13
13
  end
14
14
 
15
15
  # Initialize the events class by instantiating the class methods we'll be
@@ -36,7 +36,7 @@ module RubyEvents
36
36
  # arguments as provided.
37
37
  def fire(event_type, *arguments)
38
38
  @events[event_type].each do |event|
39
- event.call arguments
39
+ event.call(*arguments)
40
40
  end if event_is_defined(event_type)
41
41
  end
42
42
 
metadata CHANGED
@@ -1,12 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ruby_events
3
3
  version: !ruby/object:Gem::Version
4
+ hash: 15
4
5
  prerelease: false
5
6
  segments:
6
7
  - 0
7
8
  - 0
8
- - 7
9
- version: 0.0.7
9
+ - 8
10
+ version: 0.0.8
10
11
  platform: ruby
11
12
  authors:
12
13
  - Nathan Kleyn
@@ -14,7 +15,7 @@ autorequire:
14
15
  bindir: bin
15
16
  cert_chain: []
16
17
 
17
- date: 2010-05-16 00:00:00 +01:00
18
+ date: 2010-05-18 00:00:00 +01:00
18
19
  default_executable:
19
20
  dependencies: []
20
21
 
@@ -40,23 +41,27 @@ rdoc_options: []
40
41
  require_paths:
41
42
  - lib
42
43
  required_ruby_version: !ruby/object:Gem::Requirement
44
+ none: false
43
45
  requirements:
44
46
  - - ">="
45
47
  - !ruby/object:Gem::Version
48
+ hash: 3
46
49
  segments:
47
50
  - 0
48
51
  version: "0"
49
52
  required_rubygems_version: !ruby/object:Gem::Requirement
53
+ none: false
50
54
  requirements:
51
55
  - - ">="
52
56
  - !ruby/object:Gem::Version
57
+ hash: 3
53
58
  segments:
54
59
  - 0
55
60
  version: "0"
56
61
  requirements: []
57
62
 
58
63
  rubyforge_project:
59
- rubygems_version: 1.3.6
64
+ rubygems_version: 1.3.7
60
65
  signing_key:
61
66
  specification_version: 3
62
67
  summary: A really simple event implementation that hooks into the Object class. Now all your objects can join in the fun of firing events!