<commit_before>module Wingtips
  module DSL
    def slide(title=nil, &content)
      clazz = create_slide_class content
      publish_slide_class clazz, title
    end
    
    private
    def create_slide_class(content)
      clazz = Class.new(Wingtips::Slide)
      clazz.class_eval do
        define_method(:content, &content)
      end
      clazz
    end
    
    def publish_slide_class(clazz, title)
      if unnamed_slides_allowed? && title.nil?
        @slide_classes << clazz
      elsif title.nil?
        raise "Unnamed calls to `slide do` aren't allowed in the slides subdirectory.\n" \
              "Try `slide \"MySlide\" do` so you can reference it in config."
      else
        Object.const_set(title, clazz)
      end
    end
    
    def configuration
      Wingtips::Configuration.current
    end
    
    def unnamed_slides_allowed?
      configuration.unnamed_slides_allowed?    
    end
  end
end


# extending the main object (doesn't touch the Object class)
extend Wingtips::DSL<commit_msg>Whitespace fixes<commit_after>module Wingtips
  module DSL
    def slide(title=nil, &content)
      clazz = create_slide_class content
      publish_slide_class clazz, title
    end
    
    private

    def create_slide_class(content)
      clazz = Class.new(Wingtips::Slide)
      clazz.class_eval do
        define_method(:content, &content)
      end
      clazz
    end

    def publish_slide_class(clazz, title)
      if unnamed_slides_allowed? && title.nil?
        @slide_classes << clazz
      elsif title.nil?
        raise "Unnamed calls to `slide do` aren't allowed in the slides subdirectory.\n" \
              "Try `slide \"MySlide\" do` so you can reference it in config."
      else
        Object.const_set(title, clazz)
      end
    end

    def configuration
      Wingtips::Configuration.current
    end

    def unnamed_slides_allowed?
      configuration.unnamed_slides_allowed?    
    end
  end
end


# extending the main object (doesn't touch the Object class)
extend Wingtips::DSL
{'fraction_non_alphanumeric': 0.0691699604743083, 'fraction_numerical': 0.0, 'mean_word_length': 2.485370051635112, 'pattern_counts': {'":': 0, '<': 7, '<?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': '5244312', 'n_tokens_mistral': 627, 'n_tokens_neox': 609, 'n_words': 170}