Skip to content

match_platform must be updated #12

@thinkerbot

Description

@thinkerbot

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions