oofile 0.0.1 → 0.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/README.rdoc CHANGED
@@ -5,8 +5,9 @@ oofile is an object-oriented way of accessing the filesystem.
5
5
  * Install with:
6
6
  gem install oofile
7
7
  * Basic operation can be seen in demo.rdoc
8
- * *source* http://github.com/dafydd/sitebuilder
9
- * To build me, set an environment variable called *SANDBOX* to the directory above your sitebuilder directory. The tests need this pathname to access test data.
8
+ * *source* http://github.com/dafydd/oofile
9
+ * *rdoc* http://www.greenbarsoft.co.uk/software/oofile/rdoc
10
+ * To build me, set an environment variable called *SANDBOX* to the directory above your oofile top-level directory. The tests need this pathname to access test data.
10
11
 
11
12
  === Compatibility
12
13
  This project is being developed on OS X. Automated testing for Linux will be included in future releases.
data/TODO.rdoc CHANGED
@@ -1,2 +1,2 @@
1
1
  == todo
2
-
2
+ * exclude mocha from rcov coverage
data/doc/demo.rdoc CHANGED
@@ -15,8 +15,8 @@
15
15
  ?> dir_string
16
16
  => "/Users/dev/oofile/test/data"
17
17
  >>
18
- ?> f = OOFile::FsEntry.fs_entry_from(file_string)
19
- => #<OOFile::FileEntry:0x1016a34f0 @path="/Users/dev/oofile/test/data/testfile.txt">
18
+ ?> f = OOFile::FsEntry.from(file_string)
19
+ => #<OOFile::FileEntry:0x1016a37e8 @path="/Users/dev/oofile/test/data/testfile.txt">
20
20
  >>
21
21
  ?> f.extname
22
22
  => ".txt"
@@ -37,13 +37,13 @@
37
37
  => 28
38
38
  >>
39
39
  ?> # equality comparison
40
- ?> f == OOFile::FsEntry.fs_entry_from(file_string)
40
+ ?> f == OOFile::FsEntry.from(file_string)
41
41
  => true
42
42
  >>
43
43
  ?> # directories
44
44
  ?>
45
- ?> d= OOFile::FsEntry.fs_entry_from(dir_string)
46
- => #<OOFile::DirEntry:0x10168a5b8 @path="/Users/dev/oofile/test/data">
45
+ ?> d= OOFile::FsEntry.from(dir_string)
46
+ => #<OOFile::DirEntry:0x10168b120 @path="/Users/dev/oofile/test/data">
47
47
  >>
48
48
  ?> d.extname
49
49
  => ""
data/doc/demo.script CHANGED
@@ -7,7 +7,7 @@ file_string
7
7
 
8
8
  dir_string
9
9
 
10
- f = OOFile::FsEntry.fs_entry_from(file_string)
10
+ f = OOFile::FsEntry.from(file_string)
11
11
 
12
12
  f.extname
13
13
 
@@ -22,11 +22,11 @@ f.ctime
22
22
  f.size
23
23
 
24
24
  # equality comparison
25
- f == OOFile::FsEntry.fs_entry_from(file_string)
25
+ f == OOFile::FsEntry.from(file_string)
26
26
 
27
27
  # directories
28
28
 
29
- d= OOFile::FsEntry.fs_entry_from(dir_string)
29
+ d= OOFile::FsEntry.from(dir_string)
30
30
 
31
31
  d.extname
32
32
 
@@ -41,15 +41,15 @@ module OOFile
41
41
  end
42
42
 
43
43
  # creates a file system entry for a fully qualified pathname
44
- def self.fs_entry_from(f)
44
+ def self.from(f)
45
45
  return FileEntry.new(f) if File.file?(f)
46
46
  return DirEntry.new(f) if File.directory?(f)
47
47
  UnknownEntry.new(f)
48
48
  end
49
49
 
50
50
  # creates a file system entry for a filename in the current file system entry object
51
- def fs_entry_from(fs_entry)
52
- FsEntry.fs_entry_from(File.join(@path, fs_entry))
51
+ def from(fs_entry)
52
+ FsEntry.from(File.join(@path, fs_entry))
53
53
  end
54
54
 
55
55
  end
