added node_env
This commit is contained in:
@@ -7,6 +7,28 @@ module Xgrep
|
|||||||
end
|
end
|
||||||
|
|
||||||
def update_pathspec ( pathspec )
|
def update_pathspec ( pathspec )
|
||||||
|
files = %w{app.js Gruntfile.js routes.js server.js package.json}
|
||||||
|
dirs = %w{api app config controllers db lib models routes script views}
|
||||||
|
specs = %w{spec test}
|
||||||
|
assets = {}
|
||||||
|
%w{js css less}.each do |ext|
|
||||||
|
assets += Dir.glob("assets/**/*.#{ext}").reject { |x| x =- Regexp.new("\\.min\\.#{ext}$") }
|
||||||
|
end
|
||||||
|
|
||||||
|
if pathspec.empty?
|
||||||
|
@pathspec = files + dirs + specs
|
||||||
|
elsif pathspec.include? :core
|
||||||
|
@pathspec = files + dirs
|
||||||
|
else
|
||||||
|
@pathspec += assets if pathspec.include? :asset
|
||||||
|
@pathspec += %w{models api/models app/models} if pathspec.include? :models
|
||||||
|
@pathspec += %w{views api/views app/views} if pathspec.include? :views
|
||||||
|
@pathspec += %w{controllers api/controllers app/controllers} if pathspec.include? :controllers
|
||||||
|
@pathspec += %w{config} if pathspec.include? :config
|
||||||
|
@pathspec += %w{db} if pathspec.include? :db
|
||||||
|
@pathspec += %w{lib} if pathspec.include? :lib
|
||||||
|
@pathspec += %w{spec test} if pathspec.include? :spec
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user