<commit_before>require 'date'

class Meetup
  attr_reader :month, :year
  
  def initialize(month, year)
    @month = month
    @year = year
  end
  
  def day(weekday, schedule)
    send(schedule, weekday)
  end
  
  private
  
  def teenth(weekday)
    search(weekday, 13)
  end
  
  def first(weekday)
    search(weekday)
  end
  
  def second(weekday)
    search(weekday, start_day(2))
  end
  
  def third(weekday)
    search(weekday, start_day(3))
  end
  
  def fourth(weekday)
    search(weekday, start_day(4))
  end
  
  def last(weekday)
    starter_date = Date.new(year, month, -1)
    until Kernel.eval("starter_date." + weekday.to_s + "?") do
      starter_date -= 1
    end
    starter_date
  end
  <commit_msg>Refactored again using the negative idea to remove the duplication of similar code and can increment by one day to get days<commit_after>require 'date'

class Meetup
  attr_reader :month, :year
  
  def initialize(month, year)
    @month = month
    @year = year
  end
  
  def day(weekday, schedule)
    send(schedule, weekday)
  end
  
  private
  
  def teenth(weekday)
    search(weekday, 13)
  end
  
  def first(weekday)
    search(weekday)
  end
  
  def second(weekday)
    search(weekday, start_day(2))
  end
  
  def third(weekday)
    search(weekday, start_day(3))
  end
  
  def fourth(weekday)
    search(weekday, start_day(4))
  end
  
  def last(weekday)
    search(weekday, -7)
  end

{'fraction_non_alphanumeric': 0.09192982456140351, 'fraction_numerical': 0.009122807017543859, 'mean_word_length': 2.854054054054054, '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': '5783352', 'n_tokens_mistral': 535, 'n_tokens_neox': 524, 'n_words': 133}