<commit_before>APP_PATH = File.expand_path(".")
APP_NAME = File.basename(APP_PATH)
HOME = ENV['HOME']
POW_PATH = File.join(HOME, '.pow')

def exec_with_explain(cmd)
  puts "executing '#{cmd}'"
  exec cmd
end

namespace :pow do
  task :check_for_pow do
    unless File.exists?(POW_PATH)
      puts "error: pow not found!"
      puts "install with 'curl get.pow.cx | sh'"

      exit(false)
    end
  end
  
  desc "Add application to pow"
  task :add => :check_for_pow do
    puts "Add '#{APP_NAME}' to pow ..."
    exec_with_explain "ln -s #{APP_PATH} #{POW_PATH}"
  end
  
  desc "Remove application from pow"
  task :remove => :check_for_pow do
    puts "Remove '#{APP_NAME}' from pow"
    exec_with_explain "rm #{File.join(POW_PATH, APP_NAME)}"
  end
  
  desc "Restart application"
  task :restart => :check_for_pow do
    puts "Restart '#{APP_NAME}'"
    exec_with_explain "touch #{File.join(APP_PATH, "tmp")}/restart.txt"
  end
  
  desc "Open application in browser"
  task :open => :check_for_pow do
    puts "Open'#{APP_NAME}' in browser ..."
    exec_with_explain "open http://#{APP_NAME}.dev"
  end
end
  
  <commit_msg>Improved messages<commit_after>APP_PATH = File.expand_path(".")
APP_NAME = File.basename(APP_PATH)
HOME = ENV['HOME']
POW_PATH = File.join(HOME, '.pow')

def exec_with_explain(cmd)
  puts "executing '#{cmd}'"
  exec cmd
end

namespace :pow do
  task :check_for_pow do
    unless File.exists?(POW_PATH)
      puts "error: '#{POW_PATH}' not found!"
      puts "install pow with 'curl get.pow.cx | sh'"

      exit(false)
    end
  end
  
  desc "Add application to pow"
  task :add => :check_for_pow do
    puts "Add '#{APP_NAME}' to pow"
    exec_with_explain "ln -s #{APP_PATH} #{POW_PATH}"
  end
  
  desc "Remove application from pow"
  task :remove => :check_for_pow do
    puts "Remove '#{APP_NAME}' from pow"
    exec_with_explain "rm #{File.join(POW_PATH, APP_NAME)}"
  end
  
  desc "Restart application"
  task :restart => :check_for_pow do
    puts "Restart '#{APP_NAME}'"
    exec_with_explain "touch #{File.join(APP_PATH, "tmp")}/restart.txt"
  end
  
  desc "Open application in browser"
  task :open => :check_for_pow do
    puts "Open '#{APP_NAME}'"
    exec_with_explain "open http://#{APP_NAME}.dev"
  end
end
  
  
{'fraction_non_alphanumeric': 0.1348364279398762, 'fraction_numerical': 0.0, 'mean_word_length': 3.50796812749004, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 11, 'https://': 0, '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': '5608424', 'n_tokens_mistral': 847, 'n_tokens_neox': 856, 'n_words': 223}