Myoldmopar/decent_ci

View on GitHub
docs/top-level-namespace.html

Summary

Maintainability
Test Coverage
<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>
  Top Level Namespace
  
    &mdash; Documentation by YARD 0.9.19
  
</title>

  <link rel="stylesheet" href="css/style.css" type="text/css" charset="utf-8" />

  <link rel="stylesheet" href="css/common.css" type="text/css" charset="utf-8" />

<script type="text/javascript" charset="utf-8">
  pathId = "";
  relpath = '';
</script>


  <script type="text/javascript" charset="utf-8" src="js/jquery.js"></script>

  <script type="text/javascript" charset="utf-8" src="js/app.js"></script>


  </head>
  <body>
    <div class="nav_wrap">
      <iframe id="nav" src="class_list.html?1"></iframe>
      <div id="resizer"></div>
    </div>

    <div id="main" tabindex="-1">
      <div id="header">
        <div id="menu">
  
    <a href="_index.html">Index</a> &raquo;
    
    
    <span class="title">Top Level Namespace</span>
  
</div>

        <div id="search">
  
    <a class="full_list_link" id="class_list_link"
        href="class_list.html">

        <svg width="24" height="24">
          <rect x="0" y="4" width="24" height="4" rx="1" ry="1"></rect>
          <rect x="0" y="12" width="24" height="4" rx="1" ry="1"></rect>
          <rect x="0" y="20" width="24" height="4" rx="1" ry="1"></rect>
        </svg>
    </a>
  
</div>
        <div class="clear"></div>
      </div>

      <div id="content"><h1>Top Level Namespace
  
  
  
</h1>
<div class="box_info">
  

  
  
  
  
  

  

  
</div>

<h2>Defined Under Namespace</h2>
<p class="children">
  
    
      <strong class="modules">Modules:</strong> <span class='object_link'><a href="CMake.html" title="CMake (module)">CMake</a></span>, <span class='object_link'><a href="Configuration.html" title="Configuration (module)">Configuration</a></span>, <span class='object_link'><a href="Lcov.html" title="Lcov (module)">Lcov</a></span>, <span class='object_link'><a href="ResultsProcessor.html" title="ResultsProcessor (module)">ResultsProcessor</a></span>, <span class='object_link'><a href="Runners.html" title="Runners (module)">Runners</a></span>
    
  
    
      <strong class="classes">Classes:</strong> <span class='object_link'><a href="Build.html" title="Build (class)">Build</a></span>, <span class='object_link'><a href="CMakeBuildArgs.html" title="CMakeBuildArgs (class)">CMakeBuildArgs</a></span>, <span class='object_link'><a href="CannotMatchCompiler.html" title="CannotMatchCompiler (class)">CannotMatchCompiler</a></span>, <span class='object_link'><a href="CodeMessage.html" title="CodeMessage (class)">CodeMessage</a></span>, <span class='object_link'><a href="DecentCIKnownError.html" title="DecentCIKnownError (class)">DecentCIKnownError</a></span>, <span class='object_link'><a href="NoDecentCIFiles.html" title="NoDecentCIFiles (class)">NoDecentCIFiles</a></span>, <span class='object_link'><a href="PotentialBuild.html" title="PotentialBuild (class)">PotentialBuild</a></span>, <span class='object_link'><a href="TestMessage.html" title="TestMessage (class)">TestMessage</a></span>, <span class='object_link'><a href="TestResult.html" title="TestResult (class)">TestResult</a></span>
    
  
</p>







  
    <h2>
      Instance Method Summary
      <small><a href="#" class="summary_toggle">collapse</a></small>
    </h2>

    <ul class="summary">
      
        <li class="public ">
  <span class="summary_signature">
    
      <a href="top-level-namespace.html#github_check_rate_limit-instance_method" title="#github_check_rate_limit (instance method)">#<strong>github_check_rate_limit</strong>(headers)  &#x21d2; Object </a>
    

    
  </span>
  
  
  
  
  
  
  

  
    <span class="summary_desc"><div class='inline'></div></span>
  
