Skip to content

Commit

Permalink
directory? -> dir? to be more consistent
Browse files Browse the repository at this point in the history
  • Loading branch information
Adam Wiggins committed Jan 28, 2008
1 parent 6535c61 commit 8cedf80
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions lib/commands.rb
Expand Up @@ -12,7 +12,7 @@ def vi(*args)
def search(pattern)
results = {}
entries.each do |entry|
if !entry.directory? and m = entry.contents.match(pattern)
if !entry.dir? and m = entry.contents.match(pattern)
results[entry] = m
end
end
Expand All @@ -21,7 +21,7 @@ def search(pattern)

def replace!(pattern, with_text)
entries.each do |entry|
entry.replace!(pattern, with_text) unless entry.directory?
entry.replace!(pattern, with_text) unless entry.dir?
end
end
end
Expand Down
2 changes: 1 addition & 1 deletion lib/dir.rb
@@ -1,6 +1,6 @@
module Rush
class Dir < Entry
def directory?
def dir?
true
end

Expand Down
2 changes: 1 addition & 1 deletion lib/file.rb
@@ -1,6 +1,6 @@
module Rush
class File < Entry
def directory?
def dir?
false
end

Expand Down
2 changes: 1 addition & 1 deletion spec/dir_spec.rb
Expand Up @@ -69,7 +69,7 @@
@dir.find_by_regexp(/\d$/).should == [ file2 ]
end

it "find_subitem finds entries in a subdirectory" do
it "find_subitem finds entries in a subdir" do
file = @dir.create_dir('a/b').create_file('c')
@dir.find_subitem('a/b/c').should == file
end
Expand Down
2 changes: 1 addition & 1 deletion spec/entry_spec.rb
Expand Up @@ -19,7 +19,7 @@
@entry.name.should == File.basename(@filename)
end

it "knows its parent directory" do
it "knows its parent dir" do
@entry.parent.should be_kind_of(Rush::Dir)
@entry.parent.name.should == File.basename(@sandbox_dir)
@entry.parent.full_path.should == @sandbox_dir
Expand Down
4 changes: 2 additions & 2 deletions spec/file_spec.rb
Expand Up @@ -20,8 +20,8 @@
@file.should be_kind_of(Rush::Entry)
end

it "is not a directory" do
@file.should_not be_directory
it "is not a dir" do
@file.should_not be_dir
end

it "knows its size in bytes" do
Expand Down

0 comments on commit 8cedf80

Please sign in to comment.