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
@@ -0,0 +1,15 @@
1
+ --- !ruby/object:RI::ClassDescription
2
+ attributes: []
3
+
4
+ class_methods: []
5
+
6
+ comment:
7
+ constants: []
8
+
9
+ full_name: Enumerator
10
+ includes: []
11
+
12
+ instance_methods: []
13
+
14
+ name: Enumerator
15
+ superclass: Object
@@ -5,7 +5,7 @@ aliases:
5
5
  block_params:
6
6
  comment:
7
7
  - !ruby/struct:SM::Flow::P
8
- body: Join paths.
8
+ body: Join path and return new file object.
9
9
  full_name: Folio::Directory#/
10
10
  is_singleton: false
11
11
  name: /
@@ -29,14 +29,22 @@ instance_methods:
29
29
  name: cp_r
30
30
  - !ruby/object:RI::MethodSummary
31
31
  name: delete
32
+ - !ruby/object:RI::MethodSummary
33
+ name: directories
32
34
  - !ruby/object:RI::MethodSummary
33
35
  name: directory?
36
+ - !ruby/object:RI::MethodSummary
37
+ name: directory_entries
38
+ - !ruby/object:RI::MethodSummary
39
+ name: document_entries
40
+ - !ruby/object:RI::MethodSummary
41
+ name: documents
34
42
  - !ruby/object:RI::MethodSummary
35
43
  name: entries
36
44
  - !ruby/object:RI::MethodSummary
37
- name: foreach
45
+ name: files
38
46
  - !ruby/object:RI::MethodSummary
39
- name: paths
47
+ name: foreach
40
48
  - !ruby/object:RI::MethodSummary
41
49
  name: rm_r
42
50
  - !ruby/object:RI::MethodSummary
@@ -3,7 +3,9 @@ aliases:
3
3
  - !ruby/object:RI::AliasName
4
4
  name: cd
5
5
  block_params:
6
- comment: ""
6
+ comment:
7
+ - !ruby/struct:SM::Flow::P
8
+ body: Change into this directory.
7
9
  full_name: Folio::Directory#chdir
8
10
  is_singleton: false
9
11
  name: chdir
@@ -3,6 +3,8 @@ aliases: []
3
3
 
4
4
  block_params:
5
5
  comment:
6
+ - !ruby/struct:SM::Flow::P
7
+ body: Change the mode of this directory and all it's content recursively.
6
8
  full_name: Folio::Directory#chmod_r
7
9
  is_singleton: false
8
10
  name: chmod_r
@@ -4,7 +4,7 @@ aliases: []
4
4
  block_params:
5
5
  comment:
6
6
  - !ruby/struct:SM::Flow::P
7
- body: alias_method :chmod_R, :chmod_r
7
+ body: Change the owner of this directory and all it's content recursively.
8
8
  full_name: Folio::Directory#chown_r
9
9
  is_singleton: false
10
10
  name: chown_r
@@ -3,6 +3,8 @@ aliases: []
3
3
 
4
4
  block_params:
5
5
  comment:
6
+ - !ruby/struct:SM::Flow::P
7
+ body: Make this directory the file system root.
6
8
  full_name: Folio::Directory#chroot
7
9
  is_singleton: false
8
10
  name: chroot
@@ -4,7 +4,7 @@ aliases: []
4
4
  block_params:
5
5
  comment:
6
6
  - !ruby/struct:SM::Flow::P
7
- body: Copy recursively.
7
+ body: Copy this directory recursively to destination.
8
8
  full_name: Folio::Directory#cp_r
9
9
  is_singleton: false
10
10
  name: cp_r
