<commit_before># frozen_string_literal: true

module RgGen
  module Core
    class HelpPrinter
      def initialize(option_parser)
        @option_parser = option_parser
      end

      def run(_builder, _options)
        puts @option_parser.help
      end
    end

    class VersionPrinter
      def initialize(verbose)
        @verbose = verbose
      end

      def run(builder, options)
        verbose? && load_setup_file(builder, options[:setup])
        puts help_message(builder)
      end

      private

      def verbose?
        @verbose
      end

      def load_setup_file(builder, file)
        file.nil? || file.empty? || builder.load_setup_file(file, false)
      end

      def help_message(builder)
        [
          simple_version,
          *(verbose? && verbose_version(builder) || nil)
        ].join("\n")
      end

      def simple_version
        "RgGen #{Core::MAJOR}.#{Core::MINOR}"
      end

      def verbose_version(builder)<commit_msg>corrected method name<commit_after># frozen_string_literal: true

module RgGen
  module Core
    class HelpPrinter
      def initialize(option_parser)
        @option_parser = option_parser
      end

      def run(_builder, _options)
        puts @option_parser.help
      end
    end

    class VersionPrinter
      def initialize(verbose)
        @verbose = verbose
      end

      def run(builder, options)
        verbose? && load_setup_file(builder, options[:setup])
        puts version_message(builder)
      end

      private

      def verbose?
        @verbose
      end

      def load_setup_file(builder, file)
        file.nil? || file.empty? || builder.load_setup_file(file, false)
      end

      def version_message(builder)
        [
          simple_version,
          *(verbose? && verbose_version(builder) || nil)
        ].join("\n")
      end

      def simple_version
        "RgGen #{Core::MAJOR}.#{Core::MINOR}"
      end

      def verbose_version(builder)
{'fraction_non_alphanumeric': 0.08682328907048008, 'fraction_numerical': 0.0, 'mean_word_length': 2.1344, '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': '743265', 'n_tokens_mistral': 581, 'n_tokens_neox': 555, 'n_words': 131}