<commit_before>module GrapeApiary
  class Blueprint
    attr_reader :api_class, :template

    delegate(*GrapeApiary::Config::SETTINGS, to: 'GrapeApiary::Config')

    def initialize(api_class)
      @api_class = api_class
    end

    def generate
      ERB.new(template).result(binding)
    end

    def write
      fail 'Not yet supported'
    end

    def template
      @template ||= begin
        path = File.expand_path('./templates/blueprint.md.erb', __dir__)

        File.read(path)
      end
    end

    def routes
      @routes ||= api_class.routes.map do |route|
        GrapeApiary::Route.new(route)
      end
    end

    def resources
      @resources ||= begin<commit_msg>Supports loading template on pre Ruby 2.0<commit_after>module GrapeApiary
  class Blueprint
    attr_reader :api_class, :template

    delegate(*GrapeApiary::Config::SETTINGS, to: 'GrapeApiary::Config')

    def initialize(api_class)
      @api_class = api_class
    end

    def generate
      ERB.new(template).result(binding)
    end

    def write
      fail 'Not yet supported'
    end

    def template
      @template ||= begin
        directory = File.dirname(File.expand_path(__FILE__))
        path = File.join(directory, './templates/blueprint.md.erb')

        File.read(path)
      end
    end

    def routes
      @routes ||= api_class.routes.map do |route|
        GrapeApiary::Route.new(route)
      end
    end

    def resources
      @resources ||= begin
{'fraction_non_alphanumeric': 0.09699453551912568, 'fraction_numerical': 0.001366120218579235, 'mean_word_length': 2.496420047732697, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '6412178', 'n_tokens_mistral': 470, 'n_tokens_neox': 450, 'n_words': 105}