openvfs-rb 1.1.1 → 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/occ.rb +7 -1
- data/lib/openvfs/rb/version.rb +1 -1
- data/lib/openvfs.rb +7 -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/occ.rb
CHANGED
|
@@ -2,7 +2,13 @@
|
|
|
2
2
|
|
|
3
3
|
# Deliberately not "../openvfs": that pulls in the openvfs extension, which wraps the placeholder attributes libopenvfs keeps in extended attributes. Nothing here needs them, and upstream ships no Windows build of that library.
|
|
4
4
|
require_relative "version"
|
|
5
|
-
|
|
5
|
+
|
|
6
|
+
# One object per Ruby ABI in a platform gem, and in the source gem the single one extconf built under ext/. See lib/openvfs.rb.
|
|
7
|
+
begin
|
|
8
|
+
require_relative "occ/#{RUBY_VERSION[/\d+\.\d+/]}/occ"
|
|
9
|
+
rescue LoadError
|
|
10
|
+
require "openvfs/occ/occ"
|
|
11
|
+
end
|
|
6
12
|
|
|
7
13
|
require "fileutils"
|
|
8
14
|
require "securerandom"
|
data/lib/openvfs/rb/version.rb
CHANGED
data/lib/openvfs.rb
CHANGED
|
@@ -4,7 +4,13 @@
|
|
|
4
4
|
# Copyright, 2026, by Nathan Kidd.
|
|
5
5
|
|
|
6
6
|
require_relative "openvfs/version"
|
|
7
|
-
|
|
7
|
+
|
|
8
|
+
# A precompiled platform gem carries one object per Ruby ABI, because an object only loads on the Ruby it was compiled against. The source gem has no ABI directory - extconf builds one object, under ext/ - so the fallback is the plain require the load path answers.
|
|
9
|
+
begin
|
|
10
|
+
require_relative "openvfs/#{RUBY_VERSION[/\d+\.\d+/]}/openvfs"
|
|
11
|
+
rescue LoadError
|
|
12
|
+
require "openvfs/openvfs"
|
|
13
|
+
end
|
|
8
14
|
|
|
9
15
|
# A virtual filesystem.
|
|
10
16
|
module OpenVFS
|