@@ -0,0 +1,12 @@
1
+ --- !ruby/object:RI::MethodDescription
2
+ aliases: []
3
+
4
+ block_params:
5
+ comment:
6
+ - !ruby/struct:SM::Flow::P
7
+ body: Returns an Enumerator over all directories in the directory.
8
+ full_name: Folio::Directory#directories
9
+ is_singleton: false
10
+ name: directories
11
+ params: ()
12
+ visibility: public
@@ -0,0 +1,12 @@
1
+ --- !ruby/object:RI::MethodDescription
2
+ aliases: []
3
+
4
+ block_params:
5
+ comment:
6
+ - !ruby/struct:SM::Flow::P
7
+ body: Returns a list of directory names. This does not include '.' or '..'.
8
+ full_name: Folio::Directory#directory_entries
9
+ is_singleton: false
10
+ name: directory_entries
11
+ params: ()
12
+ visibility: public
@@ -0,0 +1,12 @@
1
+ --- !ruby/object:RI::MethodDescription
2
+ aliases: []
3
+
4
+ block_params:
5
+ comment:
6
+ - !ruby/struct:SM::Flow::P
7
+ body: Returns a list of document names.
8
+ full_name: Folio::Directory#document_entries
9
+ is_singleton: false
10
+ name: document_entries
11
+ params: ()
12
+ visibility: public
@@ -0,0 +1,12 @@
1
+ --- !ruby/object:RI::MethodDescription
2
+ aliases: []
3
+
4
+ block_params:
5
+ comment:
6
+ - !ruby/struct:SM::Flow::P
7
+ body: Returns an Enumerator over all documents in the directory.
8
+ full_name: Folio::Directory#documents
9
+ is_singleton: false
10
+ name: documents
11
+ params: ()
12
+ visibility: public
@@ -4,7 +4,7 @@ aliases: []
4
4
  block_params:
5
5
  comment:
6
6
  - !ruby/struct:SM::Flow::P
7
- body: Directory entries. This returns a list of file names.
7
+ body: This returns a list of file names. Unlike traditional Dir.entries method, this does not include '.' or '..'.
8
8
  full_name: Folio::Directory#entries
9
9
  is_singleton: false
10
10
  name: entries
@@ -0,0 +1,12 @@
1
+ --- !ruby/object:RI::MethodDescription
2
+ aliases: []
3
+
4
+ block_params:
5
+ comment:
6
+ - !ruby/struct:SM::Flow::P
7
+ body: Returns an Enumerator over all file objects in the directory.
8
+ full_name: Folio::Directory#files
9
+ is_singleton: false
10
+ name: files
11
+ params: ()
12
+ visibility: public
@@ -3,6 +3,8 @@ aliases: []
3
3
 
4
4
  block_params:
5
5
  comment:
6
+ - !ruby/struct:SM::Flow::P
7
+ body: Loop over the entries (this does includes '.' and '..').
6
8
  full_name: Folio::Directory#foreach
7
9
  is_singleton: false
8
10
  name: foreach
@@ -3,6 +3,8 @@ aliases: []
3
3
 
4
4
  block_params:
5
5
  comment:
6
+ - !ruby/struct:SM::Flow::P
7
+ body: Remove this directory and all it's content.
6
8
  full_name: Folio::Directory#rm_r
7
9
  is_singleton: false
8
10
  name: rm_r
@@ -3,6 +3,8 @@ aliases: []
3
3
 
4
4
  block_params:
5
5
  comment:
6
+ - !ruby/struct:SM::Flow::P
7
+ body: Remove this directory and all it's content forcefully.
6
8
  full_name: Folio::Directory#rm_rf
7
9
  is_singleton: false
8
10
  name: rm_rf
@@ -6,6 +6,8 @@ aliases:
6
6
  name: delete
7
7
  block_params:
8
8
  comment:
9
+ - !ruby/struct:SM::Flow::P
10
+ body: Remove this directory. Fails if not empty.
9
11
  full_name: Folio::Directory#rmdir
10
12
  is_singleton: false
11
13
  name: rmdir
@@ -0,0 +1,12 @@
1
+ --- !ruby/object:RI::MethodDescription
2
+ aliases: []
3
+
4
+ block_params:
5
+ comment:
6
+ - !ruby/struct:SM::Flow::P
7
+ body: "Alias for #append"
8
+ full_name: Folio::Document#<<
9
+ is_singleton: false
10
+ name: "<<"
11
+ params: (string)
12
+ visibility: public
@@ -4,9 +4,9 @@ aliases: []
4
4
  block_params:
