<commit_before>module Scribd_fu
  
  def self.included(base)
    base.extend ActsAsScribdObject
  end 

  module ActsAsScribdObject
    def acts_as_scribd_document(options = {})
      class_eval <<-END
        include Scribd_fu::InstanceMethods    
      END
    end
  end
  
  module ClassMethods
    def self.extended(base)
      base.class_inheritable_accessor :scribd_options
      base.before_destroy :destroy_scribd_document
      base.after_save :upload_to_scribd
    end

    def validates_as_scribd_document
      validates_presence_of :scribd_id, :scribd_access_id, :content_type
      validate              :scribd_attributes_valid?
    end
  end
  
  module InstanceMethods
    @@content_types = ['application/pdf', 'image/jpeg', 'image/pjpeg', 'image/gif', 'image/png', 'image/x-png', 'image/jpg', 'application/msword', 'application/mspowerpoint', 
                        'application/excel', 'application/postscript', 'text/plain', 'application/rtf', 'application/vnd.oasis.opendocument.text', 'vnd.oasis.opendocument.presentation',
                        'application/vnd.sun.xml.writer', 'application/vnd.sun.xml.impress']
                        
    mattr_reader :content_types

    def self.included(base)
      base.extend ClassMethods
      
      mattr_reader :scribd_config, :scribd_login

      begin<commit_msg>adjusted and added mime-types for powerpoint and excel (in accordance with e.g. gnome shared mime library, www.fileformat.info etc)<commit_after>module Scribd_fu
  
  def self.included(base)
    base.extend ActsAsScribdObject
  end 

  module ActsAsScribdObject
    def acts_as_scribd_document(options = {})
      class_eval <<-END
        include Scribd_fu::InstanceMethods    
      END
    end
  end
  
  module ClassMethods
    def self.extended(base)
      base.class_inheritable_accessor :scribd_options
      base.before_destroy :destroy_scribd_document
      base.after_save :upload_to_scribd
    end

    def validates_as_scribd_document
      validates_presence_of :scribd_id, :scribd_access_id, :content_type
      validate              :scribd_attributes_valid?
    end
  end
  
  module InstanceMethods
    @@content_types = ['application/pdf', 'image/jpeg', 'image/pjpeg', 'image/gif', 'image/png', 'image/x-png', 'image/jpg', 'application/msword', 'application/mspowerpoint', 'application/vnd.ms-powerpoint', 
                        'application/excel', 'application/vnd.ms-excel', 'application/postscript', 'text/plain', 'application/rtf', 'application/vnd.oasis.opendocument.text', 'vnd.oasis.opendocument.presentation',
                        'application/vnd.sun.xml.writer', 'application/vnd.sun.xml.impress']
                        
    mattr_reader :content_types

    def self.included(base)
      base.extend ClassMethods
      
      mattr_reader :scribd_config, :scribd_login

      begin
{'fraction_non_alphanumeric': 0.09457092819614711, 'fraction_numerical': 0.0, 'mean_word_length': 2.98326359832636, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 1, 'xml': 4}, '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': '2174950', 'n_tokens_mistral': 912, 'n_tokens_neox': 862, 'n_words': 156}