folio 0.1.0 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (70) hide show
  1. data/CHANGES +2 -0
  2. data/MANIFEST +20 -5
  3. data/METADATA +3 -2
  4. data/README +5 -0
  5. data/doc/rdoc/classes/Enumerator.html +92 -0
  6. data/doc/rdoc/classes/Folio.html +12 -2
  7. data/doc/rdoc/classes/Folio/BlockDevice.html +4 -4
  8. data/doc/rdoc/classes/Folio/CharacterDevice.html +4 -4
  9. data/doc/rdoc/classes/Folio/Directory.html +169 -41
  10. data/doc/rdoc/classes/Folio/Document.html +130 -51
  11. data/doc/rdoc/classes/Folio/FileObject.html +318 -313
  12. data/doc/rdoc/classes/Folio/Pipe.html +8 -8
  13. data/doc/rdoc/classes/Folio/Prompt.html +261 -218
  14. data/doc/rdoc/created.rid +1 -1
  15. data/doc/rdoc/files/CHANGES.html +92 -0
  16. data/doc/rdoc/files/METADATA.html +7 -6
  17. data/doc/rdoc/files/README.html +1 -1
  18. data/doc/rdoc/files/lib/folio/directory_rb.html +1 -1
  19. data/doc/rdoc/files/lib/folio/document_rb.html +1 -1
  20. data/doc/rdoc/files/lib/folio/fileobject_rb.html +6 -1
  21. data/doc/rdoc/files/lib/folio/prompt_rb.html +1 -1
  22. data/doc/rdoc/files/lib/folio_rb.html +1 -1
  23. data/doc/rdoc/fr_class_index.html +1 -0
  24. data/doc/rdoc/fr_file_index.html +1 -0
  25. data/doc/rdoc/fr_method_index.html +126 -116
  26. data/doc/ri/Enumerator/cdesc-Enumerator.yaml +15 -0
  27. data/doc/ri/Folio/Directory/%2f-i.yaml +1 -1
  28. data/doc/ri/Folio/Directory/cdesc-Directory.yaml +10 -2
  29. data/doc/ri/Folio/Directory/chdir-i.yaml +3 -1
  30. data/doc/ri/Folio/Directory/chmod_r-i.yaml +2 -0
  31. data/doc/ri/Folio/Directory/chown_r-i.yaml +1 -1
  32. data/doc/ri/Folio/Directory/chroot-i.yaml +2 -0
  33. data/doc/ri/Folio/Directory/cp_r-i.yaml +1 -1
  34. data/doc/ri/Folio/Directory/directories-i.yaml +12 -0
  35. data/doc/ri/Folio/Directory/directory_entries-i.yaml +12 -0
  36. data/doc/ri/Folio/Directory/document_entries-i.yaml +12 -0
  37. data/doc/ri/Folio/Directory/documents-i.yaml +12 -0
  38. data/doc/ri/Folio/Directory/entries-i.yaml +1 -1
  39. data/doc/ri/Folio/Directory/files-i.yaml +12 -0
  40. data/doc/ri/Folio/Directory/foreach-i.yaml +2 -0
  41. data/doc/ri/Folio/Directory/rm_r-i.yaml +2 -0
  42. data/doc/ri/Folio/Directory/rm_rf-i.yaml +2 -0
  43. data/doc/ri/Folio/Directory/rmdir-i.yaml +2 -0
  44. data/doc/ri/Folio/Document/%3c%3c-i.yaml +12 -0
  45. data/doc/ri/Folio/{Prompt/paths-i.yaml → Document/%3c-i.yaml} +4 -4
  46. data/doc/ri/Folio/Document/append-i.yaml +13 -0
  47. data/doc/ri/Folio/Document/cdesc-Document.yaml +10 -2
  48. data/doc/ri/Folio/{Directory/paths-i.yaml → Document/document%3f-i.yaml} +3 -3
  49. data/doc/ri/Folio/Document/write-i.yaml +13 -0
  50. data/doc/ri/Folio/FileObject/cdesc-FileObject.yaml +2 -2
  51. data/doc/ri/Folio/FileObject/{file%3f-i.yaml → document%3f-i.yaml} +4 -2
  52. data/doc/ri/Folio/Prompt/{pwd-i.yaml → %5b%5d-i.yaml} +5 -3
  53. data/doc/ri/Folio/Prompt/cdesc-Prompt.yaml +11 -5
  54. data/doc/ri/Folio/Prompt/directories-i.yaml +1 -1
  55. data/doc/ri/Folio/Prompt/directory_entries-i.yaml +12 -0
  56. data/doc/ri/Folio/Prompt/document_entries-i.yaml +12 -0
  57. data/doc/ri/Folio/Prompt/documents-i.yaml +12 -0
  58. data/doc/ri/Folio/Prompt/entries-i.yaml +1 -1
  59. data/doc/ri/Folio/Prompt/file-i.yaml +4 -3
  60. data/doc/ri/Folio/Prompt/files-i.yaml +1 -1
  61. data/doc/ri/Folio/Prompt/fileutils-i.yaml +2 -0
  62. data/doc/ri/Folio/Prompt/mode-i.yaml +1 -1
  63. data/doc/ri/created.rid +1 -1
  64. data/lib/folio.rb +7 -50
  65. data/lib/folio/directory.rb +55 -10
  66. data/lib/folio/document.rb +14 -1
  67. data/lib/folio/fileobject.rb +9 -1
  68. data/lib/folio/prompt.rb +65 -25
  69. metadata +25 -9
  70. data/doc/ri/Folio/Document/file%3f-i.yaml +0 -10
data/CHANGES ADDED
@@ -0,0 +1,2 @@
1
+
2
+
data/MANIFEST CHANGED
@@ -2,6 +2,7 @@ doc
2
2
  doc/rdoc
3
3
  doc/rdoc/fr_file_index.html
4
4
  doc/rdoc/classes