</li>

      
        <li class="public ">
  <span class="summary_signature">
    
      <a href="top-level-namespace.html#github_query-instance_method" title="#github_query (instance method)">#<strong>github_query</strong>(client, num_retries = 2)  &#x21d2; Object </a>
    

    
  </span>
  
  
  
  
  
  
  

  
    <span class="summary_desc"><div class='inline'></div></span>
  
</li>

      
        <li class="public ">
  <span class="summary_signature">
    
      <a href="top-level-namespace.html#processor_count-instance_method" title="#processor_count (instance method)">#<strong>processor_count</strong>  &#x21d2; Object </a>
    

    
  </span>
  
  
  
  
  
  
  

  
    <span class="summary_desc"><div class='inline'></div></span>
  
</li>

      
    </ul>
  



  <div id="instance_method_details" class="method_details_list">
    <h2>Instance Method Details</h2>

    
      <div class="method_details first">
  <h3 class="signature first" id="github_check_rate_limit-instance_method">
  
    #<strong>github_check_rate_limit</strong>(headers)  &#x21d2; <tt>Object</tt> 
  

  

  
</h3><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File 'lib/github.rb', line 3</span>

<span class='kw'>def</span> <span class='id identifier rubyid_github_check_rate_limit'>github_check_rate_limit</span><span class='lparen'>(</span><span class='id identifier rubyid_headers'>headers</span><span class='rparen'>)</span>
  <span class='id identifier rubyid_rate_limit'>rate_limit</span> <span class='op'>=</span> <span class='id identifier rubyid_headers'>headers</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>x-ratelimit-limit</span><span class='tstring_end'>&#39;</span></span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_to_i'>to_i</span>
  <span class='id identifier rubyid_rate_limit_remaining'>rate_limit_remaining</span> <span class='op'>=</span> <span class='id identifier rubyid_headers'>headers</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>x-ratelimit-remaining</span><span class='tstring_end'>&#39;</span></span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_to_i'>to_i</span>
  <span class='id identifier rubyid_rate_limit_reset'>rate_limit_reset</span> <span class='op'>=</span> <span class='id identifier rubyid_headers'>headers</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>x-ratelimit-reset</span><span class='tstring_end'>&#39;</span></span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_to_i'>to_i</span>
  <span class='id identifier rubyid_rate_limit_start'>rate_limit_start</span> <span class='op'>=</span> <span class='id identifier rubyid_rate_limit_reset'>rate_limit_reset</span> <span class='op'>-</span> <span class='int'>60</span> <span class='op'>*</span> <span class='int'>60</span> <span class='comment'># 60 minutes in seconds
