require 'chronic'
$have_chronic = true
rescue LoadError => e
- Redwood::log "optional 'chronic' library not found (run 'gem install chronic' to install)"
+ debug "optional 'chronic' library not found; date-time query restrictions disabled"
$have_chronic = false
end
def initialize dir=BASE_DIR
@dir = dir
@lock = Lockfile.new lockfile, :retries => 0, :max_age => nil
- self.class.i_am_the_instance self
end
def lockfile; File.join @dir, "lock" end
def lock
- Redwood::log "locking #{lockfile}..."
+ debug "locking #{lockfile}..."
begin
@lock.lock
rescue Lockfile::MaxTriesLockError
def unlock
if @lock && @lock.locked?
- Redwood::log "unlocking #{lockfile}..."
+ debug "unlocking #{lockfile}..."
@lock.unlock
end
end
end
def save
- Redwood::log "saving index and sources..."
+ debug "saving index and sources..."
FileUtils.mkdir_p @dir unless File.exists? @dir
SourceManager.save_sources
save_index
unimplemented
end
- ## Syncs the message to the index, replacing any previous version. adding
- ## either way. Index state will be determined by the message's #labels
- ## accessor.
- def sync_message m, opts={}
- unimplemented
- end
+ def add_message m; unimplemented end
+ def update_message m; unimplemented end
+ def update_message_state m; unimplemented end
def save_index fn
unimplemented
else fail "unknown index type #{index_name.inspect}"
end
Index = Redwood.const_get "#{index_name.capitalize}Index"
-Redwood::log "using index #{Index.name}"
+debug "using index #{Index.name}"
end