5
+ doc/rdoc/classes/Enumerator.html
5
6
  doc/rdoc/classes/Folio
6
7
  doc/rdoc/classes/Folio/FileObject.html
7
8
  doc/rdoc/classes/Folio/BlockDevice.html
@@ -19,6 +20,7 @@ doc/rdoc/rdoc-style.css
19
20
  doc/rdoc/files
20
21
  doc/rdoc/files/README.html
21
22
  doc/rdoc/files/METADATA.html
23
+ doc/rdoc/files/CHANGES.html
22
24
  doc/rdoc/files/lib
23
25
  doc/rdoc/files/lib/folio
24
26
  doc/rdoc/files/lib/folio/fileobject_rb.html
@@ -50,15 +52,16 @@ doc/ri/Folio/Prompt/mv-i.yaml
50
52
  doc/ri/Folio/Prompt/files-i.yaml
51
53
  doc/ri/Folio/Prompt/entries-i.yaml
52
54
  doc/ri/Folio/Prompt/rm_rf-i.yaml
53
- doc/ri/Folio/Prompt/paths-i.yaml
54
55
  doc/ri/Folio/Prompt/mkdir_p-i.yaml
55
- doc/ri/Folio/Prompt/pwd-i.yaml
56
+ doc/ri/Folio/Prompt/documents-i.yaml
56
57
  doc/ri/Folio/Prompt/%2f-i.yaml
57
58
  doc/ri/Folio/Prompt/ln_sf-i.yaml
58
59
  doc/ri/Folio/Prompt/chown-i.yaml
59
60
  doc/ri/Folio/Prompt/ln_s-i.yaml
60
61
  doc/ri/Folio/Prompt/directories-i.yaml
62
+ doc/ri/Folio/Prompt/directory_entries-i.yaml
61
63
  doc/ri/Folio/Prompt/cp-i.yaml
64
+ doc/ri/Folio/Prompt/document_entries-i.yaml
62
65
  doc/ri/Folio/Prompt/rmdir-i.yaml
63
66
  doc/ri/Folio/Prompt/localize-i.yaml
64
67
  doc/ri/Folio/Prompt/chown_r-i.yaml
@@ -69,6 +72,7 @@ doc/ri/Folio/Prompt/rm_r-i.yaml
69
72
  doc/ri/Folio/Prompt/cdesc-Prompt.yaml
70
73
  doc/ri/Folio/Prompt/chmod_r-i.yaml
71
74
  doc/ri/Folio/Prompt/file-i.yaml
75
+ doc/ri/Folio/Prompt/%5b%5d-i.yaml
72
76
  doc/ri/Folio/Prompt/to_s-i.yaml
73
77
  doc/ri/Folio/Prompt/%5b%5d-c.yaml
74
78
  doc/ri/Folio/Prompt/new-c.yaml
@@ -134,8 +138,8 @@ doc/ri/Folio/FileObject/basename-i.yaml
134
138
  doc/ri/Folio/FileObject/ctime-i.yaml
135
139
  doc/ri/Folio/FileObject/cdesc-FileObject.yaml
136
140
  doc/ri/Folio/FileObject/ln_f-i.yaml
137
- doc/ri/Folio/FileObject/file%3f-i.yaml
138
141
  doc/ri/Folio/FileObject/directory%3f-i.yaml
142
+ doc/ri/Folio/FileObject/document%3f-i.yaml
139
143
  doc/ri/Folio/FileObject/stat-i.yaml
140
144
  doc/ri/Folio/FileObject/install-i.yaml
141
145
  doc/ri/Folio/FileObject/to_s-i.yaml
@@ -159,6 +163,8 @@ doc/ri/Folio/Socket
159
163
  doc/ri/Folio/Socket/cdesc-Socket.yaml
160
164
  doc/ri/Folio/Socket/new-c.yaml
161
165
  doc/ri/Folio/Document
166
+ doc/ri/Folio/Document/write-i.yaml
167
+ doc/ri/Folio/Document/%3c-i.yaml
162
168
  doc/ri/Folio/Document/open-i.yaml
163
169
  doc/ri/Folio/Document/read-i.yaml
164
170
  doc/ri/Folio/Document/cdesc-Document.yaml
@@ -166,9 +172,11 @@ doc/ri/Folio/Document/executable%3f-i.yaml
166
172
  doc/ri/Folio/Document/readlines-i.yaml
167
173
  doc/ri/Folio/Document/delete-i.yaml
168
174
  doc/ri/Folio/Document/intialize-i.yaml
175
+ doc/ri/Folio/Document/%3c%3c-i.yaml
169
176
  doc/ri/Folio/Document/unlink-i.yaml
170
177
  doc/ri/Folio/Document/truncate-i.yaml
171
- doc/ri/Folio/Document/file%3f-i.yaml
178
+ doc/ri/Folio/Document/document%3f-i.yaml
179
+ doc/ri/Folio/Document/append-i.yaml
172
180
  doc/ri/Folio/Document/executable_real%3f-i.yaml
173
181
  doc/ri/Folio/FileNotFound
174
182
  doc/ri/Folio/FileNotFound/cdesc-FileNotFound.yaml
@@ -183,15 +191,19 @@ doc/ri/Folio/CharacterDevice/chardev%3f-i.yaml
183
191
  doc/ri/Folio/CharacterDevice/cdesc-CharacterDevice.yaml
184
192
  doc/ri/Folio/Directory
185
193
  doc/ri/Folio/Directory/%2b-i.yaml
194
+ doc/ri/Folio/Directory/files-i.yaml
186
195
  doc/ri/Folio/Directory/entries-i.yaml
187
196
  doc/ri/Folio/Directory/rm_rf-i.yaml
188
- doc/ri/Folio/Directory/paths-i.yaml
197
+ doc/ri/Folio/Directory/documents-i.yaml
189
198
  doc/ri/Folio/Directory/delete-i.yaml
