<commit_before>require 'bundler'
require 'open-uri'

Bundler.require

require_relative 'config/datamapper'
require_relative 'models/post'

def update_freddie(new_freddie)
  DataMapper.auto_upgrade!
  DataMapper.finalize

  post_to_update = Post.last
  post_to_update.update(:title => new_freddie)
end

def get_freddie
  doc = Nokogiri::HTML(open("http://www.mailchimp.com/replyall"))

  @freddies       = doc.css("div.freddie")
  @active_freddie = @freddies.first['id']

  if @active_freddie != get_old_freddie
    # Send notification e.g. "New Freddie!"
    update_freddie(@active_freddie)
  end
end

def get_old_freddie
  @freddie = Post.last

  return @freddie['title']
end

get_freddie
<commit_msg>Rename method for getting old Freddie<commit_after>require 'bundler'
require 'open-uri'

Bundler.require

require_relative 'config/datamapper'
require_relative 'models/post'

def update_freddie(new_freddie)
  DataMapper.auto_upgrade!
  DataMapper.finalize

  post_to_update = Post.last
  post_to_update.update(:title => new_freddie)
end

def get_freddie
  doc = Nokogiri::HTML(open("http://www.mailchimp.com/replyall"))

  @freddies       = doc.css("div.freddie")
  @active_freddie = @freddies.first['id']

  if @active_freddie != old_freddie
    # Send notification e.g. "New Freddie!"
    update_freddie(@active_freddie)
  end
end

def old_freddie
  @freddie = Post.last

  return @freddie['title']
end

get_freddie

{'fraction_non_alphanumeric': 0.11126760563380282, 'fraction_numerical': 0.0, 'mean_word_length': 4.871900826446281, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '3640499', 'n_tokens_mistral': 528, 'n_tokens_neox': 508, 'n_words': 95}