.git_helpers/ctags

changeset 187
84c6fa7ebc05
parent 180
96dbe6a6008d
equal deleted inserted replaced
186:4d168818b573 187:84c6fa7ebc05
18 target = "#{dir}/.tags" 18 target = "#{dir}/.tags"
19 tmp = "#{dir}/#{$$}.tags" 19 tmp = "#{dir}/#{$$}.tags"
20 20
21 opts = File.exists?(conf) ? "--options=#{conf}" : '' 21 opts = File.exists?(conf) ? "--options=#{conf}" : ''
22 22
23 sleep 10 if ENV['CTAGS_HOOK'] 23 sleep 5 if ENV['CTAGS_HOOK']
24 24
25 open( target, File::RDONLY|File::CREAT, 0644 ) do |f| 25 open( target, File::RDONLY|File::CREAT, 0644 ) do |f|
26 if ENV['CTAGS_HOOK'] 26 if ENV['CTAGS_HOOK']
27 exit unless f.flock( File::LOCK_EX|File::LOCK_NB ) 27 exit unless f.flock( File::LOCK_EX|File::LOCK_NB )
28 exit unless ( Time.now - f.mtime ) > 60 28 exit unless ( Time.now - f.mtime ) > 60

mercurial