<commit_before>#
# Defines Ruby on Rails aliases.
#
# Authors:
#   <NAME> <<EMAIL>>
#   <NAME> <<EMAIL>>
#   <NAME> <<EMAIL>>
#

# Return if requirements are not found.
if (( ! $+commands[rails] )); then
  return 1
fi

#
# Aliases (Compatible with Rails 2)
#

alias r='rails'
alias rc='_rails-command console'
alias rdc='_rails-command dbconsole'
alias rdm='rake db:migrate'
alias rdM='rake db:migrate db:test:clone'
alias rdr='rake db:rollback'
alias rg='_rails-command generate'
alias rl='tail -f log/development.log'
alias rlc='rake log:clear'
alias rp='_rails-command plugin'
alias rr='_rails-command runner'
alias rs='_rails-command server'
alias rsd='_rails-command server --debugger'
alias rx='_rails-command destroy'

# Migrate and clone structure in to test database
alias migrate='rake db:migrate db:test:clone_structure'

# Zeus commands
alias z='zeus start'
alias zg='zeus generate'
alias zs='zeus server'
alias zc='zeus console'
alias zr='zeus rspec'
alias zk='zeus cucumber'
alias zrn='zeus runner'
alias zdb='zeus dbconsole'
alias zrake='zeus rake'

#
# Functions
#

function _rails-command {
  if [[ -e "script/server" ]]; then
    ruby script/"$@"
  else
    ruby script/rails "$@"
  fi
}<commit_msg>Use Zeus for Rails commands when possible<commit_after>#
# Defines Ruby on Rails aliases.
#
# Authors:
#   <NAME> <<EMAIL>>
#   <NAME> <<EMAIL>>
#   <NAME> <<EMAIL>>
#   <NAME> <<EMAIL>>
#

# Return if requirements are not found.
if (( ! $+commands[rails] )); then
  return 1
fi

#
# Aliases (Compatible with Rails 2)
#

alias r='_rails-command'
alias rc='r console'
alias rdc='r dbconsole'
alias rg='r generate'
alias rp='r plugin'
alias rr='r runner'
alias rs='r server'
alias rsd='r server --debugger'
alias rx='r destroy'
alias rl='tail -f log/development.log'

alias rdm='_rake-command db:migrate'
alias rdM='_rake-command db:migrate db:test:clone'
alias rdr='_rake-command db:rollback'
alias rlc='_rake-command log:clear'

# Migrate and clone structure in to test database
alias migrate='_rake-command db:migrate db:test:clone_structure'

# Zeus commands
alias z='zeus start'
alias zg='zeus generate'
alias zs='zeus server'
alias zc='zeus console'
alias zr='zeus rspec'
alias zk='zeus cucumber'
alias zrn='zeus runner'
alias zdb='zeus dbconsole'
alias zrake='zeus rake'

#
# Functions
#

function _rails-command {
  if [[ -e ".zeus.sock" ]]; then
    zeus "$@"
  elif [[ -e "script/server" ]]; then
    ruby script/"$@"
  else
    ruby script/rails "$@"
  fi
}

function _rake-command {
  if [[ -e ".zeus.sock" ]]; then
    zeus rake "$@"
  else
    rake "$@"
  fi
}
{'fraction_non_alphanumeric': 0.14600231749710313, 'fraction_numerical': 0.001544998068752414, 'mean_word_length': 4.581896551724138, 'pattern_counts': {'":': 0, '<': 24, '<?xml version=': 0, '>': 24, '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': '2103857', 'n_tokens_mistral': 991, 'n_tokens_neox': 942, 'n_words': 280}