openvfs-rb 1.1.2 → 1.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/ext/openvfs/occ/sync.cpp +32 -0
- data/lib/openvfs/rb/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 29c136caf4ca8b682906683f57159f2e248445ebda666a53e149a189c5842b68
|
|
4
|
+
data.tar.gz: adaea2a9c4acda51827589efe7546f9d52257df4de0752db599329e81c69a993
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 9630ec6c73b5817e413fd823feb040c7ac418ebe3474c3c5d746075bc5398c9455692c40b3876a3bc582afdc2111e0904cf898b9303964f6474851d7ab31f2be
|
|
7
|
+
data.tar.gz: 38a35118b91d71e4b4220b3b6518b591c10842c44189e352185eaf60bd36ab35199cb2e76c6a23243755b5f396d65f19e0ab80a69e12a8690fa157ba088cda15
|
data/ext/openvfs/occ/sync.cpp
CHANGED
|
@@ -636,6 +636,26 @@ extern "C" void Init_occ()
|
|
|
636
636
|
.define_attr("estimated_bandwidth", &OCC::ProgressInfo::Estimates::estimatedBandwidth, Rice::AttrAccess::Read)
|
|
637
637
|
.define_attr("estimated_eta", &OCC::ProgressInfo::Estimates::estimatedEta, Rice::AttrAccess::Read);
|
|
638
638
|
|
|
639
|
+
// One file's share of the run. The engine keeps a Progress per file in flight and
|
|
640
|
+
// discards it when the file finishes, so this is what a per-file progress bar reads;
|
|
641
|
+
// ProgressInfo's own totals are the whole run.
|
|
642
|
+
Data_Type<OCC::ProgressInfo::Progress> rb_cProgress =
|
|
643
|
+
define_class_under<OCC::ProgressInfo::Progress>(rb_mOpenVFS, "Progress")
|
|
644
|
+
.define_method("completed", &OCC::ProgressInfo::Progress::completed)
|
|
645
|
+
.define_method("remaining", &OCC::ProgressInfo::Progress::remaining)
|
|
646
|
+
.define_method("estimates", &OCC::ProgressInfo::Progress::estimates);
|
|
647
|
+
|
|
648
|
+
Data_Type<OCC::ProgressInfo::ProgressItem> rb_cProgressItem =
|
|
649
|
+
define_class_under<OCC::ProgressInfo::ProgressItem>(rb_mOpenVFS, "ProgressItem")
|
|
650
|
+
// Both by value, so Ruby owns a copy and may keep it after the signal returns -
|
|
651
|
+
// the engine's own entry goes when the file does.
|
|
652
|
+
.define_method("item", [](const OCC::ProgressInfo::ProgressItem &self) {
|
|
653
|
+
return OCC::SyncFileItemPtr::create(self._item);
|
|
654
|
+
})
|
|
655
|
+
.define_method("progress", [](const OCC::ProgressInfo::ProgressItem &self) {
|
|
656
|
+
return self._progress;
|
|
657
|
+
});
|
|
658
|
+
|
|
639
659
|
Data_Type<OCC::ProgressInfo> rb_cProgressInfo =
|
|
640
660
|
define_class_under<OCC::ProgressInfo>(rb_mOpenVFS, "ProgressInfo")
|
|
641
661
|
.define_method("status", &OCC::ProgressInfo::status)
|
|
@@ -652,6 +672,18 @@ extern "C" void Init_occ()
|
|
|
652
672
|
.define_method("file_progress", [](const OCC::ProgressInfo &self, const OCC::SyncFileItemPtr &item) {
|
|
653
673
|
return self.fileProgress(*item);
|
|
654
674
|
}, Arg("item"))
|
|
675
|
+
// The files in flight, keyed by the path the engine names them by. A Hash rather
|
|
676
|
+
// than the QHash itself: Rice ships no converter for one, and what a caller wants
|
|
677
|
+
// is to look a path up.
|
|
678
|
+
.define_method("current_items", [](const OCC::ProgressInfo &self) {
|
|
679
|
+
Hash items;
|
|
680
|
+
|
|
681
|
+
for (auto entry = self._currentItems.constBegin(); entry != self._currentItems.constEnd(); ++entry) {
|
|
682
|
+
items[entry.key()] = entry.value();
|
|
683
|
+
}
|
|
684
|
+
|
|
685
|
+
return items;
|
|
686
|
+
})
|
|
655
687
|
.define_method("current_discovered_remote_folder", [](const OCC::ProgressInfo &self) {
|
|
656
688
|
return self._currentDiscoveredRemoteFolder;
|
|
657
689
|
})
|
data/lib/openvfs/rb/version.rb
CHANGED