Sha256: e5855446d9eb96566b3488515d6c1f83f56a8dc4302ca4240debf2d88b6a2ecb

Contents?: true

Size: 1.93 KB

Versions: 8

Compression:

Stored size: 1.93 KB

Contents

# encoding: binary
#  Phusion Passenger - https://www.phusionpassenger.com/
#  Copyright (c) 2010-2017 Phusion Holding B.V.
#
#  "Passenger", "Phusion Passenger" and "Union Station" are registered
#  trademarks of Phusion Holding B.V.
#
#  Permission is hereby granted, free of charge, to any person obtaining a copy
#  of this software and associated documentation files (the "Software"), to deal
#  in the Software without restriction, including without limitation the rights
#  to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
#  copies of the Software, and to permit persons to whom the Software is
#  furnished to do so, subject to the following conditions:
#
#  The above copyright notice and this permission notice shall be included in
#  all copies or substantial portions of the Software.
#
#  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
#  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
#  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
#  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
#  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
#  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
#  THE SOFTWARE.

PhusionPassenger.require_passenger_lib 'platform_info'
PhusionPassenger.require_passenger_lib 'platform_info/operating_system'

module PhusionPassenger

  module PlatformInfo
    # Autodetects the current MacOS distribution and return a number of identifier tags.
    # The first tag identifies the distribution while the other tags indicate which
    # distributions it is likely compatible with.
    # Returns nil if the operating system is not MacOS.
    def self.macos_version
      if os_name_simple != "macosx"
        return nil
      end
      `sw_vers -productVersion | cut -d '.' -f 2,3`.to_f
    end
    memoize :macos_version
  end

end # PhusionPassenger

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
passenger-5.1.10 src/ruby_supportlib/phusion_passenger/platform_info/macos.rb
passenger-5.1.9 src/ruby_supportlib/phusion_passenger/platform_info/macos.rb
passenger-5.1.8 src/ruby_supportlib/phusion_passenger/platform_info/macos.rb
passenger-5.1.7 src/ruby_supportlib/phusion_passenger/platform_info/macos.rb
passenger-5.1.6 src/ruby_supportlib/phusion_passenger/platform_info/macos.rb
passenger-5.1.5 src/ruby_supportlib/phusion_passenger/platform_info/macos.rb
passenger-5.1.4 src/ruby_supportlib/phusion_passenger/platform_info/macos.rb
passenger-5.1.3 src/ruby_supportlib/phusion_passenger/platform_info/macos.rb