added rails_env

This commit is contained in:
rkiel
2015-06-03 21:28:23 -04:00
parent 3fab1dc9f4
commit b4f1ecdeab

View File

@@ -7,6 +7,27 @@ module Xgrep
end
def update_pathspec ( pathspec )
files = %w{Capfile Gemfile Rakefile}
dirs = %w{app config db lib}
specs = %w{spec}
if pathspec.empty?
@pathspec = files + dirs + specs
elsif pathspec.include? :core
@pathspec = files + dirs
else
@pathspec += %w{app/assets} if pathspec.include? :asset
@pathspec += %w{app/helpers} if pathspec.include? :helper
@pathspec += %w{app/mailers} if pathspec.include? :mailer
@pathspec += %w{app/models} if pathspec.include? :models
@pathspec += %w{app/views} if pathspec.include? :views
@pathspec += %w{app/controllers} if pathspec.include? :controllers
@pathspec += %w{app/services} if pathspec.include? :services
@pathspec += %w{config} if pathspec.include? :config
@pathspec += %w{db} if pathspec.include? :db
@pathspec += %w{lib} if pathspec.include? :lib
@pathspec += %w{spec} if pathspec.include? :spec
end
end
end
end