Skip to content

Commit

Permalink
Merge pull request #122 from yoshiori/support_symlink
Browse files Browse the repository at this point in the history
Ignore symlink directory
  • Loading branch information
mmozuras committed Jan 5, 2016
2 parents a382c3a + 1b0e66a commit b77a0b4
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions lib/pronto/runner.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ def rake_file?(path)
end

def ruby_executable?(path)
return false if File.directory?(path)
line = File.open(path, &:readline)
line =~ /#!.*ruby/
rescue ArgumentError, EOFError
Expand Down
6 changes: 6 additions & 0 deletions spec/pronto/runner_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,12 @@ module Pronto
it { should be_falsy }
end
end

context 'directory' do
let(:path) { 'directory' }
before { File.stub(:directory?).with(path).and_return(true) }
it { should be_falsy }
end
end
end
end

0 comments on commit b77a0b4

Please # to comment.