5
5
  comment:
6
6
  - !ruby/struct:SM::Flow::P
7
- body: Directory entries.
8
- full_name: Folio::Prompt#paths
7
+ body: "Alias for #write"
8
+ full_name: Folio::Document#<
9
9
  is_singleton: false
10
- name: paths
11
- params: ()
10
+ name: <
11
+ params: (string)
12
12
  visibility: public
@@ -0,0 +1,13 @@
1
+ --- !ruby/object:RI::MethodDescription
2
+ aliases:
3
+ - !ruby/object:RI::AliasName
4
+ name: "<<"
5
+ block_params:
6
+ comment:
7
+ - !ruby/struct:SM::Flow::P
8
+ body: Replace contents of file with string.
9
+ full_name: Folio::Document#append
10
+ is_singleton: false
11
+ name: append
12
+ params: (string)
13
+ visibility: public
@@ -10,14 +10,20 @@ full_name: Folio::Document
10
10
  includes: []
11
11
 
12
12
  instance_methods:
13
+ - !ruby/object:RI::MethodSummary
14
+ name: <
15
+ - !ruby/object:RI::MethodSummary
16
+ name: "<<"
17
+ - !ruby/object:RI::MethodSummary
18
+ name: append
13
19
  - !ruby/object:RI::MethodSummary
14
20
  name: delete
21
+ - !ruby/object:RI::MethodSummary
22
+ name: document?
15
23
  - !ruby/object:RI::MethodSummary
16
24
  name: executable?
17
25
  - !ruby/object:RI::MethodSummary
18
26
  name: executable_real?
19
- - !ruby/object:RI::MethodSummary
20
- name: file?
21
27
  - !ruby/object:RI::MethodSummary
22
28
  name: intialize
23
29
  - !ruby/object:RI::MethodSummary
@@ -30,5 +36,7 @@ instance_methods:
30
36
  name: truncate
31
37
  - !ruby/object:RI::MethodSummary
32
38
  name: unlink
39
+ - !ruby/object:RI::MethodSummary
40
+ name: write
33
41
  name: Document
34
42
  superclass: FileObject
@@ -4,9 +4,9 @@ aliases: []
4
4
  block_params:
5
5
  comment:
6
6
  - !ruby/struct:SM::Flow::P
7
- body: "TODO: use enumerator (?)"
8
- full_name: Folio::Directory#paths
7
+ body: def file? ; true ; end
8
+ full_name: Folio::Document#document?
9
9
  is_singleton: false
10
- name: paths
10
+ name: document?
11
11
  params: ()
12
12
  visibility: public
@@ -0,0 +1,13 @@
1
+ --- !ruby/object:RI::MethodDescription
2
+ aliases:
3
+ - !ruby/object:RI::AliasName
4
+ name: <
5
+ block_params:
6
+ comment:
7
+ - !ruby/struct:SM::Flow::P
8
+ body: Replace contents of file with string.
9
+ full_name: Folio::Document#write
10
+ is_singleton: false
11
+ name: write
12
+ params: (string)
13
+ visibility: public
@@ -56,14 +56,14 @@ instance_methods:
56
56
  name: directory?
57
57
  - !ruby/object:RI::MethodSummary
58
58
  name: dirname
59
+ - !ruby/object:RI::MethodSummary
60
+ name: document?
59
61
  - !ruby/object:RI::MethodSummary
60
62
  name: exist?
61
63
  - !ruby/object:RI::MethodSummary
62
64
  name: exists?
63
65
  - !ruby/object:RI::MethodSummary
64
66
  name: extname
65
- - !ruby/object:RI::MethodSummary
66
- name: file?
67
67
  - !ruby/object:RI::MethodSummary
68
68
  name: fnmatch
