<commit_before>#
# Base class for all resources that will be seen as a file
#
class RadiantFileResource < RadiantResource

  #
  # Initialize a file resource
  # +record+ ActiveRecord model
  #
  def initialize(record)
    @record = record
    @path = record.name + filter_extension
  end

  #
  # A file has no children
  #
  def children
    []
  end

  #
  # Default file extension
  #
  def extension
    ""
  end

  #
  # Default content type
  #
  def getcontenttype
    "text/plain"
  end

  #
  # Returns the file size
  #
  def getcontentlength
    record.content.size
  end

  #
  # returns the file data
  #
  def data
    record.content
  end

end<commit_msg>File resources have no extension per default and no children<commit_after>#
# Base class for all resources that will be seen as a file
#
class RadiantFileResource < RadiantResource

  #
  # Initialize a file resource
  # +record+ ActiveRecord model
  #
  def initialize(record)
    @record = record
    @path = record.name
  end

  #
  # A file has no children
  #
  def children
    []
  end

  #
  # Default file extension
  #
  def extension
    ""
  end

  #
  # Default content type
  #
  def getcontenttype
    "text/plain"
  end

  #
  # Has this resource any childrens
  #
  def collection?
    false
  end

  #
  # Returns the file size
  #
  def getcontentlength
    record.content.size
  end

  #
  # returns the file data
  #
  def data
    record.content
  end

end
{'fraction_non_alphanumeric': 0.06556245686680469, 'fraction_numerical': 0.0, 'mean_word_length': 2.37995337995338, 'pattern_counts': {'":': 0, '<': 5, '<?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': '4650653', 'n_tokens_mistral': 477, 'n_tokens_neox': 463, 'n_words': 154}