Change cache name to use application root directory name.

This commit is contained in:
Kazuya Takeshima 2013-06-27 19:39:01 +09:00
parent 9cab90cf96
commit 4f16845159
1 changed files with 4 additions and 2 deletions

View File

@ -180,10 +180,12 @@ __rails_generate_commands() {
)
_describe -t rails_generators 'rails generator' rails_generators
local application_directory
__rails_setup_application_directory
local cache_name
local -a all_generators
cache_name="rails_${$(pwd)##*/}_all_generators"
cache_name="rails/${application_directory##*/}/all_generators"
if ! _retrieve_cache ${cache_name}; then
local -a all_generators
all_generators=($(_call_program rails_generators rails generate 2> /dev/null | awk '/^ [a-zA-Z_]+/{ print $1 }'))
_store_cache ${cache_name} all_generators
fi