<commit_before>require 'pry'
require 'lspace/eventmachine'

module Cannon
  class AlreadyListening < StandardError; end

  class App
    attr_reader :routes, :app_binding

    def initialize(app_binding, port: nil, ip_address: nil)
      @app_binding = app_binding
      @subapps = {}
      @routes = []

      runtime.config.port = port unless port.nil?
      runtime.config.ip_address = ip_address unless ip_address.nil?
    end<commit_msg>Add support for setting the port on the command line<commit_after>require 'pry'
require 'lspace/eventmachine'

module Cannon
  class AlreadyListening < StandardError; end

  class App
    attr_reader :routes, :app_binding

    def initialize(app_binding, port: nil, ip_address: nil)
      @app_binding = app_binding
      @subapps = {}
      @routes = []

      opts = @app_binding.eval('ARGV')
      if index = opts.index('-p')
        port ||= opts[index + 1]
      end

      runtime.config.port = port unless port.nil?
      runtime.config.ip_address = ip_address unless ip_address.nil?
    end
{'fraction_non_alphanumeric': 0.09423076923076923, 'fraction_numerical': 0.0009615384615384616, 'mean_word_length': 3.180722891566265, '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': '1256363', 'n_tokens_mistral': 326, 'n_tokens_neox': 317, 'n_words': 85}