X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=lib%2Frbot%2Fregistry.rb;h=0eefc9da2155f1f1ae83a2d211e87514ea97c818;hb=b955d424d89655a04ba5f06d3cfee482ae33e713;hp=799e69ee4f0a72d9876b1257842dcd41b3915e84;hpb=6760a5d2f56cb9aceece5183cc0e3dfc619b60d2;p=user%2Fhenk%2Fcode%2Fruby%2Frbot.git diff --git a/lib/rbot/registry.rb b/lib/rbot/registry.rb index 799e69ee..0eefc9da 100644 --- a/lib/rbot/registry.rb +++ b/lib/rbot/registry.rb @@ -83,6 +83,18 @@ class Registry @@formats ||= Registry.new.discover end + # Will detect tokyocabinet registry location: ~/.rbot/registry/*.tdb + # and move it to its new location ~/.rbot/registry_tc/*.tdb + def migrate_registry_folder(path) + old_name = File.join(path, 'registry') + new_name = File.join(path, 'registry_tc') + if @format == 'tc' and File.exists?(old_name) and + not File.exists?(new_name) and + not Dir.glob(File.join(old_name, '*.tdb')).empty? + File.rename(old_name, new_name) + end + end + # Abstract database accessor (a hash-like interface). class AbstractAccessor