<commit_before>require 'YAML'

module Skeletor
  
  module Templates
    
    class Skeleton
      
      def initialize(template)
        
        begin
          @template = Loader.loadTemplate(template)
          @directory_structure = @template["directory_structure"] || {}
          @tasks = @template["tasks"] || {}
          @includes = @template["includes"] || {}
        rescue LoadError => e
          puts e.message
          exit
        end
          
      end
      
      def directory_structure
        @directory_structure
      end
      
      def tasks
        @tasks
      end
      
      def includes
        @includes
      end
      
    end
    
    class Loader
      
      TEMPLATE_PATH = File.expand_path(File.join(File.dirname(__FILE__), "templates"))
      USER_TEMPLATE_PATH = File.expand_path('~/.skeletor/templates')
       
      def self.loadTemplate(template)
        
        if File.exists?(template) && !File.is_directory?(template)
          skeleton = YAML.load_file(template)
        elsif File.exists?(File.join(template,template + '.yml'))
          skeleton = YAML.load_file(File.join(template,template + '.yml'))
        elsif File.exists?(File.join(USER_TEMPLATE_PATH,template,template+'.yml'))
          skeleton = YAML.load_file(File.join(USER_TEMPLATE_PATH,template,template+'.yml'))
        elsif File.exists?(File.join(TEMPLATE_PATH,template,template+'.yml'))
          skeleton = YAML.load_file(File.join(TEMPLATE_PATH,template,template+'.yml'))
        else
          raise LoadError, 'Template File Could Not Be Found'
        end
        
      end
      
    end
    
  end
  
end<commit_msg>Fixed problem with loading local path.  Added path property to Skeleton class<commit_after>require 'YAML'

module Skeletor
  
  module Templates
    
    class Skeleton
      
      def initialize(template)
        
        begin
          @template = Loader.loadTemplate(template)
          @directory_structure = @template["directory_structure"] || {}
          @tasks = @template["tasks"] || {}
          @includes = @template["includes"] || {}
          @path = @template["path"]
        rescue LoadError => e
          puts e.message
          exit
        end
          
      end
      
      def directory_structure
        @directory_structure
      end
      
      def tasks
        @tasks
      end
      
      def includes
        @includes
      end
      
      def path
        @path
      end
      
    end
    
    class Loader
      
      TEMPLATE_PATH = File.expand_path(File.join(File.dirname(__FILE__), "templates"))
      USER_TEMPLATE_PATH = File.expand_path('~/.skeletor/templates')
       
      def self.loadTemplate(template)
        
        if File.exists?(template) && !File.directory?(template)
          skeleton = YAML.load_file(template)
          path = File.dirname(template)
        elsif File.exists?(File.join(template,File.basename(template) + '.yml'))
          skeleton = YAML.load_file(File.join(template,File.basename(template) + '.yml'))
          path = template
        elsif File.exists?(File.join(USER_TEMPLATE_PATH,template,template+'.yml'))
          skeleton = YAML.load_file(File.join(USER_TEMPLATE_PATH,template,template+'.yml'))
          path = File.join(USER_TEMPLATE_PATH,template)
        elsif File.exists?(File.join(TEMPLATE_PATH,template,template+'.yml'))
          skeleton = YAML.load_file(File.join(TEMPLATE_PATH,template,template+'.yml'))
          path = File.join(TEMPLATE_PATH,template)
        else
          raise LoadError, 'Template File Could Not Be Found'
        end
        
        skeleton['path'] = path
        
        return skeleton
        
      end
      
    end
    
  end
  
end
{'fraction_non_alphanumeric': 0.10123523093447906, 'fraction_numerical': 0.0, 'mean_word_length': 1.984775641025641, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1971932', 'n_tokens_mistral': 1093, 'n_tokens_neox': 1073, 'n_words': 192}