Sha256: 1b01942b7e3750348f9f3af4c707b035fb010fc8c81be1384ce4bdd37ec4f4d2

Contents?: true

Size: 452 Bytes

Versions: 10

Compression:

Stored size: 452 Bytes

Contents

module Cucumber
  class Broadcaster

    def initialize(receivers = [])
      @receivers = receivers
    end

    def register(receiver)
      @receivers << receiver
    end

    def method_missing(method_name, *args)
      @receivers.each  do |receiver|
        r = (receiver == STDOUT) ? Kernel: receiver # Needed to make colors work on Windows
        r.__send__(method_name, *args) if receiver.respond_to?(method_name)
      end
    end

  end
end

Version data entries

10 entries across 10 versions & 3 rubygems

Version Path
aslakhellesoy-cucumber-0.1.10 lib/cucumber/broadcaster.rb
aslakhellesoy-cucumber-0.1.11 lib/cucumber/broadcaster.rb
aslakhellesoy-cucumber-0.1.12 lib/cucumber/broadcaster.rb
aslakhellesoy-cucumber-0.1.9 lib/cucumber/broadcaster.rb
jeffrafter-cucumber-0.1.10 lib/cucumber/broadcaster.rb
jeffrafter-cucumber-0.1.12 lib/cucumber/broadcaster.rb
cucumber-0.1.10 lib/cucumber/broadcaster.rb
cucumber-0.1.12 lib/cucumber/broadcaster.rb
cucumber-0.1.11 lib/cucumber/broadcaster.rb
cucumber-0.1.9 lib/cucumber/broadcaster.rb