Sha256: 697c1968f596589c44adb057b74072207f7e685dbd4a78cd339a8df3adffa4ac

Contents?: true

Size: 761 Bytes

Versions: 10

Compression:

Stored size: 761 Bytes

Contents

module StartingBlocks
  module Publisher
    class << self
      attr_accessor :subscribers, :result_parser

      def publish_results results
        return unless @subscribers
        @subscribers.each do |s| 
          parsed_results = StartingBlocks::Publisher.result_parser.parse(results)
          begin
            s.receive_results parsed_results
          rescue
          end
        end
      end

      def publish_specs_to_run specs
        return unless @subscribers
        @subscribers.each do |s| 
          begin
            s.receive_specs_to_run specs
          rescue
          end
        end
      end
    end
  end
end
StartingBlocks::Publisher.subscribers = []
StartingBlocks::Publisher.result_parser = StartingBlocks::ResultParser.new

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
starting_blocks-0.0.18 lib/starting_blocks/publisher.rb
starting_blocks-0.0.17 lib/starting_blocks/publisher.rb
starting_blocks-0.0.16 lib/starting_blocks/publisher.rb
starting_blocks-0.0.15 lib/starting_blocks/publisher.rb
starting_blocks-0.0.14 lib/starting_blocks/publisher.rb
starting_blocks-0.0.13 lib/starting_blocks/publisher.rb
starting_blocks-0.0.12 lib/starting_blocks/publisher.rb
starting_blocks-0.0.11 lib/starting_blocks/publisher.rb
starting_blocks-0.0.10 lib/starting_blocks/publisher.rb
starting_blocks-0.0.9 lib/starting_blocks/publisher.rb