Get files_at_path and directories_at_path working

This checks off files_at_path and directories_at_path as working. Error handling needs to be implemented on the controller end.
Yay!


On Wed, Jul 30, 2014 at 1:51 PM, Lawrence Wu <notifications@github.com>
wrote:

> In lib/repo/git_repository.rb:
>
> > +      # like ['A1', 'src', 'core'] for '/A1/src/core'
> > +      directory_path = path.split('/').select do |dirname|
> > +        # Make sure dirname is not empty string (happens when path
> > +        # is prepended with '/')
> > +        !dirname.blank?
> > +      end
> > +
> > +      # current_tree is the current directory object we are going through
> > +      # Look at rugged documentation for more info on tree objects
> > +      current_tree = @commit.tree
> > +      # While there are still directories to go through to get to path,
> > +      # find the dirname
> > +      while !directory_path.empty?
> > +        current_tree.each do |obj|
> > +          # Look for directory at current tree
> > +          next unless obj[:type] == :tree && obj[:name] == directory_path.first
>
> Actually, I'm wrong. Since Rugged trees include Enumerable they do with
> come with a find!
>
> —
> Reply to this email directly or view it on GitHub
> <https://github.com/MarkUsProject/Markus/pull/1620/files#r15600276>.
>