tap icon indicating copy to clipboard operation
tap copied to clipboard

match_platform must be updated

Open thinkerbot opened this issue 15 years ago • 0 comments

http://bka-bonn.de/wordpress/index.php/2009/06/01/determine-os-with-ruby/ (see comments)

require ‘rbconfig’
puts RbConfig::CONFIG[’target_os’]
=> “linux”

This is where the update needs to happen.

def match_platform?(*platforms)
      platforms.each do |platform|
        platform.to_s =~ /^(non_)?(.*)/

        non = true if $1
        match_platform = !RUBY_PLATFORM.index($2).nil?
        return false unless (non && !match_platform) || (!non && match_platform)
      end

      true
    end

thinkerbot avatar Nov 04 '09 16:11 thinkerbot