Sha256: ead4869b4df38604dab9275af4f6689720d7662f724e8011f51a51c72a3ecd0e

Contents?: true

Size: 531 Bytes

Versions: 7

Compression:

Stored size: 531 Bytes

Contents

# frozen_string_literal: true

require_relative "../appmatcher"

module Fusuma
  module Plugin
    module Inputs
      # Get active application's name
      class AppmatcherInput < Input
        attr_reader :pid

        def io
          @backend ||= Appmatcher.backend_klass.new

          @pid ||= begin
            pid = @backend.watch_start
            # NOTE: Closing the parent process's pipe
            @backend.writer.close

            pid
          end

          @backend.reader
        end
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
fusuma-plugin-appmatcher-0.4.0 lib/fusuma/plugin/inputs/appmatcher_input.rb
fusuma-plugin-appmatcher-0.3.1 lib/fusuma/plugin/inputs/appmatcher_input.rb
fusuma-plugin-appmatcher-0.3.0 lib/fusuma/plugin/inputs/appmatcher_input.rb
fusuma-plugin-appmatcher-0.2.3 lib/fusuma/plugin/inputs/appmatcher_input.rb
fusuma-plugin-appmatcher-0.2.2 lib/fusuma/plugin/inputs/appmatcher_input.rb
fusuma-plugin-appmatcher-0.2.1 lib/fusuma/plugin/inputs/appmatcher_input.rb
fusuma-plugin-appmatcher-0.2.0 lib/fusuma/plugin/inputs/appmatcher_input.rb