Sha256: 331f0582d54aea994a18b850b4a74a39f53580d97bdee5680b61cf89fc8b4616

Contents?: true

Size: 761 Bytes

Versions: 32

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_files_to_run files
        return unless @subscribers
        @subscribers.each do |s| 
          begin
            s.receive_files_to_run files
          rescue
          end
        end
      end
    end
  end
end
StartingBlocks::Publisher.subscribers = []
StartingBlocks::Publisher.result_parser = StartingBlocks::ResultParser.new

Version data entries

32 entries across 32 versions & 1 rubygems

Version Path
starting_blocks-1.2.1 lib/starting_blocks/publisher.rb
starting_blocks-1.2.0 lib/starting_blocks/publisher.rb
starting_blocks-1.1.3 lib/starting_blocks/publisher.rb
starting_blocks-1.1.2 lib/starting_blocks/publisher.rb
starting_blocks-1.1.1 lib/starting_blocks/publisher.rb
starting_blocks-1.1.0 lib/starting_blocks/publisher.rb
starting_blocks-1.0.0 lib/starting_blocks/publisher.rb
starting_blocks-0.7.0 lib/starting_blocks/publisher.rb
starting_blocks-0.6.1 lib/starting_blocks/publisher.rb
starting_blocks-0.6.0 lib/starting_blocks/publisher.rb
starting_blocks-0.5.2 lib/starting_blocks/publisher.rb
starting_blocks-0.5.1 lib/starting_blocks/publisher.rb
starting_blocks-0.5.0 lib/starting_blocks/publisher.rb
starting_blocks-0.4.0 lib/starting_blocks/publisher.rb
starting_blocks-0.3.1 lib/starting_blocks/publisher.rb
starting_blocks-0.2.1 lib/starting_blocks/publisher.rb
starting_blocks-0.1.1 lib/starting_blocks/publisher.rb
starting_blocks-0.1.0 lib/starting_blocks/publisher.rb
starting_blocks-0.0.32 lib/starting_blocks/publisher.rb
starting_blocks-0.0.31 lib/starting_blocks/publisher.rb