<commit_before>module KnifeCookbookReadme
  class ReadmeModel
    DEFAULT_CONSTRAINT = ">= 0.0.0".freeze

    def initialize(metadata, constraints, resources)
      @metadata = metadata
      @constraints = constraints
      @resources = resources
    end

    def resources
      @resources
    end

    def description
      @metadata.description
    end

    def platforms
      @metadata.platforms.map do |platform, version|
        format_constraint(platform.capitalize, version)
      end
    end

    def dependencies
      @metadata.dependencies.map do |cookbook, version|
        format_constraint(cookbook, version)
      end
    end

    def attributes
      @metadata.attributes.map do |attr, options|
        name = "node['#{attr.gsub("/", "']['")}']"
        [name, options['description'], options['default']]
      end
    end

    def recipes
      @metadata.recipes
    end

    def maintainer
      @metadata.maintainer
    end

    def maintainer_email
      @metadata.maintainer_email
    end

    def copyright_year
      Time.now.year
    end

    def license
      @metadata.license
    end

    def get_binding
      binding
    end

    private

    def format_constraint(name, version)
      if @constraints && version != DEFAULT_CONSTRAINT
        "#{name} (#{version})"
      else
        name
      end
    end
  end
end<commit_msg>Remove unused method<commit_after>module KnifeCookbookReadme
  class ReadmeModel
    DEFAULT_CONSTRAINT = ">= 0.0.0".freeze

    def initialize(metadata, constraints, resources)
      @metadata = metadata
      @constraints = constraints
      @resources = resources
    end

    def resources
      @resources
    end

    def description
      @metadata.description
    end

    def platforms
      @metadata.platforms.map do |platform, version|
        format_constraint(platform.capitalize, version)
      end
    end

    def dependencies
      @metadata.dependencies.map do |cookbook, version|
        format_constraint(cookbook, version)
      end
    end

    def attributes
      @metadata.attributes.map do |attr, options|
        name = "node['#{attr.gsub("/", "']['")}']"
        [name, options['description'], options['default']]
      end
    end

    def recipes
      @recipes
    end

    def maintainer
      @metadata.maintainer
    end

    def maintainer_email
      @metadata.maintainer_email
    end

    def license
      @metadata.license
    end

    def get_binding
      binding
    end

    private

    def format_constraint(name, version)
      if @constraints && version != DEFAULT_CONSTRAINT
        "#{name} (#{version})"
      else
        name
      end
    end
  end
end
{'fraction_non_alphanumeric': 0.0828335832083958, 'fraction_numerical': 0.0022488755622188904, 'mean_word_length': 2.2273276904474004, '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': '811479', 'n_tokens_mistral': 774, 'n_tokens_neox': 734, 'n_words': 193}