Sha256: 748f5470a7706f225f2c5142e28f0733622ba076dbc7fd533453a18abf07b82c

Contents?: true

Size: 567 Bytes

Versions: 3

Compression:

Stored size: 567 Bytes

Contents

# Thanks to http://stackoverflow.com/questions/170956/how-can-i-find-which-operating-system-my-ruby-program-is-running-on
# and to Thoughtbot: https://github.com/thoughtbot/cocaine/blob/master/lib/cocaine/os_detector.rb
module GitReflow
  class OSDetector
    def windows?
      (/cygwin|mswin|mingw|bccwin|wince|emx/ =~ RUBY_PLATFORM) != nil
    end

    def mac?
      (/darwin/ =~ RUBY_PLATFORM) != nil
    end

    def unix?
      !OS.windows?
    end

    def linux?
      OS.unix? and not OS.mac?
    end
  end

  OS = OSDetector.new
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
git_reflow-0.8.9 lib/git_reflow/os_detector.rb
git_reflow-0.8.8 lib/git_reflow/os_detector.rb
git_reflow-0.8.7 lib/git_reflow/os_detector.rb