Sha256: 9d8f52ca1c97163a5c3a7a9d5d5a990b662b9a0554c58f206fe549972910995b

Contents?: true

Size: 452 Bytes

Versions: 28

Compression:

Stored size: 452 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

  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

28 entries across 28 versions & 1 rubygems

Version Path
maid-0.8.0.alpha.2 lib/maid/platform.rb
maid-0.8.0.alpha.1 lib/maid/platform.rb
maid-0.7.0 lib/maid/platform.rb
maid-0.7.0.beta.1 lib/maid/platform.rb
maid-0.7.0.alpha.4 lib/maid/platform.rb
maid-0.7.0.alpha.2 lib/maid/platform.rb
maid-0.7.0.alpha.1 lib/maid/platform.rb
maid-0.6.1 lib/maid/platform.rb
maid-0.6.1.alpha.1 lib/maid/platform.rb
maid-0.6.0 lib/maid/platform.rb
maid-0.6.0.beta.2 lib/maid/platform.rb
maid-0.6.0.beta.1 lib/maid/platform.rb
maid-0.6.0.alpha.6 lib/maid/platform.rb
maid-0.6.0.alpha.5 lib/maid/platform.rb
maid-0.6.0.alpha.4 lib/maid/platform.rb
maid-0.6.0.alpha.3 lib/maid/platform.rb
maid-0.6.0.alpha.2 lib/maid/platform.rb
maid-0.6.0.alpha.1 lib/maid/platform.rb
maid-0.5.0 lib/maid/platform.rb
maid-0.4.2 lib/maid/platform.rb