<commit_before>{ buildRubyGem, lib, bundler, ruby, nix, nix-prefetch-scripts }:

buildRubyGem rec {
  inherit ruby;

  name = "${gemName}-${version}";
  gemName = "bundix";
  version = "2.0.5";

  sha256 = "0bsynhr44jz6nih0xn7v32h1qvywnb5335ka208gn7jp6bjwabhy";

  buildInputs = [bundler];

  postInstall = ''
    gem_root=$GEM_HOME/gems/${gemName}-${version}
    sed \
      -e 's|NIX_INSTANTIATE =.*|NIX_INSTANTIATE = "${nix}/bin/nix-instantiate"|' \
      -i $gem_root/lib/bundix.rb
    sed \
      -e 's|NIX_HASH =.*|NIX_HASH = "${nix}/bin/nix-hash"|' \
      -i $gem_root/lib/bundix.rb
    sed \
      -e 's|NIX_PREFETCH_URL =.*|NIX_PREFETCH_URL = "${nix}/bin/nix-prefetch-url"|' \
      -i $gem_root/lib/bundix.rb
    sed \
      -e 's|NIX_PREFETCH_GIT =.*|NIX_PREFETCH_GIT = "${nix-prefetch-scripts}/bin/nix-prefetch-git"|' \
      -i $gem_root/lib/bundix.rb
  '';

  meta = {
    inherit version;
    description = "Creates Nix packages from Gemfiles";
    longDescription = ''
      This is a tool that converts Gemfile.lock files to nix expressions.

      The output is then usable by the bundlerEnv derivation to list all the
      dependencies of a ruby package.
    '';
    homepage = "https://github.com/manveru/bundix";
    license = "MIT";
    maintainers = with lib.maintainers; [ <NAME> ];
    platforms = lib.platforms.all;
  };
}<commit_msg>bundix: cleaner substitution<commit_after>{ buildRubyGem, lib, bundler, ruby, nix, nix-prefetch-git }:

buildRubyGem rec {
  inherit ruby;

  name = "${gemName}-${version}";
  gemName = "bundix";
  version = "2.0.5";

  sha256 = "0bsynhr44jz6nih0xn7v32h1qvywnb5335ka208gn7jp6bjwabhy";

  buildInputs = [bundler];

  postInstall = ''
    substituteInPlace $GEM_HOME/gems/${gemName}-${version}/lib/bundix.rb \
      --replace \
        "'nix-instantiate'" \
        "'${nix}/bin/nix-instantiate'" \
      --replace \
        "'nix-hash'" \
        "'${nix}/bin/nix-hash'" \
      --replace \
        "'nix-prefetch-url'" \
        "'${nix}/bin/nix-prefetch-url'" \
      --replace \
        "'nix-prefetch-git'" \
        "'${nix-prefetch-git}/bin/nix-prefetch-git'"
  '';

  meta = {
    inherit version;
    description = "Creates Nix packages from Gemfiles";
    longDescription = ''
      This is a tool that converts Gemfile.lock files to nix expressions.

      The output is then usable by the bundlerEnv derivation to list all the
      dependencies of a ruby package.
    '';
    homepage = "https://github.com/manveru/bundix";
    license = "MIT";
    maintainers = with lib.maintainers; [ <NAME> ];
    platforms = lib.platforms.all;
  };
}
{'fraction_non_alphanumeric': 0.15511298353121408, 'fraction_numerical': 0.018383761011106857, 'mean_word_length': 2.7155049786628735, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 2, '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': '6267161', 'n_tokens_mistral': 1033, 'n_tokens_neox': 953, 'n_words': 187}