Sha256: d3bc18f42d6586c8a6e894e3bd94bcfd203bd053b2af2b03179afffc347653b7

Contents?: true

Size: 464 Bytes

Versions: 19

Compression:

Stored size: 464 Bytes

Contents

#!/usr/bin/env ruby
# encoding: UTF-8
# (c) ANB Andrew Bizyaev

require 'rbconfig'

# foto tools
module Utils
  # determine OS
  def self.os(os_string = RbConfig::CONFIG['host_os'])
    case os_string
    when /darwin/i then :macosx
    when /linux/i then :linux
    when /mswin|mingw|w32/i then :windows
    else :unknown
    end
  end

  # OS specific output implementation
  class OS
    def output(message)
      STDOUT.puts prepare(message)
    end
  end
end

Version data entries

19 entries across 19 versions & 1 rubygems

Version Path
phtools-0.18.0 lib/phtools/utils/os.rb
phtools-0.17.0 lib/phtools/utils/os.rb
phtools-0.16.1 lib/phtools/utils/os.rb
phtools-0.16.0 lib/phtools/utils/os.rb
phtools-0.15.1 lib/phtools/utils/os.rb
phtools-0.15.0 lib/phtools/utils/os.rb
phtools-0.14.0 lib/phtools/utils/os.rb
phtools-0.11.2 lib/phtools/utils/os.rb
phtools-0.11.1 lib/phtools/utils/os.rb
phtools-0.10.0 lib/phtools/utils/os.rb
phtools-0.8.1 lib/phtools/utils/os.rb
phtools-0.8.0 lib/phtools/utils/os.rb
phtools-0.7.7 lib/phtools/utils/os.rb
phtools-0.7.1 lib/phtools/utils/os.rb
phtools-0.6.0 lib/phtools/utils/os.rb
phtools-0.4.0 lib/phtools/utils/os.rb
phtools-0.3.0 lib/phtools/utils/os.rb
phtools-0.3.0.pre.alpha lib/phtools/utils/os.rb
phtools-0.2.4 lib/phtools/utils/os.rb