Sha256: c8b5417d55b50b7c5b229fcccc17f7a8daaf68a205625957d8e924d3a724508f

Contents?: true

Size: 524 Bytes

Versions: 5

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

5 entries across 5 versions & 1 rubygems

Version Path
maid-0.10.0.pre.alpha.1 lib/maid/platform.rb
maid-0.9.0.alpha.2 lib/maid/platform.rb
maid-0.9.0.alpha.1 lib/maid/platform.rb
maid-0.8.0.alpha.4 lib/maid/platform.rb
maid-0.8.0.alpha.3 lib/maid/platform.rb