lib/bdsync/core.rb in bdsync-2.2.0 vs lib/bdsync/core.rb in bdsync-2.3.0
- old
+ new
@@ -26,35 +26,29 @@
Utils.try_lock {
loop {
@old_data = load_data
@data = {}
- start_session {
- remote_ensure_dir @remote_root_path
- local_ensure_dir @local_root_path
+ remote_ensure_dir @remote_root_path
+ local_ensure_dir @local_root_path
- puts "\n==== traverse_remote_path ===="
- traverse_remote_path @remote_root_path
+ puts "\n==== traverse_remote_path ===="
+ traverse_remote_path @remote_root_path
- # merge @data to @old_data, and clear @data
- @old_data.merge! @data
- @data = {}
+ # merge @data to @old_data, and clear @data
+ @old_data.merge! @data
+ @data = {}
- puts "\n==== traverse_local_path ===="
- traverse_local_path @local_root_path
- }
+ puts "\n==== traverse_local_path ===="
+ traverse_local_path @local_root_path
save_data @data
break if !@infinite_loop
sleep 1
}
}
- end
-
- def start_session &block
- fail NotImplementedError, "A subclass class must be able to #{__method__}!"
end
def load_data
puts "\nload #{@data_path}"
YAML.load_file @data_path