</span>
  <span class='id identifier rubyid_t'>t</span> <span class='op'>=</span> <span class='const'>Time</span><span class='period'>.</span><span class='id identifier rubyid_now'>now</span>
  <span class='id identifier rubyid_t'>t</span><span class='period'>.</span><span class='id identifier rubyid_utc'>utc</span>
  <span class='id identifier rubyid_rate_limit_current_time'>rate_limit_current_time</span> <span class='op'>=</span> <span class='id identifier rubyid_t'>t</span><span class='period'>.</span><span class='id identifier rubyid_to_i'>to_i</span>

  <span class='id identifier rubyid_burn_rate_queries_per_second'>burn_rate_queries_per_second</span> <span class='op'>=</span> <span class='lparen'>(</span><span class='id identifier rubyid_rate_limit'>rate_limit</span> <span class='op'>-</span> <span class='id identifier rubyid_rate_limit_remaining'>rate_limit_remaining</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_to_f'>to_f</span> <span class='op'>/</span> <span class='lparen'>(</span><span class='id identifier rubyid_rate_limit_current_time'>rate_limit_current_time</span> <span class='op'>-</span> <span class='id identifier rubyid_rate_limit_start'>rate_limit_start</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_to_f'>to_f</span>
  <span class='id identifier rubyid_burn_rate_queries_per_hour'>burn_rate_queries_per_hour</span> <span class='op'>=</span> <span class='id identifier rubyid_burn_rate_queries_per_second'>burn_rate_queries_per_second</span> <span class='op'>*</span> <span class='int'>60</span> <span class='op'>*</span> <span class='int'>60</span>

  <span class='gvar'>$logger</span><span class='period'>.</span><span class='id identifier rubyid_info'>info</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>ratelimit </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_rate_limit'>rate_limit</span><span class='embexpr_end'>}</span><span class='tstring_end'>&quot;</span></span><span class='rparen'>)</span>
  <span class='gvar'>$logger</span><span class='period'>.</span><span class='id identifier rubyid_info'>info</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>ratelimit_remaining </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_rate_limit_remaining'>rate_limit_remaining</span><span class='embexpr_end'>}</span><span class='tstring_end'>&quot;</span></span><span class='rparen'>)</span>
  <span class='gvar'>$logger</span><span class='period'>.</span><span class='id identifier rubyid_info'>info</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>ratelimit_reset </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_rate_limit_reset'>rate_limit_reset</span><span class='embexpr_end'>}</span><span class='tstring_end'>&quot;</span></span><span class='rparen'>)</span>
  <span class='gvar'>$logger</span><span class='period'>.</span><span class='id identifier rubyid_info'>info</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>ratelimit_start </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_rate_limit_start'>rate_limit_start</span><span class='embexpr_end'>}</span><span class='tstring_end'>&quot;</span></span><span class='rparen'>)</span>
  <span class='gvar'>$logger</span><span class='period'>.</span><span class='id identifier rubyid_info'>info</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>ratelimit_current_time </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_rate_limit_current_time'>rate_limit_current_time</span><span class='embexpr_end'>}</span><span class='tstring_end'>&quot;</span></span><span class='rparen'>)</span>
  <span class='gvar'>$logger</span><span class='period'>.</span><span class='id identifier rubyid_info'>info</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>ratelimit_burn_rate_queries_per_hour </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_burn_rate_queries_per_hour'>burn_rate_queries_per_hour</span><span class='embexpr_end'>}</span><span class='tstring_end'>&quot;</span></span><span class='rparen'>)</span>

  <span class='id identifier rubyid_rate_limit_reset'>rate_limit_reset</span> <span class='op'>-</span> <span class='id identifier rubyid_rate_limit_current_time'>rate_limit_current_time</span> <span class='comment'># return seconds until next reset
</span><span class='kw'>end</span></pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <h3 class="signature " id="github_query-instance_method">
  
    #<strong>github_query</strong>(client, num_retries = 2)  &#x21d2; <tt>Object</tt> 
  

  

  
</h3><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File 'lib/github.rb', line 26</span>

<span class='kw'>def</span> <span class='id identifier rubyid_github_query'>github_query</span><span class='lparen'>(</span><span class='id identifier rubyid_client'>client</span><span class='comma'>,</span> <span class='id identifier rubyid_num_retries'>num_retries</span> <span class='op'>=</span> <span class='int'>2</span><span class='rparen'>)</span>
  <span class='id identifier rubyid_count'>count</span> <span class='op'>=</span> <span class='int'>0</span>
  <span class='id identifier rubyid_loop'>loop</span> <span class='kw'>do</span>
    <span class='kw'>begin</span>
      <span class='kw'>return</span> <span class='kw'>yield</span>
    <span class='kw'>rescue</span> <span class='const'>Octokit</span><span class='op'>::</span><span class='const'>TooManyRequests</span>
      <span class='id identifier rubyid_count'>count</span> <span class='op'>+=</span> <span class='int'>1</span>

      <span class='kw'>if</span> <span class='id identifier rubyid_count'>count</span> <span class='op'>&gt;</span> <span class='id identifier rubyid_num_retries'>num_retries</span>
        <span class='gvar'>$logger</span><span class='period'>.</span><span class='id identifier rubyid_error'>error</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>Rate limit has been exceeded retries exhausted, re-throwing error</span><span class='tstring_end'>&#39;</span></span><span class='rparen'>)</span>
        <span class='id identifier rubyid_raise'>raise</span>
      <span class='kw'>end</span>
      <span class='id identifier rubyid_time_to_sleep'>time_to_sleep</span> <span class='op'>=</span> <span class='id identifier rubyid_github_check_rate_limit'><span class='object_link'><a href="#github_check_rate_limit-instance_method" title="#github_check_rate_limit (method)">github_check_rate_limit</a></span></span><span class='lparen'>(</span><span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_last_response'>last_response</span><span class='period'>.</span><span class='id identifier rubyid_headers'>headers</span><span class='rparen'>)</span> <span class='op'>+</span> <span class='int'>3</span> <span class='comment'># add a little buffer to the delay time
</span>      <span class='gvar'>$logger</span><span class='period'>.</span><span class='id identifier rubyid_info'>info</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>Rate limit has been exceeded, rate limit will be reset in: </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_time_to_sleep'>time_to_sleep</span><span class='embexpr_end'>}</span><span class='tstring_content'>s</span><span class='tstring_end'>&quot;</span></span><span class='rparen'>)</span>
      <span class='gvar'>$logger</span><span class='period'>.</span><span class='id identifier rubyid_info'>info</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>Rate limit has been exceeded, sleeping for: </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_time_to_sleep'>time_to_sleep</span><span class='embexpr_end'>}</span><span class='tstring_content'>s</span><span class='tstring_end'>&quot;</span></span><span class='rparen'>)</span>

      <span class='id identifier rubyid_sleep'>sleep</span><span class='lparen'>(</span><span class='id identifier rubyid_time_to_sleep'>time_to_sleep</span><span class='rparen'>)</span> <span class='kw'>if</span> <span class='id identifier rubyid_time_to_sleep'>time_to_sleep</span><span class='period'>.</span><span class='id identifier rubyid_positive?'>positive?</span>
    <span class='kw'>end</span>
  <span class='kw'>end</span>
<span class='kw'>end</span></pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <h3 class="signature " id="processor_count-instance_method">
  
    #<strong>processor_count</strong>  &#x21d2; <tt>Object</tt> 
  

  

  
</h3><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File 'lib/processor.rb', line 3</span>

<span class='kw'>def</span> <span class='id identifier rubyid_processor_count'>processor_count</span>
  <span class='id identifier rubyid_os_name'>os_name</span> <span class='op'>=</span> <span class='const'>RbConfig</span><span class='op'>::</span><span class='const'>CONFIG</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>target_os</span><span class='tstring_end'>&#39;</span></span><span class='rbracket'>]</span>
  <span class='kw'>if</span> <span class='id identifier rubyid_os_name'>os_name</span><span class='period'>.</span><span class='id identifier rubyid_match'>match</span><span class='lparen'>(</span><span class='tstring'><span class='regexp_beg'>/</span><span class='tstring_content'>mingw|mswin</span><span class='regexp_end'>/</span></span><span class='rparen'>)</span>
    <span class='id identifier rubyid_require'>require</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>win32ole</span><span class='tstring_end'>&#39;</span></span>
    <span class='id identifier rubyid_result'>result</span> <span class='op'>=</span> <span class='const'>WIN32OLE</span><span class='period'>.</span><span class='id identifier rubyid_connect'>connect</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>winmgmts://</span><span class='tstring_end'>&#39;</span></span><span class='rparen'>)</span><span class='period'>.</span><span class='const'>ExecQuery</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>select NumberOfLogicalProcessors from Win32_Processor</span><span class='tstring_end'>&#39;</span></span><span class='rparen'>)</span>
    <span class='id identifier rubyid_result'>result</span><span class='period'>.</span><span class='id identifier rubyid_to_enum'>to_enum</span><span class='period'>.</span><span class='id identifier rubyid_collect'>collect</span><span class='lparen'>(</span><span class='op'>&amp;</span><span class='symbol'>:NumberOfLogicalProcessors</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_reduce'>reduce</span><span class='lparen'>(</span><span class='symbol'>:+</span><span class='rparen'>)</span>
  <span class='kw'>elsif</span> <span class='const'>File</span><span class='period'>.</span><span class='id identifier rubyid_readable?'>readable?</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>/proc/cpuinfo</span><span class='tstring_end'>&#39;</span></span><span class='rparen'>)</span>
    <span class='const'>IO</span><span class='period'>.</span><span class='id identifier rubyid_read'>read</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>/proc/cpuinfo</span><span class='tstring_end'>&#39;</span></span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_scan'>scan</span><span class='lparen'>(</span><span class='tstring'><span class='regexp_beg'>/</span><span class='tstring_content'>^processor</span><span class='regexp_end'>/</span></span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_size'>size</span>
  <span class='kw'>elsif</span> <span class='const'>File</span><span class='period'>.</span><span class='id identifier rubyid_executable?'>executable?</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>/usr/bin/hwprefs</span><span class='tstring_end'>&#39;</span></span><span class='rparen'>)</span>
    <span class='const'>IO</span><span class='period'>.</span><span class='id identifier rubyid_popen'>popen</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>/usr/bin/hwprefs thread_count</span><span class='tstring_end'>&#39;</span></span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_read'>read</span><span class='period'>.</span><span class='id identifier rubyid_to_i'>to_i</span>
  <span class='kw'>elsif</span> <span class='const'>File</span><span class='period'>.</span><span class='id identifier rubyid_executable?'>executable?</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>/usr/sbin/psrinfo</span><span class='tstring_end'>&#39;</span></span><span class='rparen'>)</span>
    <span class='const'>IO</span><span class='period'>.</span><span class='id identifier rubyid_popen'>popen</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>/usr/sbin/psrinfo</span><span class='tstring_end'>&#39;</span></span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_read'>read</span><span class='period'>.</span><span class='id identifier rubyid_scan'>scan</span><span class='lparen'>(</span><span class='tstring'><span class='regexp_beg'>/</span><span class='tstring_content'>^.*on-*line</span><span class='regexp_end'>/</span></span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_size'>size</span>
  <span class='kw'>elsif</span> <span class='const'>File</span><span class='period'>.</span><span class='id identifier rubyid_executable?'>executable?</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>/usr/sbin/ioscan</span><span class='tstring_end'>&#39;</span></span><span class='rparen'>)</span>
    <span class='const'>IO</span><span class='period'>.</span><span class='id identifier rubyid_popen'>popen</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>/usr/sbin/ioscan -kC processor</span><span class='tstring_end'>&#39;</span></span><span class='rparen'>)</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_out'>out</span><span class='op'>|</span>
      <span class='id identifier rubyid_out'>out</span><span class='period'>.</span><span class='id identifier rubyid_read'>read</span><span class='period'>.</span><span class='id identifier rubyid_scan'>scan</span><span class='lparen'>(</span><span class='tstring'><span class='regexp_beg'>/</span><span class='tstring_content'>^.*processor</span><span class='regexp_end'>/</span></span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_size'>size</span>
    <span class='kw'>end</span>
  <span class='kw'>elsif</span> <span class='const'>File</span><span class='period'>.</span><span class='id identifier rubyid_executable?'>executable?</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>/usr/sbin/pmcycles</span><span class='tstring_end'>&#39;</span></span><span class='rparen'>)</span>
    <span class='const'>IO</span><span class='period'>.</span><span class='id identifier rubyid_popen'>popen</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>/usr/sbin/pmcycles -m</span><span class='tstring_end'>&#39;</span></span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_read'>read</span><span class='period'>.</span><span class='id identifier rubyid_count'>count</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>\n</span><span class='tstring_end'>&quot;</span></span><span class='rparen'>)</span>
  <span class='kw'>elsif</span> <span class='const'>File</span><span class='period'>.</span><span class='id identifier rubyid_executable?'>executable?</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>/usr/sbin/lsdev</span><span class='tstring_end'>&#39;</span></span><span class='rparen'>)</span>
    <span class='const'>IO</span><span class='period'>.</span><span class='id identifier rubyid_popen'>popen</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>/usr/sbin/lsdev -Cc processor -S 1</span><span class='tstring_end'>&#39;</span></span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_read'>read</span><span class='period'>.</span><span class='id identifier rubyid_count'>count</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>\n</span><span class='tstring_end'>&quot;</span></span><span class='rparen'>)</span>
  <span class='kw'>elsif</span> <span class='const'>File</span><span class='period'>.</span><span class='id identifier rubyid_executable?'>executable?</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>/usr/sbin/sysconf</span><span class='tstring_end'>&#39;</span></span><span class='rparen'>)</span> <span class='op'>&amp;&amp;</span> <span class='id identifier rubyid_os_name'>os_name</span> <span class='op'>=~</span> <span class='tstring'><span class='regexp_beg'>/</span><span class='tstring_content'>irix</span><span class='regexp_end'>/i</span></span>
    <span class='const'>IO</span><span class='period'>.</span><span class='id identifier rubyid_popen'>popen</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>/usr/sbin/sysconf NPROC_ONLN</span><span class='tstring_end'>&#39;</span></span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_read'>read</span><span class='period'>.</span><span class='id identifier rubyid_to_i'>to_i</span>
  <span class='kw'>elsif</span> <span class='const'>File</span><span class='period'>.</span><span class='id identifier rubyid_executable?'>executable?</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>/usr/sbin/sysctl</span><span class='tstring_end'>&#39;</span></span><span class='rparen'>)</span>
    <span class='const'>IO</span><span class='period'>.</span><span class='id identifier rubyid_popen'>popen</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>/usr/sbin/sysctl -n hw.ncpu</span><span class='tstring_end'>&#39;</span></span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_read'>read</span><span class='period'>.</span><span class='id identifier rubyid_to_i'>to_i</span>
  <span class='kw'>elsif</span> <span class='const'>File</span><span class='period'>.</span><span class='id identifier rubyid_executable?'>executable?</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>/sbin/sysctl</span><span class='tstring_end'>&#39;</span></span><span class='rparen'>)</span>
    <span class='const'>IO</span><span class='period'>.</span><span class='id identifier rubyid_popen'>popen</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>/sbin/sysctl -n hw.ncpu</span><span class='tstring_end'>&#39;</span></span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_read'>read</span><span class='period'>.</span><span class='id identifier rubyid_to_i'>to_i</span>
  <span class='kw'>else</span>
    <span class='id identifier rubyid_warn'>warn</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>Unknown platform: </span><span class='embexpr_beg'>#{</span><span class='const'>RbConfig</span><span class='op'>::</span><span class='const'>CONFIG</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>target_os</span><span class='tstring_end'>&#39;</span></span><span class='rbracket'>]</span><span class='embexpr_end'>}</span><span class='tstring_end'>&quot;</span></span><span class='rparen'>)</span>
    <span class='id identifier rubyid_warn'>warn</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>Assuming 1 processor.</span><span class='tstring_end'>&#39;</span></span><span class='rparen'>)</span>
    <span class='int'>1</span>
  <span class='kw'>end</span>
<span class='kw'>end</span></pre>
    </td>
  </tr>
</table>
</div>
    
  </div>

</div>

      <div id="footer">
  Generated on Thu May 18 10:34:59 2023 by
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
  0.9.19 (ruby-2.7.0).
</div>

    </div>
  </body>
</html>