Sha256: ea6628ac1bb0ea94e11fbd92bc0a6e4b04d7ce83898840c81ca2adbdec7a680c

Contents?: true

Size: 536 Bytes

Versions: 1

Compression:

Stored size: 536 Bytes

Contents

module DaemonOgre

  module DARGV
    class << self

      def check_args_for( *args )
        args = args.map(&:to_s)
        return ::ARGV.any?{|argument| args.any?{|string_to_find| argument =~ Regexp.new(string_to_find.to_s)  }}
      end

      @@daemon_keys= [:daemonize,:daemon,:d]
      def daemonize?
        check_args_for( *@@daemon_keys )
      end
      alias :daemon? :daemonize?

      @@terminate_keys= [:terminate,:kill,:k]
      def terminate?
        check_args_for( *@@terminate_keys )
      end

    end
  end

end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
daemon-ogre-2.1.2 lib/daemon-ogre/argv.rb