<commit_before>require "formula"

class Sysdig < Formula
  homepage "http://www.sysdig.org/"
  url "https://github.com/draios/sysdig/archive/0.1.96.tar.gz"
  sha1 "86a8b1d21a7cbb392f3127b98b08f1d56b0f3927"

  head "https://github.com/draios/sysdig.git"

  bottle do
    sha1 "20fd60684494c2355a6726185005f1c0ddd2a62e" => :yosemite
    sha1 "5014884980a74ab57b7301e09c8491676ffd4729" => :mavericks
    sha1 "00630d947388152c452d07583d1d50998143128f" => :mountain_lion
  end

  depends_on "cmake" => :build

  # More info on https://gist.github.com/juniorz/9986999
  resource "sample_file" do
    url "https://gist.githubusercontent.com/juniorz/9986999/raw/a3556d7e93fa890a157a33f4233efaf8f5e01a6f/sample.scap"
    sha1 "0aa3c30b954f9fb0d7320d900d3a103ade6b1cec"
  end

  def install
    ENV.libcxx if MacOS.version < :mavericks

    mkdir "build" do
      system "cmake", "..", "-DSYSDIG_VERSION=#{version}", *std_cmake_args
      system "make", "install"
    end
  end

  test do
    (share/"demos").install resource("sample_file").files("sample.scap")

    # tests if it can load chisels
    `#{bin}/sysdig -cl`
    assert_equal 0, $?.exitstatus

    # tests if it can read a sample capture file<commit_msg>sysdig: update 0.1.96 bottle.<commit_after>require "formula"

class Sysdig < Formula
  homepage "http://www.sysdig.org/"
  url "https://github.com/draios/sysdig/archive/0.1.96.tar.gz"
  sha1 "86a8b1d21a7cbb392f3127b98b08f1d56b0f3927"

  head "https://github.com/draios/sysdig.git"

  bottle do
    sha1 "8b73abcdb344fc8f0439f54d34b549bbfb6baed0" => :yosemite
    sha1 "15cf5d1a4d222fa21cd060575e787ff12f30b32b" => :mavericks
    sha1 "d865dbde4d287c142a0f8c42a7a75cb55c30fd68" => :mountain_lion
  end

  depends_on "cmake" => :build

  # More info on https://gist.github.com/juniorz/9986999
  resource "sample_file" do
    url "https://gist.githubusercontent.com/juniorz/9986999/raw/a3556d7e93fa890a157a33f4233efaf8f5e01a6f/sample.scap"
    sha1 "0aa3c30b954f9fb0d7320d900d3a103ade6b1cec"
  end

  def install
    ENV.libcxx if MacOS.version < :mavericks

    mkdir "build" do
      system "cmake", "..", "-DSYSDIG_VERSION=#{version}", *std_cmake_args
      system "make", "install"
    end
  end

  test do
    (share/"demos").install resource("sample_file").files("sample.scap")

    # tests if it can load chisels
    `#{bin}/sysdig -cl`
    assert_equal 0, $?.exitstatus

    # tests if it can read a sample capture file
{'fraction_non_alphanumeric': 0.11759868421052631, 'fraction_numerical': 0.14720394736842105, 'mean_word_length': 3.9754601226993866, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 11, 'https://': 8, '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': '4479069', 'n_tokens_mistral': 1214, 'n_tokens_neox': 1023, 'n_words': 166}