Sha256: 3d000e923b5f67478d6782b560cabd19c18de8f67a3ff54c704b38454c43baf2

Contents?: true

Size: 1.61 KB

Versions: 4

Compression:

Stored size: 1.61 KB

Contents

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html 
     PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html>
<head>
  <title>ip_address (Keystone::Os::Unix)</title>
  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
  <link rel="stylesheet" href="../../../.././rdoc-style.css" type="text/css" media="screen" />
</head>
<body class="standalone-code">
  <pre><span class="ruby-comment cmt"># File lib/keystone/os/unix.rb, line 4</span>
      <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">ip_address</span>
        <span class="ruby-identifier">ifconfig</span> = <span class="ruby-value">`/sbin/ifconfig`</span>
        <span class="ruby-identifier">ips</span> = []

        <span class="ruby-comment cmt"># TODO mac</span>
        <span class="ruby-identifier">ifconfig</span>.<span class="ruby-identifier">gsub</span>(<span class="ruby-regexp re">/inet addr:(\d+\.\d+\.\d+\.\d+)/</span>){<span class="ruby-operator">|</span><span class="ruby-identifier">ip</span><span class="ruby-operator">|</span>
          <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">$1</span> <span class="ruby-operator">!=</span> <span class="ruby-value str">'127.0.0.1'</span>
            <span class="ruby-identifier">ips</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">$1</span>
          <span class="ruby-keyword kw">end</span>
        }
        <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">ips</span>
      <span class="ruby-keyword kw">end</span></pre>
</body>
</html>

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
keystone-0.0.32 doc/classes/Keystone/Os/Unix.src/M000040.html
keystone-0.0.31 doc/classes/Keystone/Os/Unix.src/M000040.html
keystone-0.0.30 doc/classes/Keystone/Os/Unix.src/M000040.html
keystone-0.0.29 doc/classes/Keystone/Os/Unix.src/M000040.html