📜 ⬆️ ⬇️

Rake auto-complete



Auto-completion in bash by Tab is an incredibly handy thing. And it definitely needs rake , which every Ruby programmer uses frequently.

Particularly lazy programmers have long written homemade scripts in their .bashrc . But a real Zen programmer does not have to love bicycles and honors repositories and packages. So I put the script into a package and put the PPA in Ubuntu on Rails .
')

Installation


Ubuntu
  1. Add Ubuntu on Rails PPA :
    $ sudo add-apt-repository ppa:ubuntu-on-rails/ppa
  2. Install the rake-completion package:
    $ sudo apt-get install rake-completion
Other UNIX
  1. Clone the repository:
    $ git clone git://github.com/ai/rake-completion.git
  2. Copy the script to the system folder:
    $ sudo cp rake-completion/rake /etc/bash_completion.d/ .

Details


Rake tasks are cached in .rake_tasks~ in the project folder, because, for example, in Rails Rakefile starts up very slowly, because it loads the whole project environment first.

To prevent the cache and backups from reaching the git repository, simply add to .gitignore: *~

The cache is automatically updated when changes are made to Rakefile or any *.rake files in the project.

The script is written in sh. Should work in zsh. In the repository there are also tests for sh :).

Source: https://habr.com/ru/post/76412/


All Articles