Sha256: 6e8227f39dc08f2c438d498041d32d3b6c8783b224f6e89e2cf57ae11619c902

Contents?: true

Size: 599 Bytes

Versions: 8

Compression:

Stored size: 599 Bytes

Contents

# encoding: utf-8
require "logstash/version"
require "gems"

# This module allow this plugin to work with the v1 API.
module LogStash::CompatibilityLayerApiV1
  LOGSTASH_CORE_VERSION = Gem::Version.new(LOGSTASH_VERSION)
  V2_VERSION = Gem::Version.new("2.0.0.beta2")

  def self.included(base)
    base.send(:include, InstanceMethods) if self.is_v1?
  end

  def self.is_v1?
    LOGSTASH_CORE_VERSION < V2_VERSION
  end
  
  # This allow this plugin to work both in V1 and v2 of logstash-core
  module InstanceMethods
    def stop?
      false
    end

    def teardown
      stop
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
logstash-input-beats-0.9.6 lib/logstash/compatibility_layer_api_v1.rb
logstash-input-beats-0.9.5 lib/logstash/compatibility_layer_api_v1.rb
logstash-input-beats-0.9.4 lib/logstash/compatibility_layer_api_v1.rb
logstash-input-beats-0.9.3 lib/logstash/compatibility_layer_api_v1.rb
logstash-input-beats-0.9.2 lib/logstash/compatibility_layer_api_v1.rb
logstash-input-beats-0.9.1 lib/logstash/compatibility_layer_api_v1.rb
logstash-input-beats-0.9 lib/logstash/compatibility_layer_api_v1.rb
logstash-input-beats-0.9.beta1 lib/logstash/compatibility_layer_api_v1.rb