<commit_before>require 'formula'

class Mkvtoolnix < Formula
  homepage 'http://www.bunkus.org/videotools/mkvtoolnix/'
  url 'http://www.bunkus.org/videotools/mkvtoolnix/sources/mkvtoolnix-6.8.0.tar.xz'
  sha1 'd742eb0c38de48d0f12363252115c0d966e8abc3'

  head 'https://github.com/mbunkus/mkvtoolnix.git'

  depends_on 'pkg-config' => :build
  depends_on 'ruby' => :build if MacOS.version < :mavericks
  depends_on 'boost' => 'c++11'
  depends_on 'libvorbis'
  depends_on 'libmatroska' => 'c++11'<commit_msg>mkvtoolnix: check for Ruby 1.9.<commit_after>require 'formula'

class Ruby19 < Requirement
  fatal true
  default_formula "ruby"

  satisfy :build_env => false do
    next unless which "ruby"
    version = /\d\.\d/.match `ruby --version 2>&1`
    next unless version
    version >= Version.new("1.9")
  end

  def modify_build_environment
    ruby = which "ruby"
    return unless ruby
    ENV.prepend_path "PATH", ruby.dirname
  end

  def message; <<-EOS.undent
    The mkvtoolnix buildsystem needs Ruby >=1.9
    EOS
  end
end

class Mkvtoolnix < Formula
  homepage 'http://www.bunkus.org/videotools/mkvtoolnix/'
  url 'http://www.bunkus.org/videotools/mkvtoolnix/sources/mkvtoolnix-6.8.0.tar.xz'
  sha1 'd742eb0c38de48d0f12363252115c0d966e8abc3'

  head 'https://github.com/mbunkus/mkvtoolnix.git'

  depends_on 'pkg-config' => :build
  depends_on Ruby19
  depends_on 'boost' => 'c++11'
  depends_on 'libvorbis'
  depends_on 'libmatroska' => 'c++11'
{'fraction_non_alphanumeric': 0.13073237508555785, 'fraction_numerical': 0.05475701574264202, 'mean_word_length': 3.9559322033898305, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 14, 'https://': 2, 'lorem ipsum': 0, 'www.': 4, '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': '5691110', 'n_tokens_mistral': 640, 'n_tokens_neox': 601, 'n_words': 109}