class DtkCommon::DSL::DirectoryParser::Git

Public Class Methods

implements_method?(method_name) click to toggle source
# File lib/dsl/directory_parser/git.rb, line 30
def self.implements_method?(method_name)
  if DirectoryParserMethods.include?(method_name)
    case method_name
     when :parse_directory
      GitRepo::Branch.implements_method?(:get_file_content)
     else
      true
    end
  end
end
new(directory_type,repo_path,branch='master') click to toggle source

def initialize(repo_path,directory_type,branch='master')

Calls superclass method
# File lib/dsl/directory_parser/git.rb, line 23
     def initialize(directory_type,repo_path,branch='master')
       super(directory_type)
#       puts repo_path
       @repo_path = repo_path
       @repo_branch = GitRepo::Branch.new(repo_path,branch)
     end

Private Instance Methods

all_files_from_root() click to toggle source
# File lib/dsl/directory_parser/git.rb, line 42
      def all_files_from_root()
        # TODO: Watch version here
#        output = `git --git-dir=#{@repo_path} ls-tree --full-tree -r HEAD`
        @repo_branch.list_files()
      end
get_content(file_path) click to toggle source
# File lib/dsl/directory_parser/git.rb, line 47
      def get_content(file_path)
#        output = `git --git-dir=#{@repo_path} show  HEAD:#{file_path}`
#        output = '{}' if output.empty?
#        output
        #If file does not exsist will return nil
        @repo_branch.get_file_content(file_path)
      end