Parent

RText::Frontend::ConnectorManager

Constants

ConnectorDesc

Public Class Methods

new(options={}) click to toggle source
# File lib/rtext/frontend/connector_manager.rb, line 10
def initialize(options={})
  @logger = options[:logger]
  @connector_descs = {}
  @connector_listener = options[:connect_callback]
  @keep_outfile = options[:keep_outfile]
  @outfile_provider = options[:outfile_provider]
  @connection_timeout = options[:connection_timeout]
end

Public Instance Methods

all_connectors() click to toggle source
# File lib/rtext/frontend/connector_manager.rb, line 43
def all_connectors
  @connector_descs.values.collect{|v| v.connector}
end
connector_for_file(file) click to toggle source
# File lib/rtext/frontend/connector_manager.rb, line 21
def connector_for_file(file)
  config = Config.find_service_config(file)
  if config
    file_pattern = Config.file_pattern(file)
    key = desc_key(config, file_pattern)
    desc = @connector_descs[key]
    if desc
      if desc.checksum == config_checksum(config)
        desc.connector
      else
        # connector must be replaced
        desc.connector.stop
        create_connector(config, file_pattern) 
      end
    else
      create_connector(config, file_pattern)
    end
  else
    nil
  end
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.