<commit_before>require 'smart_properties'
require 'erb'
require 'tempfile'
require 'singleton'

require 'blacksmith/font'
require 'blacksmith/font_builder'
require 'blacksmith/font_forge'
require 'blacksmith/glyph'
require 'blacksmith/version'

module Blacksmith
  
  Point = Struct.new(:x, :y)
  
  class << self
    
    def forge(filename = nil, &block)
      font         = create_font(&block)
      instructions = create_forging_instructions(font)
      
      FontForge.execute(instructions)
    end
    
    private
    
      def create_font(&block)
        FontBuilder.new(&block).build
      end
      
      def create_forging_instructions(font)
        font.instance_exec(forging_template) do |template|
          template.result(binding)
        end
      end
      
      def forging_template
        ERB.new(template, nil, '<>')
        template = File.read(File.join(root_directory, 'support', 'forging_instructions.py.erb'))
      end
      
      def root_directory
        File.expand_path('../..', __FILE__)
      end
    
  end
end<commit_msg>Fixes a template rendering issuee<commit_after>require 'smart_properties'
require 'erb'
require 'tempfile'
require 'singleton'

require 'blacksmith/font'
require 'blacksmith/font_builder'
require 'blacksmith/font_forge'
require 'blacksmith/glyph'
require 'blacksmith/version'

module Blacksmith
  
  Point = Struct.new(:x, :y)
  
  class << self
    
    def forge(filename = nil, &block)
      font         = create_font(&block)
      instructions = create_forging_instructions(font)
      
      FontForge.execute(instructions)
    end
    
    private
    
      def create_font(&block)
        FontBuilder.new(&block).build
      end
      
      def create_forging_instructions(font)
        font.instance_exec(forging_template) do |template|
          template.result(binding)
        end
      end
      
      def forging_template
        template = File.read(File.join(root_directory, 'support', 'forging_instructions.py.erb'))
        ERB.new(template)
      end
      
      def root_directory
        File.expand_path('../..', __FILE__)
      end
    
  end
end
{'fraction_non_alphanumeric': 0.09358914365933552, 'fraction_numerical': 0.0, 'mean_word_length': 2.5692821368948247, 'pattern_counts': {'":': 0, '<': 8, '<?xml version=': 0, '>': 4, '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': '5677393', 'n_tokens_mistral': 654, 'n_tokens_neox': 651, 'n_words': 130}