69
69
  - !ruby/object:RI::MethodSummary
@@ -3,8 +3,10 @@ aliases: []
3
3
 
4
4
  block_params:
5
5
  comment:
6
- full_name: Folio::FileObject#file?
6
+ - !ruby/struct:SM::Flow::P
7
+ body: def file? ; stat.file? ; end
8
+ full_name: Folio::FileObject#document?
7
9
  is_singleton: false
8
- name: file?
10
+ name: document?
9
11
  params: ()
10
12
  visibility: public
@@ -3,8 +3,10 @@ aliases: []
3
3
 
4
4
  block_params:
5
5
  comment:
6
- full_name: Folio::Prompt#pwd
6
+ - !ruby/struct:SM::Flow::P
7
+ body: "Alias for #file"
8
+ full_name: Folio::Prompt#[]
7
9
  is_singleton: false
8
- name: pwd
9
- params: ()
10
+ name: "[]"
11
+ params: (name)
10
12
  visibility: public
@@ -2,7 +2,9 @@
2
2
  attributes:
3
3
  - !ruby/object:RI::Attribute
4
4
  comment:
5
- name: path
5
+ - !ruby/struct:SM::Flow::P
6
+ body: "@work store the present working directory as a Directory object."
7
+ name: work
6
8
  rw: R
7
9
  class_methods:
8
10
  - !ruby/object:RI::MethodSummary
@@ -23,6 +25,8 @@ instance_methods:
23
25
  name: +
24
26
  - !ruby/object:RI::MethodSummary
25
27
  name: /
28
+ - !ruby/object:RI::MethodSummary
29
+ name: "[]"
26
30
  - !ruby/object:RI::MethodSummary
27
31
  name: cd
28
32
  - !ruby/object:RI::MethodSummary
@@ -39,6 +43,12 @@ instance_methods:
39
43
  name: cp_r
40
44
  - !ruby/object:RI::MethodSummary
41
45
  name: directories
46
+ - !ruby/object:RI::MethodSummary
47
+ name: directory_entries
48
+ - !ruby/object:RI::MethodSummary
49
+ name: document_entries
50
+ - !ruby/object:RI::MethodSummary
51
+ name: documents
42
52
  - !ruby/object:RI::MethodSummary
43
53
  name: entries
44
54
  - !ruby/object:RI::MethodSummary
@@ -69,10 +79,6 @@ instance_methods:
69
79
  name: mode
70
80
  - !ruby/object:RI::MethodSummary
71
81
  name: mv
72
- - !ruby/object:RI::MethodSummary
73
- name: paths
74
- - !ruby/object:RI::MethodSummary
75
- name: pwd
76
82
  - !ruby/object:RI::MethodSummary
77
83
  name: rm
78
84
  - !ruby/object:RI::MethodSummary
@@ -4,7 +4,7 @@ aliases: []
4
4
  block_params:
5
5
  comment:
6
6
  - !ruby/struct:SM::Flow::P
7
- body: Directory entries.
7
+ body: Returns Enumerator of documents.
8
8
  full_name: Folio::Prompt#directories
9
9
  is_singleton: false
10
10
  name: directories
@@ -0,0 +1,12 @@
1
+ --- !ruby/object:RI::MethodDescription
2
+ aliases: []
3
+
4
+ block_params:
5
+ comment:
6
+ - !ruby/struct:SM::Flow::P
7
+ body: Lists directory entries.
8
+ full_name: Folio::Prompt#directory_entries
9
+ is_singleton: false
10
+ name: directory_entries
11
+ params: ()
12
+ visibility: public
@@ -0,0 +1,12 @@
1
+ --- !ruby/object:RI::MethodDescription
2
+ aliases: []
3
+
4
+ block_params:
5
+ comment:
6
+ - !ruby/struct:SM::Flow::P
7
+ body: Lists directory entries.
8
+ full_name: Folio::Prompt#document_entries
9
+ is_singleton: false
10
+ name: document_entries
11
+ params: ()
12
+ visibility: public