lib/faye-rails/controller/channel.rb in faye-rails-2.0.0 vs lib/faye-rails/controller/channel.rb in faye-rails-2.0.1

- old
+ new

@@ -23,11 +23,11 @@ FayeRails.server(endpoint).bind(event) do |*args| Monitor.new.tap do |m| m.client_id = args.shift m.channel = args.shift m.data = args.shift - m.instance_eval(&block) if File.fnmatch(channel, m.channel) + m.instance_eval(&block) if FayeRails::Matcher.match? channel, m.channel end end end def filter(direction=:any, &block) @@ -38,11 +38,11 @@ filter end def subscribe(&block) EM.schedule do - @subscription = FayeRails.client(endpoint).subscribe(channel) do |message| + FayeRails.client(endpoint).subscribe(channel) do |message| Message.new.tap do |m| m.message = message m.channel = channel m.instance_eval(&block) end @@ -50,10 +50,10 @@ end end def unsubscribe EM.schedule do - FayeRails.client(endpoint).unsubscribe(@subscription) + FayeRails.client(endpoint).unsubscribe(channel) end end end end