doc/api/classes/Rumai/IXP/Agent.src/M000050.html in rumai-1.0.0 vs doc/api/classes/Rumai/IXP/Agent.src/M000050.html in rumai-2.0.0
- old
+ new
@@ -3,20 +3,31 @@
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
- <title>entries (Rumai::IXP::Agent)</title>
+ <title>create (Rumai::IXP::Agent)</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<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/rumai/ixp/transport.rb, line 274</span>
- <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">entries</span> <span class="ruby-identifier">aPath</span>
- <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">stat</span>(<span class="ruby-identifier">aPath</span>).<span class="ruby-identifier">directory?</span>
- <span class="ruby-identifier">raise</span> <span class="ruby-constant">ArgumentError</span>, <span class="ruby-node">"#{aPath.inspect} is not a directory"</span>
- <span class="ruby-keyword kw">end</span>
+ <pre><span class="ruby-comment cmt"># File lib/rumai/ixp/transport.rb, line 304</span>
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">create</span> <span class="ruby-identifier">aPath</span>, <span class="ruby-identifier">aMode</span> = <span class="ruby-value str">'rw'</span>, <span class="ruby-identifier">aPerm</span> = <span class="ruby-value">0644</span>
+ <span class="ruby-identifier">prefix</span> = <span class="ruby-constant">File</span>.<span class="ruby-identifier">dirname</span>(<span class="ruby-identifier">aPath</span>)
+ <span class="ruby-identifier">target</span> = <span class="ruby-constant">File</span>.<span class="ruby-identifier">basename</span>(<span class="ruby-identifier">aPath</span>)
- <span class="ruby-identifier">read</span>(<span class="ruby-identifier">aPath</span>).<span class="ruby-identifier">map!</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">t</span><span class="ruby-operator">|</span> <span class="ruby-identifier">t</span>.<span class="ruby-identifier">name</span>}
+ <span class="ruby-identifier">mode</span> = <span class="ruby-constant">MODES</span>.<span class="ruby-identifier">parse</span>(<span class="ruby-identifier">aMode</span>)
+
+ <span class="ruby-identifier">with_fid</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">prefixFid</span><span class="ruby-operator">|</span>
+ <span class="ruby-identifier">walk_fid</span> <span class="ruby-identifier">prefixFid</span>, <span class="ruby-identifier">prefix</span>
+
+ <span class="ruby-comment cmt"># create the file</span>
+ <span class="ruby-identifier">talk</span> <span class="ruby-constant">Tcreate</span>.<span class="ruby-identifier">new</span>(
+ <span class="ruby-identifier">:fid</span> =<span class="ruby-operator">></span> <span class="ruby-identifier">prefixFid</span>,
+ <span class="ruby-identifier">:name</span> =<span class="ruby-operator">></span> <span class="ruby-identifier">target</span>,
+ <span class="ruby-identifier">:perm</span> =<span class="ruby-operator">></span> <span class="ruby-identifier">aPerm</span>,
+ <span class="ruby-identifier">:mode</span> =<span class="ruby-operator">></span> <span class="ruby-identifier">mode</span>
+ )
+ <span class="ruby-keyword kw">end</span>
<span class="ruby-keyword kw">end</span></pre>
</body>
</html>
\ No newline at end of file