<commit_before>require 'markdo/command'
require 'markdo/task_collection'
require 'date'
require 'uri'

module Markdo
  class IcsCommand < Command
    def run
      lines = Dir.
        glob(markdown_glob).
        map { |path| File.readlines(path, encoding: 'UTF-8') }.
        flatten

      events = TaskCollection.new(lines).
        with_attribute('due').
        reject { |task| task.complete? }.
        map { |task|
          due_date = task.attributes['due'].date_value
          Event.new(due_date, due_date, clean(task.body))
        }

      ics = template(events)

      @stdout.puts(ics)<commit_msg>Refactor: Clean up requires (IcsCommand)<commit_after>require 'date'
require 'markdo/command'
require 'markdo/task_collection'

module Markdo
  class IcsCommand < Command
    def run
      lines = Dir.
        glob(markdown_glob).
        map { |path| File.readlines(path, encoding: 'UTF-8') }.
        flatten

      events = TaskCollection.new(lines).
        with_attribute('due').
        reject { |task| task.complete? }.
        map { |task|
          due_date = task.attributes['due'].date_value
          Event.new(due_date, due_date, clean(task.body))
        }

      ics = template(events)

      @stdout.puts(ics)
{'fraction_non_alphanumeric': 0.12206952303961197, 'fraction_numerical': 0.0016168148746968471, 'mean_word_length': 2.4677871148459385, 'pattern_counts': {'":': 0, '<': 5, '<?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': '1429215', 'n_tokens_mistral': 390, 'n_tokens_neox': 379, 'n_words': 81}