<commit_before>require 'formula'

class GitNow < Formula
  url 'https://github.com/iwata/git-now.git', :tag => 'v0.1.0.9'
  version '0.1.0.9'
  head 'https://github.com/iwata/git-now.git', :branch => 'develop'
  homepage 'https://github.com/iwata/git-now'

  depends_on 'gnu-getopt'

  def options
    [
      ['--zsh-completion', "copy zsh completion function file to #{share}/zsh/functions"]
    ]
  end

  def patches
    DATA
  end

  def install
    system "make", "prefix=#{prefix}", "install"
    if ARGV.include? '--zsh-completion'
      zsh_functions_d = share + 'zsh/functions'
      zsh_functions_d.install "etc/_git-now"
    end
  end

end

# This patch makes sure GNUtools are used on OSX.
# gnu-getopt is keg-only hence the backtick expansion.
# These aliases only exist for the duration of git-now,
# inside the git-now shells. Normal operation of bash is
# unaffected - getopt will still find the version supplied
# by OSX in other shells, for example.
__END__
--- a/git-now
+++ b/git-now<commit_msg>git-now: update options/caveats<commit_after>require 'formula'

class GitNow < Formula
  url 'https://github.com/iwata/git-now.git', :tag => 'v0.1.0.9'
  version '0.1.0.9'
  head 'https://github.com/iwata/git-now.git', :branch => 'develop'
  homepage 'https://github.com/iwata/git-now'

  depends_on 'gnu-getopt'

  def options
    [['--zsh-completion', "Install zsh completions."]]
  end

  def patches
    DATA
  end

  def install
    system "make", "prefix=#{prefix}", "install"
    if ARGV.include? '--zsh-completion'
      zsh_functions_d = share + 'zsh/functions'
      zsh_functions_d.install "etc/_git-now"
    end
  end

  def caveats; <<-EOS
    If `--zsh-completion` is specified, zsh completions are installed to:
      #{share}/zsh/functions
    EOS
  end

end

# This patch makes sure GNUtools are used on OSX.
# gnu-getopt is keg-only hence the backtick expansion.
# These aliases only exist for the duration of git-now,
# inside the git-now shells. Normal operation of bash is
# unaffected - getopt will still find the version supplied
# by OSX in other shells, for example.
__END__
--- a/git-now
+++ b/git-now
{'fraction_non_alphanumeric': 0.1292580494633691, 'fraction_numerical': 0.007466168922071862, 'mean_word_length': 3.138996138996139, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 6, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 4, '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': '7526385', 'n_tokens_mistral': 766, 'n_tokens_neox': 740, 'n_words': 218}