<commit_before>require "language/go"

class TerraformInventory < Formula
  desc "Terraform State → Ansible Dynamic Inventory"
  homepage "https://github.com/adammck/terraform-inventory"
  url "https://github.com/adammck/terraform-inventory/archive/v0.9.tar.gz"
  sha256 "e0f5876b2272ac3f9702e3599078aede1e448f617526beec147cd3fbbf0836bd"
  license "MIT"
  head "https://github.com/adammck/terraform-inventory.git"

  bottle do
    sha256 cellar: :any_skip_relocation, arm64_big_sur: "1acd7cb77565f8b7838a0421529c24e48d2f703e0ec8d180f3b3f0a8bdb308f8"
    sha256 cellar: :any_skip_relocation, big_sur:       "d17cfd5dce0dfbc136f1508da7c24894edf479492698be1e7fecd0787d6aefed"
    sha256 cellar: :any_skip_relocation, catalina:      "a645460f72cd2fb823d603325439b39a7b8c493a2c3b833d87a484bbc0dfe7ba"
    sha256 cellar: :any_skip_relocation, mojave:        "9f34bba5205c0fc87ddf7c95ce8532b85fc7cbb515dea9cc211f70fab2aeb643"
    sha256 cellar: :any_skip_relocation, high_sierra:   "a9500dab587c5078fe62ae2ab5eff2376ecad8d29208a60fe195debfdeea5e78"
    sha256 cellar: :any_skip_relocation, sierra:        "6b30bf29fe2e83c3bb75c16ce83731c7b212f5f48c3db787501cf1fbb8c37d19"
  end

  depends_on "go" => :build

  go_resource "github.com/adammck/venv" do
    url "https://github.com/adammck/venv.git",
        revision: "8a9c907a37d36a8f34fa1c5b81aaf80c2554a306"
  end

  go_resource "github.com/blang/vfs" do
    url "https://github.com/blang/vfs.git",
        revision: "2c3e2278e174a74f31ff8bf6f47b43ecb358a870"
  end

  def install
    ENV["GOPATH"] = buildpath
    ENV["GO111MODULE"] = "auto"

    mkdir_p buildpath/"src/github.com/adammck/"
    ln_sf buildpath, buildpath/"src/github.com/adammck/terraform-inventory"
    Language::Go.stage_deps resources, buildpath/"src"

    system "go", "build", "-o", bin/"terraform-inventory", "-ldflags", "-X main.build_version='#{version}'"
  end

  test do<commit_msg>terraform-inventory: update 0.9 bottle.<commit_after>require "language/go"

class TerraformInventory < Formula
  desc "Terraform State → Ansible Dynamic Inventory"
  homepage "https://github.com/adammck/terraform-inventory"
  url "https://github.com/adammck/terraform-inventory/archive/v0.9.tar.gz"
  sha256 "e0f5876b2272ac3f9702e3599078aede1e448f617526beec147cd3fbbf0836bd"
  license "MIT"
  head "https://github.com/adammck/terraform-inventory.git"

  bottle do
    sha256 cellar: :any_skip_relocation, arm64_big_sur: "1acd7cb77565f8b7838a0421529c24e48d2f703e0ec8d180f3b3f0a8bdb308f8"
    sha256 cellar: :any_skip_relocation, big_sur:       "d17cfd5dce0dfbc136f1508da7c24894edf479492698be1e7fecd0787d6aefed"
    sha256 cellar: :any_skip_relocation, catalina:      "a645460f72cd2fb823d603325439b39a7b8c493a2c3b833d87a484bbc0dfe7ba"
    sha256 cellar: :any_skip_relocation, mojave:        "9f34bba5205c0fc87ddf7c95ce8532b85fc7cbb515dea9cc211f70fab2aeb643"
    sha256 cellar: :any_skip_relocation, high_sierra:   "a9500dab587c5078fe62ae2ab5eff2376ecad8d29208a60fe195debfdeea5e78"
    sha256 cellar: :any_skip_relocation, sierra:        "6b30bf29fe2e83c3bb75c16ce83731c7b212f5f48c3db787501cf1fbb8c37d19"
    sha256 cellar: :any_skip_relocation, x86_64_linux:  "245a07df6c433118da995d18a1133e96566f8a9cc52546a0a405fae0372c91a3"
  end

  depends_on "go" => :build

  go_resource "github.com/adammck/venv" do
    url "https://github.com/adammck/venv.git",
        revision: "8a9c907a37d36a8f34fa1c5b81aaf80c2554a306"
  end

  go_resource "github.com/blang/vfs" do
    url "https://github.com/blang/vfs.git",
        revision: "2c3e2278e174a74f31ff8bf6f47b43ecb358a870"
  end

  def install
    ENV["GOPATH"] = buildpath
    ENV["GO111MODULE"] = "auto"

    mkdir_p buildpath/"src/github.com/adammck/"
    ln_sf buildpath, buildpath/"src/github.com/adammck/terraform-inventory"
    Language::Go.stage_deps resources, buildpath/"src"

    system "go", "build", "-o", bin/"terraform-inventory", "-ldflags", "-X main.build_version='#{version}'"
  end

  test do
{'fraction_non_alphanumeric': 0.09759797724399494, 'fraction_numerical': 0.18230088495575222, 'mean_word_length': 5.3296, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 10, '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': '3371712', 'n_tokens_mistral': 2089, 'n_tokens_neox': 1727, 'n_words': 205}