<commit_before># Copyright 2008-2011 Red Hat, Inc, and individual contributors.
# 
# This is free software; you can redistribute it and/or modify it
# under the terms of the GNU Lesser General Public License as
# published by the Free Software Foundation; either version 2.1 of
# the License, or (at your option) any later version.
# 
# This software is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# Lesser General Public License for more details.
# 
# You should have received a copy of the GNU Lesser General Public
# License along with this software; if not, write to the Free
# Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
# 02110-1301 USA, or see the FSF site: http://www.fsf.org.

require 'rake'
require 'torquebox/deploy_utils'
require 'torquebox/upstart'
require 'torquebox/launchd'


namespace :torquebox do
  desc "Check your installation of the TorqueBox server"
  task :check do
    #this will raise if things aren't correct
    TorqueBox::DeployUtils.check_server 
    puts "TorqueBox Server OK: #{TorqueBox::DeployUtils.server_dir}"
  end

  desc "Run TorqueBox server"
  task :run=>[ :check ] do
    TorqueBox::DeployUtils.run_server
  end

  namespace :launchd do
    
    desc "Check if TorqueBox is installed as a launchd daemon"
    task :check=>[ 'torquebox:check' ] do
      TorqueBox::Launchd.check_install
    end

    desc "Install TorqueBox as an launchd daemon"
    task :install=>[ 'torquebox:check' ] do
      TorqueBox::Launchd.install
    end

    desc "Start TorqueBox when running as a launchd daemon"
    task :start=>[ :check ] do
      TorqueBox::DeployUtils.exec_command( 'launchctl start org.torquebox.TorqueBox' )
    end

    desc "Stop TorqueBox when running as an launchd daemon"
    task :stop=>[ :check ] do
      TorqueBox::DeployUtils.exec_command( 'launchctl stop org.torquebox.TorqueBox' )
    end

    desc "Restart TorqueBox when running as an launchd daemon"
    task :restart=>[ :check ] do
      TorqueBox::DeployUtils.exec_command( 'launchctl stop org.torquebox.TorqueBox' )
      TorqueBox::DeployUtils.exec_command( 'launchctl start org.torquebox.TorqueBox' )
    end

  end

  namespace :upstart do
    desc "Check if TorqueBox is installed as an upstart service"
    task :check=>[ 'torquebox:check' ] do
      TorqueBox::Upstart.check_install
      puts "TorqueBox is installed as an upstart service at #{TorqueBox::Upstart.opt_torquebox}"
    end

    desc "Install TorqueBox as an upstart service"
    task :install=>[ 'torquebox:check' ] do
      TorqueBox::DeployUtils.create_symlink
      TorqueBox::Upstart.copy_init_script
      puts "Done! Ensure that you have a 'torquebox' user with ownership or write permissions of /opt/torquebox"
    end<commit_msg>Fix rake torquebox:upstart:check (TORQUE-611)<commit_after># Copyright 2008-2011 Red Hat, Inc, and individual contributors.
# 
# This is free software; you can redistribute it and/or modify it
# under the terms of the GNU Lesser General Public License as
# published by the Free Software Foundation; either version 2.1 of
# the License, or (at your option) any later version.
# 
# This software is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# Lesser General Public License for more details.
# 
# You should have received a copy of the GNU Lesser General Public
# License along with this software; if not, write to the Free
# Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
# 02110-1301 USA, or see the FSF site: http://www.fsf.org.

require 'rake'
require 'torquebox/deploy_utils'
require 'torquebox/upstart'
require 'torquebox/launchd'


namespace :torquebox do
  desc "Check your installation of the TorqueBox server"
  task :check do
    #this will raise if things aren't correct
    TorqueBox::DeployUtils.check_server 
    puts "TorqueBox Server OK: #{TorqueBox::DeployUtils.server_dir}"
  end

  desc "Run TorqueBox server"
  task :run=>[ :check ] do
    TorqueBox::DeployUtils.run_server
  end

  namespace :launchd do
    
    desc "Check if TorqueBox is installed as a launchd daemon"
    task :check=>[ 'torquebox:check' ] do
      TorqueBox::Launchd.check_install
    end

    desc "Install TorqueBox as an launchd daemon"
    task :install=>[ 'torquebox:check' ] do
      TorqueBox::Launchd.install
    end

    desc "Start TorqueBox when running as a launchd daemon"
    task :start=>[ :check ] do
      TorqueBox::DeployUtils.exec_command( 'launchctl start org.torquebox.TorqueBox' )
    end

    desc "Stop TorqueBox when running as an launchd daemon"
    task :stop=>[ :check ] do
      TorqueBox::DeployUtils.exec_command( 'launchctl stop org.torquebox.TorqueBox' )
    end

    desc "Restart TorqueBox when running as an launchd daemon"
    task :restart=>[ :check ] do
      TorqueBox::DeployUtils.exec_command( 'launchctl stop org.torquebox.TorqueBox' )
      TorqueBox::DeployUtils.exec_command( 'launchctl start org.torquebox.TorqueBox' )
    end

  end

  namespace :upstart do
    desc "Check if TorqueBox is installed as an upstart service"
    task :check=>[ 'torquebox:check' ] do
      TorqueBox::Upstart.check_install
      puts "TorqueBox is installed as an upstart service at #{TorqueBox::DeployUtils.opt_torquebox}"
    end

    desc "Install TorqueBox as an upstart service"
    task :install=>[ 'torquebox:check' ] do
      TorqueBox::DeployUtils.create_symlink
      TorqueBox::Upstart.copy_init_script
      puts "Done! Ensure that you have a 'torquebox' user with ownership or write permissions of /opt/torquebox"
    end
{'fraction_non_alphanumeric': 0.07821132596685083, 'fraction_numerical': 0.007769337016574586, 'mean_word_length': 3.8315262718932446, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 19, 'https://': 0, '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': '1687089', 'n_tokens_mistral': 1801, 'n_tokens_neox': 1731, 'n_words': 654}