Sha256: 691e36e87a61369fb68264a578cca675f880345fa36c5f85ccb8008992fac3ab

Contents?: true

Size: 544 Bytes

Versions: 13

Compression:

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

13 entries across 13 versions & 1 rubygems

Version Path
git_reflow-0.8.6 lib/git_reflow/os_detector.rb
git_reflow-0.8.4 lib/git_reflow/os_detector.rb
git_reflow-0.8.3 lib/git_reflow/os_detector.rb
git_reflow-0.8.2 lib/git_reflow/os_detector.rb
git_reflow-0.8.1 lib/git_reflow/os_detector.rb
git_reflow-0.8.0 lib/git_reflow/os_detector.rb
git_reflow-0.7.5 lib/git_reflow/os_detector.rb
git_reflow-0.7.4 lib/git_reflow/os_detector.rb
git_reflow-0.7.2 lib/git_reflow/os_detector.rb
git_reflow-0.7.1 lib/git_reflow/os_detector.rb
git_reflow-0.7.0 lib/git_reflow/os_detector.rb
git_reflow-0.6.7 lib/git_reflow/os_detector.rb
git_reflow-0.6.6 lib/git_reflow/os_detector.rb