<commit_before>module OodAppkit
  # A class used to handle URLs for the system Shell app.
  class ShellUrl
    # The title for this URL
    # @return [String] the title of the URL
    attr_reader :title

    # @param title [String] the title of the URL
    # @param base_url [String] the base URL used to access this app
    # @param template [String] the template used to generate URLs for this app
    # @see https://www.rfc-editor.org/rfc/rfc6570.txt RFC describing template format
    def initialize(title: '', base_url: '/', ssh_url: '/ssh', template: '{/url*}/{host}{+path}')
      @title = title
      @template = Addressable::Template.new template

      # Break up into arrays of strings
      @base_url = base_url.split('/').reject(&:empty?)
      @ssh_url  = ssh_url.split('/').reject(&:empty?)
    end

    # URL to access this app for a given host and absolute file path
    # @param host [String] the host the app will make an ssh connection with
    # @param path [#to_s] the absolute path to the directory ssh app opens up in
    # @return [Addressable::URI] the url used to access the app
    def url(host:, path: '')
      @template.expand url: @base_url + @ssh_url, host: host, path: path.to_s
    end
  end
end<commit_msg>add default host<commit_after>module OodAppkit
  # A class used to handle URLs for the system Shell app.
  class ShellUrl
    # The title for this URL
    # @return [String] the title of the URL
    attr_reader :title

    # @param title [String] the title of the URL
    # @param base_url [String] the base URL used to access this app
    # @param template [String] the template used to generate URLs for this app
    # @see https://www.rfc-editor.org/rfc/rfc6570.txt RFC describing template format
    def initialize(title: '', base_url: '/', ssh_url: '/ssh', template: '{/url*}/{host}{+path}')
      @title = title
      @template = Addressable::Template.new template

      # Break up into arrays of strings
      @base_url = base_url.split('/').reject(&:empty?)
      @ssh_url  = ssh_url.split('/').reject(&:empty?)
    end

    # URL to access this app for a given host and absolute file path
    # @param host [String] the host the app will make an ssh connection with
    # @param path [#to_s] the absolute path to the directory ssh app opens up in
    # @return [Addressable::URI] the url used to access the app
    def url(host: 'default', path: '')
      @template.expand url: @base_url + @ssh_url, host: host, path: path.to_s
    end
  end
end
{'fraction_non_alphanumeric': 0.10732879455346415, 'fraction_numerical': 0.0032038446135362435, 'mean_word_length': 3.1495016611295683, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, 'lorem ipsum': 0, 'www.': 2, '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': '635844', 'n_tokens_mistral': 771, 'n_tokens_neox': 740, 'n_words': 306}