<commit_before>require "abc/version"

module Abc

  # Steps for ABC
  # Load Gemfile
  # Load each line of the file into a Gem object representing version, title, etc
  # If the line matches a regex with a /do/ block on it then load it into a Block object which has a title
  # representing the symbol of the block
  # the Block object contains Gem objects for each line up to the end statement
  # Organize the gems by name and place the blocks in alphabetical order and organize the blocks by title
end<commit_msg>getting basic structure for the gem setup and load_gemfile method specd out<commit_after>require "abc/version"

module Abc
  class Gem
    def initialize(name)
      # parse out the name here
      @name = name
    end

    def <=>

    end
  end

  class Group
    attr_accessor :gems

    def initialize(name)
      # parse out the group name from the match here
      @name = name
    end

    def <=>

    end
  end

  def load_gemfile
   group = /group.*do/
   gem = /gem.*/
   gemfile_lines = []
   File.open('Gemfile', 'r').each_line do |line|
    match = group.match(line)
    if match
      gemfile_lines << Group.new(match)
    end

    if /end/.match(line)
      next
    end
   gemfile_lines << Gem.new(gem.match(line))
   end
  end

  def reorder_gemfile

  end

  def save_gemfile
    # do the reverse of load with NewGemfile
  end

  def delete_original_gemfile
    File.delete('Gemfile')
    File.rename('NewGemfile','Gemfile')
  end

  def process
    load_gemfile
    reorder_gemfile
    save_gemfile
    delete_original_gemfile
  end
end
{'fraction_non_alphanumeric': 0.06361323155216285, 'fraction_numerical': 0.0, 'mean_word_length': 2.7011764705882353, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 5, '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': '590097', 'n_tokens_mistral': 501, 'n_tokens_neox': 482, 'n_words': 187}