<commit_before>require "formula"

class MobileShell < Formula
  homepage "http://mosh.mit.edu/"
  url "https://mosh.mit.edu/mosh-1.2.4.tar.gz"
  sha256 "e74d0d323226046e402dd469a176075fc2013b69b0e67cea49762c957175df46"
  revision 2

  head do
    url "https://github.com/keithw/mosh.git"

    depends_on "autoconf" => :build
    depends_on "automake" => :build
  end

  option "with-check", "Run build-time tests"

  depends_on "openssl"
  depends_on "pkg-config" => :build
  depends_on "protobuf"

  def install
    system "./autogen.sh" if build.head?

    # teach mosh to locate mosh-client without referring
    # PATH to support launching outside shell e.g. via launcher
    inreplace "scripts/mosh", "'mosh-client", "\'#{bin}/mosh-client"

    # Upstream prefers O2:
    # https://github.com/keithw/mosh/blob/master/README.md
    ENV.O2
    system "./configure", "--prefix=#{prefix}", "--enable-completion"
    system "make", "check" if build.with? "check"
    system "make", "install"
  end

  test do
    ENV["TERM"]="xterm"
    system "#{bin}/mosh-client", "-c"
  end
end<commit_msg>mosh: update formula for now-generated scripts/mosh<commit_after>require "formula"

class MobileShell < Formula
  homepage "http://mosh.mit.edu/"
  url "https://mosh.mit.edu/mosh-1.2.4.tar.gz"
  sha256 "e74d0d323226046e402dd469a176075fc2013b69b0e67cea49762c957175df46"
  revision 2

  head do
    url "https://github.com/keithw/mosh.git"

    depends_on "autoconf" => :build
    depends_on "automake" => :build
  end

  option "with-check", "Run build-time tests"

  depends_on "openssl"
  depends_on "pkg-config" => :build
  depends_on "protobuf"

  def install
    system "./autogen.sh" if build.head?

    # teach mosh to locate mosh-client without referring
    # PATH to support launching outside shell e.g. via launcher
    #
    # In HEAD, mosh is generated from mosh.pl, This will be in 1.2.5, coming soon.
    if build.head?
      inreplace "scripts/mosh.pl", "'mosh-client", "\'#{bin}/mosh-client"
    else
      inreplace "scripts/mosh", "'mosh-client", "\'#{bin}/mosh-client"
    end
    # Upstream prefers O2:
    # https://github.com/keithw/mosh/blob/master/README.md
    ENV.O2
    system "./configure", "--prefix=#{prefix}", "--enable-completion"
    system "make", "check" if build.with? "check"
    system "make", "install"
  end

  test do
    ENV["TERM"]="xterm"
    system "#{bin}/mosh-client", "-c"
  end
end
{'fraction_non_alphanumeric': 0.14574731626754747, 'fraction_numerical': 0.04665565648224608, 'mean_word_length': 3.2508771929824563, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 9, 'https://': 6, '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': '4416369', 'n_tokens_mistral': 961, 'n_tokens_neox': 884, 'n_words': 204}