190
199
  doc/ri/Folio/Directory/chroot-i.yaml
191
200
  doc/ri/Folio/Directory/%2f-i.yaml
201
+ doc/ri/Folio/Directory/directories-i.yaml
202
+ doc/ri/Folio/Directory/directory_entries-i.yaml
192
203
  doc/ri/Folio/Directory/chdir-i.yaml
193
204
  doc/ri/Folio/Directory/foreach-i.yaml
194
205
  doc/ri/Folio/Directory/unlink-i.yaml
206
+ doc/ri/Folio/Directory/document_entries-i.yaml
195
207
  doc/ri/Folio/Directory/rmdir-i.yaml
196
208
  doc/ri/Folio/Directory/cdesc-Directory.yaml
197
209
  doc/ri/Folio/Directory/chown_r-i.yaml
@@ -202,6 +214,8 @@ doc/ri/Folio/Directory/chmod_r-i.yaml
202
214
  doc/ri/Folio/Directory/new-c.yaml
203
215
  doc/ri/Folio/Directory/cd-i.yaml
204
216
  doc/ri/Folio/cdesc-Folio.yaml
217
+ doc/ri/Enumerator
218
+ doc/ri/Enumerator/cdesc-Enumerator.yaml
205
219
  doc/ri/created.rid
206
220
  test
207
221
  test/test_folio.rb
@@ -210,6 +224,7 @@ test/fixture
210
224
  test/fixture/foo.txt
211
225
  test/fixture/sub
212
226
  test/fixture/bar.txt
227
+ CHANGES
213
228
  README
214
229
  METADATA
215
230
  demo
data/METADATA CHANGED
@@ -1,8 +1,9 @@
1
1
  name : folio
2
- version : 0.1.0
2
+ version : 0.2.0
3
3
  status : alpha
4
4
  homepage : http://folio.rubyforge.org
5
- author : trans <transfire@gmail.com>
5
+ contact : tigerops-community@rubyforge.org
6
+ author : 7rans <transfire@gmail.com>
6
7
  summary : Folio is a better way to access the file system.
7
8
  abstract : Folio is a better way to access the file system.
8
9
 
data/README CHANGED
@@ -57,13 +57,18 @@ And you may know the Setup drill.*
57
57
 
58
58
  *requires <a href="http://setup.rubyforge.org">Ruby Setup</a>
59
59
 
60
+
61
+
60
62
  == Resources
61
63
 
62
64
  <a href="rio.rubyforge.org">Rio<a> is a similar too. It's very well documented, but has a different
63
65
  design philiosophy having it's own more unique DSL.
64
66
 
67
+
68
+
65
69
  == Copying
66
70
 
67
71
  Folio is Copyright (c)2008 Tiger Ops & Thomas Sawyer
68
72
  Folio is distributed under the terms of the GPLv3.
69
73
 
