<commit_before>require 'formula'

class Redis <Formula
  url 'http://redis.googlecode.com/files/redis-2.0.4.tar.gz'
  head 'git://github.com/antirez/redis.git'
  homepage 'http://code.google.com/p/redis/'
  sha1 'fee2f1960eda22385503517a9a6dcae610df84d5'

  def install
    fails_with_llvm "Breaks with LLVM"

    # Head and stable have different code layouts
    src = File.exists?('src/Makefile') ? 'src' : '.'
    system "make -C #{src}"

    %w( redis-benchmark redis-cli redis-server redis-check-dump redis-check-aof ).each { |p|
      bin.install "#{src}/#{p}" rescue nil
    }

    %w( run db/redis log ).each { |p| (var+p).mkpath }

    # Fix up default conf file to match our paths
    inreplace "redis.conf" do |s|<commit_msg>Change redis download url to point at Github to match redis.io. Changed SHA1 to match version currently hosted.<commit_after>require 'formula'

class Redis <Formula
  url 'https://github.com/antirez/redis/tarball/v2.0.4-stable'
  head 'git://github.com/antirez/redis.git'
  homepage 'http://code.google.com/p/redis/'
  sha1 '48300996d3d34cccf076330859f37248fa5f6c1b'

  def install
    fails_with_llvm "Breaks with LLVM"

    # Head and stable have different code layouts
    src = File.exists?('src/Makefile') ? 'src' : '.'
    system "make -C #{src}"

    %w( redis-benchmark redis-cli redis-server redis-check-dump redis-check-aof ).each { |p|
      bin.install "#{src}/#{p}" rescue nil
    }

    %w( run db/redis log ).each { |p| (var+p).mkpath }

    # Fix up default conf file to match our paths
    inreplace "redis.conf" do |s|
{'fraction_non_alphanumeric': 0.13994910941475827, 'fraction_numerical': 0.03880407124681934, 'mean_word_length': 3.2744565217391304, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, 'https://': 1, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6578001', 'n_tokens_mistral': 623, 'n_tokens_neox': 581, 'n_words': 146}