File: ihelp_reindex.rb

package info (click to toggle)
libihelp-ruby 0.4.5-2
  • links: PTS, VCS
  • area: main
  • in suites: lenny, squeeze
  • size: 120 kB
  • ctags: 251
  • sloc: ruby: 1,763; makefile: 9
file content (21 lines) | stat: -rwxr-xr-x 522 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#!/usr/bin/ruby

require 'rubygems'
require 'ihelp'
begin
  require 'ferret'
rescue Exception
  STDERR.puts "Unable to load Ferret, can't update full text index."
  STDERR.puts "Try `gem install ferret' if you don't have already."
  exit 1
end

IHelp::IHelpIndex.reindex_when_needed = true
idx = IHelp::IHelpIndex.new
if idx.path == IHelp::IHelpIndex::GLOBAL_INDEX_PATH
 begin
  STDERR.puts
  STDERR.puts 'Making global index at '+idx.path+' readable'
  Dir[File.join(idx.path,"*")].each{|n| File.chmod 0644, n }
 end
end