Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

match_platform must be updated #12

Open
thinkerbot opened this issue Nov 4, 2009 · 0 comments
Open

match_platform must be updated #12

thinkerbot opened this issue Nov 4, 2009 · 0 comments

Comments

@thinkerbot
Copy link
Owner

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant