<commit_before>require 'pry'
require_relative 'factory'
require_relative 'command/matcher/matcher'

class Application
  def initialize(argv = [])
    @input = $stdin
    @parser = Command::Matcher
    @controller = Factory.create(:controller)
  end

  def run(options = nil)
    loop do
      raw_input = input.gets
      break unless raw_input
      raw_input.chomp!
      debug(raw_input)
      command = parser.parse(raw_input)
      controller.input(command) if command
    end
  end

  private

  attr_reader :input, :parser, :controller

  def debug(raw_input)
    case raw_input
    when /\AR(EPORT_DEBUG)*\z/
      puts controller.instance_variable_get(:@robot).inspect
    when /\AD(EBUG)*\z/
      console
    when /\AE(XIT)*\z/
      puts 'Have a nice day, bye :)'
      puts '...'
      exit(false)
    end
  end

  def console
    # Application debug session
    #
    # Call `self` to see
    # state.

    binding.pry
  end
end<commit_msg>Remove production dependancy on 'pry'<commit_after>require_relative 'factory'
require_relative 'command/matcher/matcher'

class Application
  def initialize(argv = [])
    @input = $stdin
    @parser = Command::Matcher
    @controller = Factory.create(:controller)
  end

  def run(options = nil)
    loop do
      raw_input = input.gets
      break unless raw_input
      raw_input.chomp!
      debug(raw_input)
      command = parser.parse(raw_input)
      controller.input(command) if command
    end
  end

  private

  attr_reader :input, :parser, :controller

  def debug(raw_input)
    case raw_input
    when /\AR(EPORT_DEBUG)*\z/
      puts controller.instance_variable_get(:@robot).inspect
    when /\AE(XIT)*\z/
      puts 'Have a nice day, bye :)'
      puts '...'
      exit(false)
    end
  end
end
{'fraction_non_alphanumeric': 0.10362400906002266, 'fraction_numerical': 0.0, 'mean_word_length': 2.68125, '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': '5380679', 'n_tokens_mistral': 581, 'n_tokens_neox': 569, 'n_words': 140}