<commit_before>class Features::Redis < Feature
  def create_dependencies
    depends_on :packages => {
                 :names => %w[redis-server]
               }
    depends_on :monit => {
                 :name => "redis",
                 :content => monit_content
               }

    nothing_else_to_do!
  end

private
  def monit_content
    """check process redis
  with pidfile /var/run/redis.pid
  start program = \"/etc/init.d/redis-server start\"
  stop program = \"/etc/init.d/redis-server stop\"
  if failed host 127.0.0.1 port 6379 then restart
  if 3 restarts within 5 cycles then timeout
  mode manual

"""
  end
end<commit_msg>Install the gem with redis<commit_after>class Features::Redis < Feature
  REDIS_GEM_VERSION = "2.0.11"

  def create_dependencies
    depends_on :packages => {
                 :names => %w[redis-server]
               }
    depends_on :monit => {
                 :name => "redis",
                 :content => monit_content
               }

    depends_on(:ruby_gem => {
                 :name => :redis,
                 :version => REDIS_GEM_VERSION
               })\
      if rvm

    nothing_else_to_do!
  end

private
  def monit_content
    """check process redis
  with pidfile /var/run/redis.pid
  start program = \"/etc/init.d/redis-server start\"
  stop program = \"/etc/init.d/redis-server stop\"
  if failed host 127.0.0.1 port 6379 then restart
  if 3 restarts within 5 cycles then timeout
  mode manual

"""
  end

  def rvm
    @rvm ||= find_feature(:rvm, :anything)
  end
end
{'fraction_non_alphanumeric': 0.10512654120700844, 'fraction_numerical': 0.018170019467878003, 'mean_word_length': 1.9768339768339769, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 16, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 2, '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': '5871302', 'n_tokens_mistral': 515, 'n_tokens_neox': 490, 'n_words': 126}