fakefs/classes/FakeFS/FakeFile.html

467 lines
18 KiB
HTML
Raw Normal View History

2009-10-07 04:44:05 +00:00
<?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 xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>FakeFS::FakeFile</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" href="../../css/reset.css" type="text/css" media="screen" />
<link rel="stylesheet" href="../../css/main.css" type="text/css" media="screen" />
<script src="../../js/jquery-1.3.2.min.js" type="text/javascript" charset="utf-8"></script>
<script src="../../js/jquery-effect.js" type="text/javascript" charset="utf-8"></script>
<script src="../../js/main.js" type="text/javascript" charset="utf-8"></script>
</head>
<body>
<div class="banner">
<h1>
<span class="type">Class</span>
FakeFS::FakeFile
<span class="parent">&lt;
<a href="../Object.html">Object</a>
</span>
</h1>
<ul class="files">
<li><a href="../../files/lib/fakefs/fake/file_rb.html">lib/fakefs/fake/file.rb</a></li>
</ul>
</div>
<div id="bodyContent">
<div id="content">
<div class="sectiontitle">Methods</div>
<dl class="methods">
<dt>C</dt>
<dd>
<ul>
2009-10-30 17:03:19 +00:00
<li><a href="#M000044">clone</a>,</li>
2009-10-07 04:44:05 +00:00
2009-10-30 17:03:19 +00:00
<li><a href="#M000040">content</a>,</li>
2009-10-07 04:44:05 +00:00
2009-10-30 17:03:19 +00:00
<li><a href="#M000041">content=</a></li>
2009-10-07 04:44:05 +00:00
</ul>
</dd>
<dt>D</dt>
<dd>
<ul>
2009-10-30 17:03:19 +00:00
<li><a href="#M000048">delete</a></li>
2009-10-07 04:44:05 +00:00
</ul>
</dd>
<dt>E</dt>
<dd>
<ul>
2009-10-30 17:03:19 +00:00
<li><a href="#M000045">entry</a></li>
2009-10-07 04:44:05 +00:00
</ul>
</dd>
<dt>I</dt>
<dd>
<ul>
2009-10-30 17:03:19 +00:00
<li><a href="#M000046">inspect</a></li>
2009-10-07 04:44:05 +00:00
</ul>
</dd>
<dt>L</dt>
<dd>
<ul>
2009-10-30 17:03:19 +00:00
<li><a href="#M000043">link</a>,</li>
2009-10-07 04:44:05 +00:00
2009-10-30 17:03:19 +00:00
<li><a href="#M000042">links</a></li>
2009-10-07 04:44:05 +00:00
</ul>
</dd>
<dt>N</dt>
<dd>
<ul>
2009-10-30 17:03:19 +00:00
<li><a href="#M000037">new</a></li>
2009-10-07 04:44:05 +00:00
</ul>
</dd>
<dt>T</dt>
<dd>
<ul>
2009-10-30 17:03:19 +00:00
<li><a href="#M000047">to_s</a></li>
2009-10-07 04:44:05 +00:00
</ul>
</dd>
</dl>
<div class="sectiontitle">Classes and Modules</div>
<ul>
<li><span class="type">CLASS</span> <a href="FakeFile/Inode.html">FakeFS::FakeFile::Inode</a></li>
</ul>
<div class="sectiontitle">Attributes</div>
<table border='0' cellpadding='5'>
<tr valign='top'>
<td class='attr-rw'>
[RW]
</td>
<td class='attr-name'>name</td>
<td class='attr-desc'></td>
</tr>
<tr valign='top'>
<td class='attr-rw'>
[RW]
</td>
<td class='attr-name'>parent</td>
<td class='attr-desc'></td>
</tr>
2009-10-30 17:03:19 +00:00
<tr valign='top'>
<td class='attr-rw'>
[RW]
</td>
<td class='attr-name'>content</td>
<td class='attr-desc'></td>
</tr>
<tr valign='top'>
<td class='attr-rw'>
[RW]
</td>
<td class='attr-name'>mtime</td>
<td class='attr-desc'></td>
</tr>
2009-10-07 04:44:05 +00:00
<tr valign='top'>
<td class='attr-rw'>
[RW]
</td>
<td class='attr-name'>inode</td>
<td class='attr-desc'></td>
</tr>
</table>
<div class="sectiontitle">Class Public methods</div>
<div class="method">
2009-10-30 17:03:19 +00:00
<div class="title" id="M000037">
2009-10-07 04:44:05 +00:00
2009-10-30 17:03:19 +00:00
<a name="M000037"></a><b>new</b>(name = nil, parent = nil)
2009-10-07 04:44:05 +00:00
</div>
<div class="sourcecode">
<p class="source-link">
2009-10-30 17:03:19 +00:00
Source: <a href="javascript:toggleSource('M000037_source')" id="l_M000037_source">show</a>
2009-10-07 04:44:05 +00:00
2009-10-30 17:03:19 +00:00
| <a href="http://github.com/defunkt/fakefs/blob/1d410d49554e15391abbd443839c4c380ea8a3e8/lib/fakefs/fake/file.rb#L30" target="_blank" class="github_url">on GitHub</a>
2009-10-07 04:44:05 +00:00
</p>
2009-10-30 17:03:19 +00:00
<div id="M000037_source" class="dyn-source">
<pre><span class="ruby-comment cmt"># File lib/fakefs/fake/file.rb, line 30</span>
2009-10-07 04:44:05 +00:00
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">name</span> = <span class="ruby-keyword kw">nil</span>, <span class="ruby-identifier">parent</span> = <span class="ruby-keyword kw">nil</span>)
<span class="ruby-ivar">@name</span> = <span class="ruby-identifier">name</span>
<span class="ruby-ivar">@parent</span> = <span class="ruby-identifier">parent</span>
<span class="ruby-ivar">@inode</span> = <span class="ruby-constant">Inode</span>.<span class="ruby-identifier">new</span>(<span class="ruby-keyword kw">self</span>)
2009-10-30 17:03:19 +00:00
<span class="ruby-ivar">@mtime</span> = <span class="ruby-constant">Time</span>.<span class="ruby-identifier">now</span>
2009-10-07 04:44:05 +00:00
<span class="ruby-keyword kw">end</span></pre>
</div>
</div>
</div>
<div class="sectiontitle">Instance Public methods</div>
<div class="method">
2009-10-30 17:03:19 +00:00
<div class="title" id="M000044">
2009-10-07 04:44:05 +00:00
2009-10-30 17:03:19 +00:00
<a name="M000044"></a><b>clone</b>(parent = nil)
2009-10-07 04:44:05 +00:00
</div>
<div class="sourcecode">
<p class="source-link">
2009-10-30 17:03:19 +00:00
Source: <a href="javascript:toggleSource('M000044_source')" id="l_M000044_source">show</a>
2009-10-07 04:44:05 +00:00
2009-10-30 17:03:19 +00:00
| <a href="http://github.com/defunkt/fakefs/blob/1d410d49554e15391abbd443839c4c380ea8a3e8/lib/fakefs/fake/file.rb#L55" target="_blank" class="github_url">on GitHub</a>
2009-10-07 04:44:05 +00:00
</p>
2009-10-30 17:03:19 +00:00
<div id="M000044_source" class="dyn-source">
<pre><span class="ruby-comment cmt"># File lib/fakefs/fake/file.rb, line 55</span>
2009-10-07 04:44:05 +00:00
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">clone</span>(<span class="ruby-identifier">parent</span> = <span class="ruby-keyword kw">nil</span>)
<span class="ruby-identifier">clone</span> = <span class="ruby-keyword kw">super</span>()
<span class="ruby-identifier">clone</span>.<span class="ruby-identifier">parent</span> = <span class="ruby-identifier">parent</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">parent</span>
<span class="ruby-identifier">clone</span>.<span class="ruby-identifier">inode</span> = <span class="ruby-identifier">inode</span>.<span class="ruby-identifier">clone</span>
<span class="ruby-identifier">clone</span>
<span class="ruby-keyword kw">end</span></pre>
</div>
</div>
</div>
<div class="method">
2009-10-30 17:03:19 +00:00
<div class="title" id="M000040">
2009-10-07 04:44:05 +00:00
2009-10-30 17:03:19 +00:00
<a name="M000040"></a><b>content</b>()
2009-10-07 04:44:05 +00:00
</div>
<div class="sourcecode">
<p class="source-link">
2009-10-30 17:03:19 +00:00
Source: <a href="javascript:toggleSource('M000040_source')" id="l_M000040_source">show</a>
2009-10-07 04:44:05 +00:00
2009-10-30 17:03:19 +00:00
| <a href="http://github.com/defunkt/fakefs/blob/1d410d49554e15391abbd443839c4c380ea8a3e8/lib/fakefs/fake/file.rb#L39" target="_blank" class="github_url">on GitHub</a>
2009-10-07 04:44:05 +00:00
</p>
2009-10-30 17:03:19 +00:00
<div id="M000040_source" class="dyn-source">
<pre><span class="ruby-comment cmt"># File lib/fakefs/fake/file.rb, line 39</span>
2009-10-07 04:44:05 +00:00
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">content</span>
<span class="ruby-ivar">@inode</span>.<span class="ruby-identifier">content</span>
<span class="ruby-keyword kw">end</span></pre>
</div>
</div>
</div>
<div class="method">
2009-10-30 17:03:19 +00:00
<div class="title" id="M000041">
2009-10-07 04:44:05 +00:00
2009-10-30 17:03:19 +00:00
<a name="M000041"></a><b>content=</b>(str)
2009-10-07 04:44:05 +00:00
</div>
<div class="sourcecode">
<p class="source-link">
2009-10-30 17:03:19 +00:00
Source: <a href="javascript:toggleSource('M000041_source')" id="l_M000041_source">show</a>
2009-10-07 04:44:05 +00:00
2009-10-30 17:03:19 +00:00
| <a href="http://github.com/defunkt/fakefs/blob/1d410d49554e15391abbd443839c4c380ea8a3e8/lib/fakefs/fake/file.rb#L43" target="_blank" class="github_url">on GitHub</a>
2009-10-07 04:44:05 +00:00
</p>
2009-10-30 17:03:19 +00:00
<div id="M000041_source" class="dyn-source">
<pre><span class="ruby-comment cmt"># File lib/fakefs/fake/file.rb, line 43</span>
2009-10-07 04:44:05 +00:00
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">content=</span>(<span class="ruby-identifier">str</span>)
<span class="ruby-ivar">@inode</span>.<span class="ruby-identifier">content</span> = <span class="ruby-identifier">str</span>
<span class="ruby-keyword kw">end</span></pre>
</div>
</div>
</div>
<div class="method">
2009-10-30 17:03:19 +00:00
<div class="title" id="M000048">
2009-10-07 04:44:05 +00:00
2009-10-30 17:03:19 +00:00
<a name="M000048"></a><b>delete</b>()
2009-10-07 04:44:05 +00:00
</div>
<div class="sourcecode">
<p class="source-link">
2009-10-30 17:03:19 +00:00
Source: <a href="javascript:toggleSource('M000048_source')" id="l_M000048_source">show</a>
2009-10-07 04:44:05 +00:00
2009-10-30 17:03:19 +00:00
| <a href="http://github.com/defunkt/fakefs/blob/1d410d49554e15391abbd443839c4c380ea8a3e8/lib/fakefs/fake/file.rb#L74" target="_blank" class="github_url">on GitHub</a>
2009-10-07 04:44:05 +00:00
</p>
2009-10-30 17:03:19 +00:00
<div id="M000048_source" class="dyn-source">
<pre><span class="ruby-comment cmt"># File lib/fakefs/fake/file.rb, line 74</span>
2009-10-07 04:44:05 +00:00
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">delete</span>
<span class="ruby-identifier">inode</span>.<span class="ruby-identifier">unlink</span>(<span class="ruby-keyword kw">self</span>)
<span class="ruby-identifier">parent</span>.<span class="ruby-identifier">delete</span>(<span class="ruby-keyword kw">self</span>)
<span class="ruby-keyword kw">end</span></pre>
</div>
</div>
</div>
<div class="method">
2009-10-30 17:03:19 +00:00
<div class="title" id="M000045">
2009-10-07 04:44:05 +00:00
2009-10-30 17:03:19 +00:00
<a name="M000045"></a><b>entry</b>()
2009-10-07 04:44:05 +00:00
</div>
<div class="sourcecode">
<p class="source-link">
2009-10-30 17:03:19 +00:00
Source: <a href="javascript:toggleSource('M000045_source')" id="l_M000045_source">show</a>
2009-10-07 04:44:05 +00:00
2009-10-30 17:03:19 +00:00
| <a href="http://github.com/defunkt/fakefs/blob/1d410d49554e15391abbd443839c4c380ea8a3e8/lib/fakefs/fake/file.rb#L62" target="_blank" class="github_url">on GitHub</a>
2009-10-07 04:44:05 +00:00
</p>
2009-10-30 17:03:19 +00:00
<div id="M000045_source" class="dyn-source">
<pre><span class="ruby-comment cmt"># File lib/fakefs/fake/file.rb, line 62</span>
2009-10-07 04:44:05 +00:00
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">entry</span>
<span class="ruby-keyword kw">self</span>
<span class="ruby-keyword kw">end</span></pre>
</div>
</div>
</div>
<div class="method">
2009-10-30 17:03:19 +00:00
<div class="title" id="M000046">
2009-10-07 04:44:05 +00:00
2009-10-30 17:03:19 +00:00
<a name="M000046"></a><b>inspect</b>()
2009-10-07 04:44:05 +00:00
</div>
<div class="sourcecode">
<p class="source-link">
2009-10-30 17:03:19 +00:00
Source: <a href="javascript:toggleSource('M000046_source')" id="l_M000046_source">show</a>
2009-10-07 04:44:05 +00:00
2009-10-30 17:03:19 +00:00
| <a href="http://github.com/defunkt/fakefs/blob/1d410d49554e15391abbd443839c4c380ea8a3e8/lib/fakefs/fake/file.rb#L66" target="_blank" class="github_url">on GitHub</a>
2009-10-07 04:44:05 +00:00
</p>
2009-10-30 17:03:19 +00:00
<div id="M000046_source" class="dyn-source">
<pre><span class="ruby-comment cmt"># File lib/fakefs/fake/file.rb, line 66</span>
2009-10-07 04:44:05 +00:00
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">inspect</span>
<span class="ruby-node">&quot;(FakeFile name:#{name.inspect} parent:#{parent.to_s.inspect} size:#{content.size})&quot;</span>
<span class="ruby-keyword kw">end</span></pre>
</div>
</div>
</div>
<div class="method">
2009-10-30 17:03:19 +00:00
<div class="title" id="M000043">
2009-10-07 04:44:05 +00:00
2009-10-30 17:03:19 +00:00
<a name="M000043"></a><b>link</b>(other_file)
2009-10-07 04:44:05 +00:00
</div>
<div class="sourcecode">
<p class="source-link">
2009-10-30 17:03:19 +00:00
Source: <a href="javascript:toggleSource('M000043_source')" id="l_M000043_source">show</a>
2009-10-07 04:44:05 +00:00
2009-10-30 17:03:19 +00:00
| <a href="http://github.com/defunkt/fakefs/blob/1d410d49554e15391abbd443839c4c380ea8a3e8/lib/fakefs/fake/file.rb#L51" target="_blank" class="github_url">on GitHub</a>
2009-10-07 04:44:05 +00:00
</p>
2009-10-30 17:03:19 +00:00
<div id="M000043_source" class="dyn-source">
<pre><span class="ruby-comment cmt"># File lib/fakefs/fake/file.rb, line 51</span>
2009-10-07 04:44:05 +00:00
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">link</span>(<span class="ruby-identifier">other_file</span>)
<span class="ruby-ivar">@inode</span>.<span class="ruby-identifier">link</span>(<span class="ruby-identifier">other_file</span>)
<span class="ruby-keyword kw">end</span></pre>
</div>
</div>
</div>
<div class="method">
2009-10-30 17:03:19 +00:00
<div class="title" id="M000042">
2009-10-07 04:44:05 +00:00
2009-10-30 17:03:19 +00:00
<a name="M000042"></a><b>links</b>()
2009-10-07 04:44:05 +00:00
</div>
<div class="sourcecode">
<p class="source-link">
2009-10-30 17:03:19 +00:00
Source: <a href="javascript:toggleSource('M000042_source')" id="l_M000042_source">show</a>
2009-10-07 04:44:05 +00:00
2009-10-30 17:03:19 +00:00
| <a href="http://github.com/defunkt/fakefs/blob/1d410d49554e15391abbd443839c4c380ea8a3e8/lib/fakefs/fake/file.rb#L47" target="_blank" class="github_url">on GitHub</a>
2009-10-07 04:44:05 +00:00
</p>
2009-10-30 17:03:19 +00:00
<div id="M000042_source" class="dyn-source">
<pre><span class="ruby-comment cmt"># File lib/fakefs/fake/file.rb, line 47</span>
2009-10-07 04:44:05 +00:00
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">links</span>
<span class="ruby-ivar">@inode</span>.<span class="ruby-identifier">links</span>
<span class="ruby-keyword kw">end</span></pre>
</div>
</div>
</div>
<div class="method">
2009-10-30 17:03:19 +00:00
<div class="title" id="M000047">
2009-10-07 04:44:05 +00:00
2009-10-30 17:03:19 +00:00
<a name="M000047"></a><b>to_s</b>()
2009-10-07 04:44:05 +00:00
</div>
<div class="sourcecode">
<p class="source-link">
2009-10-30 17:03:19 +00:00
Source: <a href="javascript:toggleSource('M000047_source')" id="l_M000047_source">show</a>
2009-10-07 04:44:05 +00:00
2009-10-30 17:03:19 +00:00
| <a href="http://github.com/defunkt/fakefs/blob/1d410d49554e15391abbd443839c4c380ea8a3e8/lib/fakefs/fake/file.rb#L70" target="_blank" class="github_url">on GitHub</a>
2009-10-07 04:44:05 +00:00
</p>
2009-10-30 17:03:19 +00:00
<div id="M000047_source" class="dyn-source">
<pre><span class="ruby-comment cmt"># File lib/fakefs/fake/file.rb, line 70</span>
2009-10-07 04:44:05 +00:00
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">to_s</span>
<span class="ruby-constant">File</span>.<span class="ruby-identifier">join</span>(<span class="ruby-identifier">parent</span>.<span class="ruby-identifier">to_s</span>, <span class="ruby-identifier">name</span>)
<span class="ruby-keyword kw">end</span></pre>
</div>
</div>
</div>
</div>
</div>
</body>
</html>