74
+
@@ -0,0 +1,92 @@
1
+ <?xml version="1.0" encoding="iso-8859-1"?>
2
+ <!DOCTYPE html
3
+ PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
4
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
5
+ <html>
6
+ <head>
7
+ <title>Class: Enumerator</title>
8
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
9
+ <link rel="stylesheet" href=".././rdoc-style.css" type="text/css" media="screen" />
10
+
11
+ <script language="JavaScript" type="text/javascript">
12
+ // <![CDATA[
13
+
14
+ function toggleSource( id )
15
+ {
16
+ var elem
17
+ var link
18
+
19
+ if( document.getElementById )
20
+ {
21
+ elem = document.getElementById( id )
22
+ link = document.getElementById( "l_" + id )
23
+ }
24
+ else if ( document.all )
25
+ {
26
+ elem = eval( "document.all." + id )
27
+ link = eval( "document.all.l_" + id )
28
+ }
29
+ else
30
+ return false;
31
+
32
+ if( elem.style.display == "block" )
33
+ {
34
+ elem.style.display = "none"
35
+ link.innerHTML = "show source"
36
+ }
37
+ else
38
+ {
39
+ elem.style.display = "block"
40
+ link.innerHTML = "hide source"
41
+ }
42
+ }
43
+
44
+ function openCode( url )
45
+ {
46
+ window.open( url, "SOURCE_CODE", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=480,width=750" ).focus();
47
+ }
48
+ // ]]>
49
+ </script>
50
+ </head>
51
+
52
+ <body>
53
+ <table width="100%" border='0' cellpadding='0' cellspacing='0' class='banner'><tr>
54
+ <td class="file-title"><span class="file-title-prefix">Class</span><br />Enumerator</td>
55
+ <td align="right">
56
+ <table cellspacing="0" cellpadding="2">
57
+ <tr valign="top">
58
+ <td>In:</td>
59
+ <td>
60
+ <a href="../files/lib/folio/fileobject_rb.html">lib/folio/fileobject.rb</a>
61
+ </td>
62
+ </tr>
63
+ <tr>
64
+ <td>Parent:</td>
65
+ <td>
66
+ Object
67
+ </td>
68
+ </tr>
69
+ </table>
70
+ </td>
71
+ </tr>
72
+ </table>
73
+ <!-- banner header -->
74
+
75
+ <div id="bodyContent">
76
+ <div id="content">
77
+
78
+
79
+
80
+
81
+
82
+
83
+
84
+
85
+
86
+
87
+ </div>
88
+
89
+ </div>
90
+
91
+ </body>
92
+ </html>
@@ -79,6 +79,16 @@
79
79
  <div id="content">
80
80
 
81
81
  <div class="description"><h1><a href="Folio.html">Folio</a></h1>
82
+ <p>
83
+ In folio the term `<a href="Folio.html#M000001">file</a>` means a <a
84
+ href="Folio.html#M000001">file</a> object. That is to say any type of <a
85
+ href="Folio.html#M000001">file</a> system resource: document, directory,
86
+ device, etc. We use the term `document` instead to mean &quot;regular
87
+ files&quot;. This terminolgy was chosen for two reasons. Namely, (1) a
88
+ differentiation in terms was required; and (2) a <a
89
+ href="Folio.html#M000001">file</a> in the everyday sense is something in
90
+ which one puts papars (eg. documents).
91
+ </p>
82
92
  </div>
83
93
 
84
94
 
@@ -116,7 +126,7 @@ Class <a href="Folio/Socket.html" class="link">Folio::Socket</a><br />
116
126
  <p class="source-link">[ <a href="javascript:toggleSource('M000002_source')" id="l_M000002_source">show source</a> ]</p>
117
127
  <div id="M000002_source" class="dyn-source">
118
128
  <pre>
119
- <span class="ruby-comment cmt"># File lib/folio.rb, line 24</span>
129
+ <span class="ruby-comment cmt"># File lib/folio.rb, line 31</span>
120
130
  <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-operator">[]</span>(<span class="ruby-operator">*</span><span class="ruby-identifier">path</span>)
121
131
  <span class="ruby-constant">Prompt</span>.<span class="ruby-identifier">new</span>(<span class="ruby-operator">*</span><span class="ruby-identifier">path</span>)
122
132
  <span class="ruby-keyword kw">end</span>
@@ -132,7 +142,7 @@ Class <a href="Folio/Socket.html" class="link">Folio::Socket</a><br />
132
142
  <p class="source-link">[ <a href="javascript:toggleSource('M000001_source')" id="l_M000001_source">show source</a> ]</p>
133
143
  <div id="M000001_source" class="dyn-source">
134
144
  <pre>
135
- <span class="ruby-comment cmt"># File lib/folio.rb, line 20</span>
145
+ <span class="ruby-comment cmt"># File lib/folio.rb, line 27</span>
136
146
  <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">file</span>(<span class="ruby-operator">*</span><span class="ruby-identifier">path</span>)
137
147
  <span class="ruby-constant">FileObject</span>[<span class="ruby-operator">*</span><span class="ruby-identifier">path</span>]
138
148
  <span class="ruby-keyword kw">end</span>
@@ -86,7 +86,7 @@ Block device
86
86
 
87
87
  <div class="sectiontitle">Methods</div>
88
88
  <ul>
89
- <li><a href="#M000031">blockdev?</a></li>
89
+ <li><a href="#M000035">blockdev?</a></li>
90
90
  </ul>
91
91
 
92
92
 
@@ -97,11 +97,11 @@ Block device
97
97
  <div class="sectiontitle">Public Instance methods</div>
98
98
  <div class="method">
99
99
  <div class="title">
100
- <a name="M000031"></a><b>blockdev?</b>()
100
+ <a name="M000035"></a><b>blockdev?</b>()
101
101
  </div>
102
102
  <div class="sourcecode">
103
- <p class="source-link">[ <a href="javascript:toggleSource('M000031_source')" id="l_M000031_source">show source</a> ]</p>
104
- <div id="M000031_source" class="dyn-source">
103
+ <p class="source-link">[ <a href="javascript:toggleSource('M000035_source')" id="l_M000035_source">show source</a> ]</p>
104
+ <div id="M000035_source" class="dyn-source">
105
105
  <pre>
106
106
  <span class="ruby-comment cmt"># File lib/folio/device.rb, line 24</span>
107
107
  <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">blockdev?</span> ; <span class="ruby-keyword kw">true</span> ; <span class="ruby-keyword kw">end</span>
@@ -86,7 +86,7 @@ Character device
86
86
 
87
87
  <div class="sectiontitle">Methods</div>
88
88
  <ul>
89
- <li><a href="#M000139">chardev?</a></li>
89
+ <li><a href="#M000149">chardev?</a></li>
90
90
  </ul>
91
91
 
92
92
 
@@ -97,11 +97,11 @@ Character device
97
97
  <div class="sectiontitle">Public Instance methods</div>
98
98
  <div class="method">
99
99
  <div class="title">
100
- <a name="M000139"></a><b>chardev?</b>()
100
+ <a name="M000149"></a><b>chardev?</b>()
101
101
  </div>
102
102
  <div class="sourcecode">
103
- <p class="source-link">[ <a href="javascript:toggleSource('M000139_source')" id="l_M000139_source">show source</a> ]</p>
104
- <div id="M000139_source" class="dyn-source">
103
+ <p class="source-link">[ <a href="javascript:toggleSource('M000149_source')" id="l_M000149_source">show source</a> ]</p>
104
+ <div id="M000149_source" class="dyn-source">
105
105
  <pre>
106
106
  <span class="ruby-comment cmt"># File lib/folio/device.rb, line 17</span>
107
107
  <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">chardev?</span> ; <span class="ruby-keyword kw">true</span> ; <span class="ruby-keyword kw">end</span>
@@ -82,8 +82,8 @@ FileObject
82
82
 
83
83
  <div class="sectiontitle">Methods</div>
84
84
  <ul>
85
- <li><a href="#M000030">+</a></li>
86
- <li><a href="#M000029">/</a></li>
85
+ <li><a href="#M000034">+</a></li>
86
+ <li><a href="#M000033">/</a></li>
87
87
  <li><a href="#M000024">cd</a></li>
88
88
  <li><a href="#M000023">chdir</a></li>
89
89
  <li><a href="#M000021">chmod_r</a></li>
@@ -91,11 +91,15 @@ FileObject
91
91
  <li><a href="#M000025">chroot</a></li>
92
92
  <li><a href="#M000015">cp_r</a></li>
93
93
  <li><a href="#M000018">delete</a></li>
94
+ <li><a href="#M000032">directories</a></li>
94
95
  <li><a href="#M000014">directory?</a></li>
95
- <li><a href="#M000026">entries</a></li>
96
- <li><a href="#M000027">foreach</a></li>
96
+ <li><a href="#M000029">directory_entries</a></li>
97
+ <li><a href="#M000028">document_entries</a></li>
98
+ <li><a href="#M000031">documents</a></li>
99
+ <li><a href="#M000027">entries</a></li>
100
+ <li><a href="#M000030">files</a></li>
101
+ <li><a href="#M000026">foreach</a></li>
97
102
  <li><a href="#M000013">new</a></li>
98
- <li><a href="#M000028">paths</a></li>
99
103
  <li><a href="#M000019">rm_r</a></li>
100
104
  <li><a href="#M000020">rm_rf</a></li>
101
105
  <li><a href="#M000016">rmdir</a></li>
@@ -128,7 +132,7 @@ FileObject
128
132
  <div class="sectiontitle">Public Instance methods</div>
129
133
  <div class="method">
130
134
  <div class="title">
131
- <a name="M000030"></a><b>+</b>(fname)
135
+ <a name="M000034"></a><b>+</b>(fname)
132
136
  </div>
133
137
  <div class="description">
134
138
  <p>
@@ -138,22 +142,22 @@ Alias for #/
138
142
  </div>
139
143
  <div class="method">
140
144
  <div class="title">
141
- <a name="M000029"></a><b>/</b>(fname)
145
+ <a name="M000033"></a><b>/</b>(fname)
142
146
  </div>
143
147
  <div class="description">
144
148
  <p>
145
- Join <a href="Directory.html#M000028">paths</a>.
149
+ Join path and return <a href="Directory.html#M000013">new</a> file object.
146
150
  </p>
147
151
  </div>
148
152
  <div class="aka">
149
153
  This method is also aliased as
150
- <a href="Directory.html#M000030">+</a>
154
+ <a href="Directory.html#M000034">+</a>
151
155
  </div>
152
156
  <div class="sourcecode">
153
- <p class="source-link">[ <a href="javascript:toggleSource('M000029_source')" id="l_M000029_source">show source</a> ]</p>
154
- <div id="M000029_source" class="dyn-source">
157
+ <p class="source-link">[ <a href="javascript:toggleSource('M000033_source')" id="l_M000033_source">show source</a> ]</p>
158
+ <div id="M000033_source" class="dyn-source">
155
159
  <pre>
156
- <span class="ruby-comment cmt"># File lib/folio/directory.rb, line 75</span>
160
+ <span class="ruby-comment cmt"># File lib/folio/directory.rb, line 118</span>
157
161
  <span class="ruby-keyword kw">def</span> <span class="ruby-operator">/</span>(<span class="ruby-identifier">fname</span>)
158
162
  <span class="ruby-constant">FileObject</span>[<span class="ruby-identifier">path</span>, <span class="ruby-identifier">fname</span>]
159
163
  <span class="ruby-keyword kw">end</span>
@@ -175,6 +179,11 @@ Alias for <a href="Directory.html#M000023">chdir</a>
175
179
  <div class="title">
176
180
  <a name="M000023"></a><b>chdir</b>(&amp;block)
177
181
  </div>
182
+ <div class="description">
183
+ <p>
184
+ Change into this directory.
185
+ </p>
186
+ </div>
178
187
  <div class="aka">
179
188
  This method is also aliased as
180
189
  <a href="Directory.html#M000024">cd</a>
@@ -183,7 +192,7 @@ Alias for <a href="Directory.html#M000023">chdir</a>
183
192
  <p class="source-link">[ <a href="javascript:toggleSource('M000023_source')" id="l_M000023_source">show source</a> ]</p>
184
193
  <div id="M000023_source" class="dyn-source">
185
194
  <pre>
186
- <span class="ruby-comment cmt"># File lib/folio/directory.rb, line 51</span>
195
+ <span class="ruby-comment cmt"># File lib/folio/directory.rb, line 69</span>
187
196
  <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">chdir</span>(<span class="ruby-operator">&amp;</span><span class="ruby-identifier">block</span>)
188
197
  <span class="ruby-operator">::</span><span class="ruby-constant">Dir</span>.<span class="ruby-identifier">chdir</span>(<span class="ruby-identifier">path</span>, <span class="ruby-operator">&amp;</span><span class="ruby-identifier">block</span>)
189
198
  <span class="ruby-keyword kw">end</span>
@@ -195,11 +204,16 @@ Alias for <a href="Directory.html#M000023">chdir</a>
195
204
  <div class="title">
196
205
  <a name="M000021"></a><b>chmod_r</b>(mode)
197
206
  </div>
207
+ <div class="description">
208
+ <p>
209
+ Change the mode of this directory and all it&#8216;s content recursively.
210
+ </p>
211
+ </div>
198
212
  <div class="sourcecode">
199
213
  <p class="source-link">[ <a href="javascript:toggleSource('M000021_source')" id="l_M000021_source">show source</a> ]</p>
200
214
  <div id="M000021_source" class="dyn-source">
201
215
  <pre>
202
- <span class="ruby-comment cmt"># File lib/folio/directory.rb, line 37</span>
216
+ <span class="ruby-comment cmt"># File lib/folio/directory.rb, line 52</span>
203
217
  <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">chmod_r</span>(<span class="ruby-identifier">mode</span>)
204
218
  <span class="ruby-identifier">util</span>.<span class="ruby-identifier">chmod_r</span>(<span class="ruby-identifier">mode</span>, <span class="ruby-identifier">path</span>)
205
219
  <span class="ruby-keyword kw">end</span>
@@ -213,14 +227,14 @@ Alias for <a href="Directory.html#M000023">chdir</a>
213
227
  </div>
214
228
  <div class="description">
215
229
  <p>
216
- alias_method :chmod_R, :<a href="Directory.html#M000021">chmod_r</a>
230
+ Change the owner of this directory and all it&#8216;s content recursively.
217
231
  </p>
218
232
  </div>
219
233
  <div class="sourcecode">
220
234
  <p class="source-link">[ <a href="javascript:toggleSource('M000022_source')" id="l_M000022_source">show source</a> ]</p>
221
235
  <div id="M000022_source" class="dyn-source">
222
236
  <pre>
223
- <span class="ruby-comment cmt"># File lib/folio/directory.rb, line 42</span>
237
+ <span class="ruby-comment cmt"># File lib/folio/directory.rb, line 59</span>
224
238
  <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">chown_r</span>(<span class="ruby-identifier">user</span>, <span class="ruby-identifier">group</span>)
225
239
  <span class="ruby-identifier">util</span>.<span class="ruby-identifier">chown_r</span>(<span class="ruby-identifier">user</span>, <span class="ruby-identifier">group</span>, <span class="ruby-identifier">path</span>)
226
240
  <span class="ruby-keyword kw">end</span>
@@ -232,11 +246,16 @@ alias_method :chmod_R, :<a href="Directory.html#M000021">chmod_r</a>
232
246
  <div class="title">
233
247
  <a name="M000025"></a><b>chroot</b>(&amp;block)
234
248
  </div>
249
+ <div class="description">
250
+ <p>
251
+ Make this directory the file system root.
252
+ </p>
253
+ </div>
235
254
  <div class="sourcecode">
236
255
  <p class="source-link">[ <a href="javascript:toggleSource('M000025_source')" id="l_M000025_source">show source</a> ]</p>
237
256
  <div id="M000025_source" class="dyn-source">
238
257
  <pre>
239
- <span class="ruby-comment cmt"># File lib/folio/directory.rb, line 56</span>
258
+ <span class="ruby-comment cmt"># File lib/folio/directory.rb, line 75</span>
240
259
  <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">chroot</span>(<span class="ruby-operator">&amp;</span><span class="ruby-identifier">block</span>)
241
260
  <span class="ruby-operator">::</span><span class="ruby-constant">Dir</span>.<span class="ruby-identifier">chroot</span>(<span class="ruby-identifier">path</span>, <span class="ruby-operator">&amp;</span><span class="ruby-identifier">block</span>)
242
261
  <span class="ruby-keyword kw">end</span>
@@ -250,7 +269,7 @@ alias_method :chmod_R, :<a href="Directory.html#M000021">chmod_r</a>
250
269
  </div>
251
270
  <div class="description">
252
271
  <p>
253
- Copy recursively.
272
+ Copy this directory recursively to destination.
254
273
  </p>
255
274
  </div>
256
275
  <div class="sourcecode">
@@ -275,6 +294,28 @@ Alias for <a href="Directory.html#M000016">rmdir</a>
275
294
  </p>
276
295
  </div>
277
296
  </div>
297
+ <div class="method">
298
+ <div class="title">
299
+ <a name="M000032"></a><b>directories</b>()
300
+ </div>
301
+ <div class="description">
302
+ <p>
303
+ Returns an <a href="../Enumerator.html">Enumerator</a> over all <a
304
+ href="Directory.html#M000032">directories</a> in the directory.
305
+ </p>
306
+ </div>
307
+ <div class="sourcecode">
308
+ <p class="source-link">[ <a href="javascript:toggleSource('M000032_source')" id="l_M000032_source">show source</a> ]</p>
309
+ <div id="M000032_source" class="dyn-source">
310
+ <pre>
311
+ <span class="ruby-comment cmt"># File lib/folio/directory.rb, line 113</span>
312
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">directories</span>
313
+ <span class="ruby-identifier">directory_entries</span>.<span class="ruby-identifier">to_enum</span>(<span class="ruby-identifier">:each</span>){ <span class="ruby-operator">|</span><span class="ruby-identifier">f</span><span class="ruby-operator">|</span> <span class="ruby-constant">FileObject</span>[<span class="ruby-identifier">path</span>, <span class="ruby-identifier">f</span>] }
314
+ <span class="ruby-keyword kw">end</span>
315
+ </pre>
316
+ </div>
317
+ </div>
318
+ </div>
278
319
  <div class="method">
279
320
  <div class="title">
280
321
  <a name="M000014"></a><b>directory?</b>()
@@ -291,22 +332,65 @@ Alias for <a href="Directory.html#M000016">rmdir</a>
291
332
  </div>
292
333
  <div class="method">
293
334
  <div class="title">
294
- <a name="M000026"></a><b>entries</b>()
335
+ <a name="M000029"></a><b>directory_entries</b>()
295
336
  </div>
296
337
  <div class="description">
297
338
  <p>
298
- <a href="Directory.html">Directory</a> <a
299
- href="Directory.html#M000026">entries</a>. This returns a list of file
300
- names.
339
+ Returns a list of directory names. This does not include &#8217;.&#8217; or
340
+ &#8217;..&#8217;.
301
341
  </p>
302
342
  </div>
303
343
  <div class="sourcecode">
304
- <p class="source-link">[ <a href="javascript:toggleSource('M000026_source')" id="l_M000026_source">show source</a> ]</p>
305
- <div id="M000026_source" class="dyn-source">
344
+ <p class="source-link">[ <a href="javascript:toggleSource('M000029_source')" id="l_M000029_source">show source</a> ]</p>
345
+ <div id="M000029_source" class="dyn-source">
306
346
  <pre>
307
- <span class="ruby-comment cmt"># File lib/folio/directory.rb, line 61</span>
308
- <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">entries</span>
309
- <span class="ruby-operator">::</span><span class="ruby-constant">Dir</span>.<span class="ruby-identifier">entries</span>(<span class="ruby-identifier">path</span>)
347
+ <span class="ruby-comment cmt"># File lib/folio/directory.rb, line 97</span>
348
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">directory_entries</span>
349
+ <span class="ruby-identifier">dirs</span> = <span class="ruby-operator">::</span><span class="ruby-constant">Dir</span>.<span class="ruby-identifier">glob</span>(<span class="ruby-node">&quot;#{path}/&quot;</span>)
350
+ <span class="ruby-identifier">dirs</span>.<span class="ruby-identifier">collect</span>{ <span class="ruby-operator">|</span><span class="ruby-identifier">f</span><span class="ruby-operator">|</span> <span class="ruby-identifier">f</span>.<span class="ruby-identifier">chomp</span>(<span class="ruby-value str">'/'</span>) }
351
+ <span class="ruby-keyword kw">end</span>
352
+ </pre>
353
+ </div>
354
+ </div>
355
+ </div>
356
+ <div class="method">
357
+ <div class="title">
358
+ <a name="M000028"></a><b>document_entries</b>()
359
+ </div>
360
+ <div class="description">
361
+ <p>
362
+ Returns a list of document names.
363
+ </p>
364
+ </div>
365
+ <div class="sourcecode">
366
+ <p class="source-link">[ <a href="javascript:toggleSource('M000028_source')" id="l_M000028_source">show source</a> ]</p>
367
+ <div id="M000028_source" class="dyn-source">
368
+ <pre>
369
+ <span class="ruby-comment cmt"># File lib/folio/directory.rb, line 91</span>
370
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">document_entries</span>
371
+ <span class="ruby-identifier">entries</span>.<span class="ruby-identifier">select</span>{<span class="ruby-operator">|</span><span class="ruby-identifier">f</span><span class="ruby-operator">|</span> <span class="ruby-constant">File</span>.<span class="ruby-identifier">file?</span>(<span class="ruby-constant">File</span>.<span class="ruby-identifier">join</span>(<span class="ruby-identifier">path</span>,<span class="ruby-identifier">f</span>)) }
372
+ <span class="ruby-keyword kw">end</span>
373
+ </pre>
374
+ </div>
375
+ </div>
376
+ </div>
377
+ <div class="method">
378
+ <div class="title">
379
+ <a name="M000031"></a><b>documents</b>()
380
+ </div>
381
+ <div class="description">
382
+ <p>
383
+ Returns an <a href="../Enumerator.html">Enumerator</a> over all <a
384
+ href="Directory.html#M000031">documents</a> in the directory.
385
+ </p>
386
+ </div>
387
+ <div class="sourcecode">
388
+ <p class="source-link">[ <a href="javascript:toggleSource('M000031_source')" id="l_M000031_source">show source</a> ]</p>
389
+ <div id="M000031_source" class="dyn-source">
390
+ <pre>
391
+ <span class="ruby-comment cmt"># File lib/folio/directory.rb, line 108</span>
392
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">documents</span>
393
+ <span class="ruby-identifier">document_entries</span>.<span class="ruby-identifier">to_enum</span>(<span class="ruby-identifier">:each</span>){ <span class="ruby-operator">|</span><span class="ruby-identifier">f</span><span class="ruby-operator">|</span> <span class="ruby-constant">FileObject</span>[<span class="ruby-identifier">path</span>, <span class="ruby-identifier">f</span>] }
310
394
  <span class="ruby-keyword kw">end</span>
311
395
  </pre>
312
396
  </div>
@@ -314,15 +398,21 @@ names.
314
398
  </div>
315
399
  <div class="method">
316
400
  <div class="title">
317
- <a name="M000027"></a><b>foreach</b>(&amp;block)
401
+ <a name="M000027"></a><b>entries</b>()
402
+ </div>
403
+ <div class="description">
404
+ <p>
405
+ This returns a list of file names. Unlike traditional Dir.entries method,
406
+ this does not include &#8217;.&#8217; or &#8217;..&#8217;.
407
+ </p>
318
408
  </div>
319
409
  <div class="sourcecode">
320
410
  <p class="source-link">[ <a href="javascript:toggleSource('M000027_source')" id="l_M000027_source">show source</a> ]</p>
321
411
  <div id="M000027_source" class="dyn-source">
322
412
  <pre>
323
- <span class="ruby-comment cmt"># File lib/folio/directory.rb, line 65</span>
324
- <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">foreach</span>(<span class="ruby-operator">&amp;</span><span class="ruby-identifier">block</span>)
325
- <span class="ruby-operator">::</span><span class="ruby-constant">Dir</span>.<span class="ruby-identifier">foreach</span>(<span class="ruby-identifier">path</span>, <span class="ruby-operator">&amp;</span><span class="ruby-identifier">block</span>)
413
+ <span class="ruby-comment cmt"># File lib/folio/directory.rb, line 86</span>
414
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">entries</span>
415
+ <span class="ruby-operator">::</span><span class="ruby-constant">Dir</span>.<span class="ruby-identifier">entries</span>(<span class="ruby-identifier">path</span>) <span class="ruby-operator">-</span> [<span class="ruby-value str">'.'</span>, <span class="ruby-value str">'..'</span>]
326
416
  <span class="ruby-keyword kw">end</span>
327
417
  </pre>
328
418
  </div>
@@ -330,20 +420,43 @@ names.
330
420
  </div>
331
421
  <div class="method">
332
422
  <div class="title">
333
- <a name="M000028"></a><b>paths</b>()
423
+ <a name="M000030"></a><b>files</b>()
334
424
  </div>
335
425
  <div class="description">
336
426
  <p>
337
- TODO: use enumerator (?)
427
+ Returns an <a href="../Enumerator.html">Enumerator</a> over all file
428
+ objects in the directory.
338
429
  </p>
339
430
  </div>
340
431
  <div class="sourcecode">
341
- <p class="source-link">[ <a href="javascript:toggleSource('M000028_source')" id="l_M000028_source">show source</a> ]</p>
342
- <div id="M000028_source" class="dyn-source">
432
+ <p class="source-link">[ <a href="javascript:toggleSource('M000030_source')" id="l_M000030_source">show source</a> ]</p>
433
+ <div id="M000030_source" class="dyn-source">
434
+ <pre>
435
+ <span class="ruby-comment cmt"># File lib/folio/directory.rb, line 103</span>
436
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">files</span>
437
+ <span class="ruby-identifier">entries</span>.<span class="ruby-identifier">to_enum</span>(<span class="ruby-identifier">:each</span>){ <span class="ruby-operator">|</span><span class="ruby-identifier">f</span><span class="ruby-operator">|</span> <span class="ruby-constant">FileObject</span>[<span class="ruby-identifier">path</span>, <span class="ruby-identifier">f</span>] }
438
+ <span class="ruby-keyword kw">end</span>
439
+ </pre>
440
+ </div>
441
+ </div>
442
+ </div>
443
+ <div class="method">
444
+ <div class="title">
445
+ <a name="M000026"></a><b>foreach</b>(&amp;block)
446
+ </div>
447
+ <div class="description">
448
+ <p>
449
+ Loop over the <a href="Directory.html#M000027">entries</a> (this does
450
+ includes &#8217;.&#8217; and &#8217;..&#8217;).
451
+ </p>
452
+ </div>
453
+ <div class="sourcecode">
454
+ <p class="source-link">[ <a href="javascript:toggleSource('M000026_source')" id="l_M000026_source">show source</a> ]</p>
455
+ <div id="M000026_source" class="dyn-source">
343
456
  <pre>
344
- <span class="ruby-comment cmt"># File lib/folio/directory.rb, line 70</span>
345
- <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">paths</span>
346
- (<span class="ruby-operator">::</span><span class="ruby-constant">Dir</span>.<span class="ruby-identifier">entries</span>(<span class="ruby-identifier">path</span>) <span class="ruby-operator">-</span> [<span class="ruby-value str">'.'</span>, <span class="ruby-value str">'..'</span>]).<span class="ruby-identifier">collect</span>{ <span class="ruby-operator">|</span><span class="ruby-identifier">f</span><span class="ruby-operator">|</span> <span class="ruby-constant">FileObject</span>[<span class="ruby-identifier">path</span>, <span class="ruby-identifier">f</span>] }
457
+ <span class="ruby-comment cmt"># File lib/folio/directory.rb, line 80</span>
458
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">foreach</span>(<span class="ruby-operator">&amp;</span><span class="ruby-identifier">block</span>)
459
+ <span class="ruby-operator">::</span><span class="ruby-constant">Dir</span>.<span class="ruby-identifier">foreach</span>(<span class="ruby-identifier">path</span>, <span class="ruby-operator">&amp;</span><span class="ruby-identifier">block</span>)
347
460
  <span class="ruby-keyword kw">end</span>
348
461
  </pre>
349
462
  </div>
@@ -353,11 +466,16 @@ TODO: use enumerator (?)
353
466
  <div class="title">
354
467
  <a name="M000019"></a><b>rm_r</b>()
355
468
  </div>
469
+ <div class="description">
470
+ <p>
471
+ Remove this directory and all it&#8216;s content.
472
+ </p>
473
+ </div>
356
474
  <div class="sourcecode">
357
475
  <p class="source-link">[ <a href="javascript:toggleSource('M000019_source')" id="l_M000019_source">show source</a> ]</p>
358
476
  <div id="M000019_source" class="dyn-source">
359
477
  <pre>
360
- <span class="ruby-comment cmt"># File lib/folio/directory.rb, line 29</span>
478
+ <span class="ruby-comment cmt"># File lib/folio/directory.rb, line 31</span>
361
479
  <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">rm_r</span>
362
480
  <span class="ruby-identifier">util</span>.<span class="ruby-identifier">rm_r</span>(<span class="ruby-identifier">path</span>)
363
481
  <span class="ruby-keyword kw">end</span>
@@ -369,11 +487,16 @@ TODO: use enumerator (?)
369
487
  <div class="title">
370
488
  <a name="M000020"></a><b>rm_rf</b>(list)
371
489
  </div>
490
+ <div class="description">
491
+ <p>
492
+ Remove this directory and all it&#8216;s content forcefully.
493
+ </p>
494
+ </div>
372
495
  <div class="sourcecode">
373
496
  <p class="source-link">[ <a href="javascript:toggleSource('M000020_source')" id="l_M000020_source">show source</a> ]</p>
374
497
  <div id="M000020_source" class="dyn-source">
375
498
  <pre>
376
- <span class="ruby-comment cmt"># File lib/folio/directory.rb, line 33</span>
499
+ <span class="ruby-comment cmt"># File lib/folio/directory.rb, line 36</span>
377
500
  <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">rm_rf</span>(<span class="ruby-identifier">list</span>)
378
501
  <span class="ruby-identifier">util</span>.<span class="ruby-identifier">rm_rf</span>(<span class="ruby-identifier">path</span>)
379
502
  <span class="ruby-keyword kw">end</span>
@@ -385,6 +508,11 @@ TODO: use enumerator (?)
385
508
  <div class="title">
386
509
  <a name="M000016"></a><b>rmdir</b>()
387
510
  </div>
511
+ <div class="description">
512
+ <p>
513
+ Remove this directory. Fails if not empty.
514
+ </p>
515
+ </div>
388
516
  <div class="aka">
389
517
  This method is also aliased as
390
518
  <a href="Directory.html#M000017">unlink</a>
@@ -394,7 +522,7 @@ TODO: use enumerator (?)
394
522
  <p class="source-link">[ <a href="javascript:toggleSource('M000016_source')" id="l_M000016_source">show source</a> ]</p>
395
523
  <div id="M000016_source" class="dyn-source">
396
524
  <pre>
397
- <span class="ruby-comment cmt"># File lib/folio/directory.rb, line 22</span>
525
+ <span class="ruby-comment cmt"># File lib/folio/directory.rb, line 23</span>
398
526
  <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">rmdir</span>
399
527
  <span class="ruby-identifier">util</span>.<span class="ruby-identifier">rmdir</span>(<span class="ruby-identifier">path</span>)
400
528
  <span class="ruby-keyword kw">end</span>