Sha256: 7ba7b0b977b7d70b06384bd5e023199c0073664bb0723093503b64f70469ea7a

Contents?: true

Size: 569 Bytes

Versions: 3

Compression:

Stored size: 569 Bytes

Contents

module PairSee
  class ActiveDevs
    attr_reader :devs

    def initialize(log_lines, options)
      @log_lines = log_lines
      @options = options
      @devs = _active(options[:names])
    end

    def active_devs(config_file)
      config = YAML.load_file(config_file)
      devs_in_config = config['names'].split(' ')
      devs_in_config.select do |dev|
        _is_active?(dev)
      end
    end

    def _active(devs)
      devs.select do |dev|
        _is_active?(dev)
      end
    end

    def _is_active?(dev)
      @log_lines.active? dev
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
pair_see-0.1.5 lib/pair_see/active_devs.rb
pair_see-0.1.4 lib/pair_see/active_devs.rb
pair_see-0.1.3 lib/pair_see/active_devs.rb