@@ -74,7 +74,7 @@ module OOFile
74
74
  def traverse(traverser)
75
75
  traverser.traverse_dir(self)
76
76
  Dir.new(@path).each do |stringpath|
77
- subentry = fs_entry_from(stringpath)
77
+ subentry = from(stringpath)
78
78
  subentry.traverse(traverser) unless stringpath=='.' || stringpath=='..'
79
79
  end
80
80
  end
@@ -6,7 +6,7 @@ require 'oofile/filesystem'
6
6
 
7
7
  FS = File::SEPARATOR
8
8
  TEST_DIRNAME = 'data'
9
- TESTDATA_DIR = ENV['SANDBOX']+FS+'sitebuilder'+FS+'test'+FS+TEST_DIRNAME
9
+ TESTDATA_DIR = ENV['SANDBOX']+FS+'oofile'+FS+'test'+FS+TEST_DIRNAME
10
10
  TEST_FILENAME = 'testfile.txt'
11
11
  TEST_FILEPATH = TESTDATA_DIR+FS+TEST_FILENAME
12
12
 
@@ -57,15 +57,15 @@ def test_size
57
57
  end
58
58
 
59
59
  def test_fs_entry_from
60
- assert_equal OOFile::FileEntry, OOFile::FsEntry.fs_entry_from(TEST_FILEPATH).class
61
- assert_equal OOFile::DirEntry, OOFile::FsEntry.fs_entry_from(TESTDATA_DIR).class
62
- assert_equal OOFile::UnknownEntry, OOFile::FsEntry.fs_entry_from('/dev/null').class
60
+ assert_equal OOFile::FileEntry, OOFile::FsEntry.from(TEST_FILEPATH).class
61
+ assert_equal OOFile::DirEntry, OOFile::FsEntry.from(TESTDATA_DIR).class
62
+ assert_equal OOFile::UnknownEntry, OOFile::FsEntry.from('/dev/null').class
63
63
  end
64
64
 
65
65
  def test_instance_fs_entry_from
66
- instance = OOFile::FsEntry.fs_entry_from(TESTDATA_DIR)
67
- file_result = instance.fs_entry_from(TEST_FILENAME)
68
- dir_result = instance.fs_entry_from('.')
66
+ instance = OOFile::FsEntry.from(TESTDATA_DIR)
67
+ file_result = instance.from(TEST_FILENAME)
68
+ dir_result = instance.from('.')
69
69
 
70
70
  assert_equal instance.path+FS+TEST_FILENAME, file_result.path
71
71
  assert_equal instance.path, dir_result.path
@@ -82,7 +82,7 @@ def test_traverse
82
82
  end
83
83
  traverser.expects(:traverse_dir).never()
84
84
 
85
- file = OOFile::FsEntry.fs_entry_from(TEST_FILEPATH)
85
+ file = OOFile::FsEntry.from(TEST_FILEPATH)
86
86
  file.traverse(traverser)
87
87
  end
88
88
 
@@ -99,7 +99,7 @@ class DirEntryTest < Test::Unit::TestCase
99
99
  OOFile::DirEntry==dir.class && TESTDATA_DIR==dir.path
100
100
  end
101
101
 
102
- file = OOFile::FsEntry.fs_entry_from(TESTDATA_DIR)
102
+ file = OOFile::FsEntry.from(TESTDATA_DIR)
103
103
  file.traverse(traverser)
104
104
  end
105
105
 
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: oofile
3
3
  version: !ruby/object:Gem::Version
4
- hash: 29
4
+ hash: 27
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 0
9
- - 1
10
- version: 0.0.1
9
+ - 2
10
+ version: 0.0.2
11
11
  platform: ruby
12
12
  authors:
13
13
  - Dafydd Rees
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-02-26 00:00:00 +00:00
18
+ date: 2011-02-28 00:00:00 +00:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency
@@ -107,6 +107,6 @@ rubyforge_project:
107
107
  rubygems_version: 1.3.7
108
108
  signing_key:
109
109
  specification_version: 3
110
- summary: Static site generator
110
+ summary: Object-oriented, traversable file system representation.
111
111
  test_files:
112
112
  - ./test/filesystem_test.rb