Sha256: 08206fffd6c711c59f03d47e1580b1c68782ebe70ac33cab5442ac2e906279ed

Contents?: true

Size: 524 Bytes

Versions: 3

Compression:

Stored size: 524 Bytes

Contents

require 'rbconfig'

module Maid::Platform
  class << self
    def host_os
      RbConfig::CONFIG['host_os']
    end

    def linux?
      !!(host_os =~ /linux/i)
    end

    def osx?
      !!(host_os =~ /darwin/i)
    end

    def has_tag_available?
      osx? && system('which -s tag')
    end
  end

  # Commands based on OS type
  class Commands
    class << self
      # logicaly decides which locate command to use
      def locate
        Maid::Platform.linux? ? 'locate' : 'mdfind -name'
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
maid-0.10.0 lib/maid/platform.rb
maid-0.10.0.pre.alpha.3 lib/maid/platform.rb
maid-0.10.0.pre.alpha.2 lib/maid/platform.rb