Sha256: 575a0ea1409121abec1bd9d86c288ae7edfd68a99014144c1d30aa619e598880

Contents?: true

Size: 453 Bytes

Versions: 22

Compression:

Stored size: 453 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

22 entries across 22 versions & 5 rubygems

Version Path
aslakhellesoy-cucumber-0.1.13.2 lib/cucumber/broadcaster.rb
aslakhellesoy-cucumber-0.1.13.3 lib/cucumber/broadcaster.rb
aslakhellesoy-cucumber-0.1.13 lib/cucumber/broadcaster.rb
aslakhellesoy-cucumber-0.1.14.1 lib/cucumber/broadcaster.rb
aslakhellesoy-cucumber-0.1.14.2 lib/cucumber/broadcaster.rb
aslakhellesoy-cucumber-0.1.15 lib/cucumber/broadcaster.rb
aslakhellesoy-cucumber-0.1.16.1 lib/cucumber/broadcaster.rb
aslakhellesoy-cucumber-0.1.16.2 lib/cucumber/broadcaster.rb
aslakhellesoy-cucumber-0.1.16.3 lib/cucumber/broadcaster.rb
aslakhellesoy-cucumber-0.1.16.4 lib/cucumber/broadcaster.rb
aslakhellesoy-cucumber-0.1.16 lib/cucumber/broadcaster.rb
bts-cucumber-0.1.13.1 lib/cucumber/broadcaster.rb
bts-cucumber-0.1.13.2 lib/cucumber/broadcaster.rb
bts-cucumber-0.1.13.3 lib/cucumber/broadcaster.rb
kosmas58-cucumber-0.1.16.5 lib/cucumber/broadcaster.rb
kosmas58-cucumber-0.1.16.6 lib/cucumber/broadcaster.rb
cucumber-0.1.14 lib/cucumber/broadcaster.rb
cucumber-0.1.13 lib/cucumber/broadcaster.rb
cucumber-0.1.15 lib/cucumber/broadcaster.rb
cucumber-0.1.16 lib/cucumber/broadcaster.rb