Sha256: 224929a24b33ae513694c96729ddd4335c68f204ee5e7e438b4bcdb948c69531

Contents?: true

Size: 1.49 KB

Versions: 2

Compression:

Stored size: 1.49 KB

Contents

# TODO: Make this compatible with rvm.
#       Run sudo gem on the system ruby, not the active ruby.
alias sgem='sudo gem'

# Find ruby file
alias rfind='find . -name "*.rb" | xargs grep -n'

## @robdimarco <http://innovationontherun.com> contributed the following code: ##

# Run a single Ruby test using Rake. This will also migrate the database and
# generally prepare the environment for testing, and is useful for tests
# which require a specific database setup to function.
_rbtest_with_rake() {
  if [ -f $1 ]; then
    case `echo $1 | cut -f 2 -d '/'` in
      unit)
        task='test:units'
        ;;
      functional)
        task='test:functionals'
        ;;
      integration)
        task='test:integration'
        ;;
      *)
        task='test'
        ;;
    esac
    bundle exec rake $task TEST1
  else
    bundle exec rake test
  fi
}
eval "function rtest_rake () { _rbtest_with_rake \$@}"

# Run a single Ruby test using `ruby -Itest`. This is the built-in testing
# framework that ships with Ruby 1.9 and is useful for running quick tests
# that don't require database connectivity or awareness of the Rails app.
_rbtest_without_rake() {
  if [ -f $1 ]; then
    bundle exec ruby -Itest $@;
  else
    echo "Please specify a file(s) to test"
  fi;
}
eval "function rtest_bare () {_rbtest_without_rake \$@}"

# Disable autocorrect
alias rtest='nocorrect rtest_bare'
alias rtest_rake='nocorrect rtest_rake'

# Shorthand aliases
alias t='rtest'
alias rts='rtest_rake'

# Run a ruby script
alias rb='ruby'

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
zsh_dots-0.5.1 lib/plugins/ruby/ruby.plugin.zsh
zsh_dots-0.5.0 lib/plugins/ruby/ruby.plugin.zsh