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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 66a6247ce26a8d5388b5a5b6982958ea408cec169465cf08bb2f1e13145631b7
4
- data.tar.gz: db6e541828e75ac889314d49fda159f32a38c752d3dbab554ea9a56a67a9708f
3
+ metadata.gz: 29c136caf4ca8b682906683f57159f2e248445ebda666a53e149a189c5842b68
4
+ data.tar.gz: adaea2a9c4acda51827589efe7546f9d52257df4de0752db599329e81c69a993
5
5
  SHA512:
6
- metadata.gz: a5f1069b92d4e3ed00126fe2da06cebc425cd9ecb3084566940ed177336c4a074d396d4c7ef91591bac55aae6eaf2b6aa2f8d04364ee8ca613ede3d95be96769
7
- data.tar.gz: b55c9d9884575814ac17200e3f78ef60d4eb67b3109ead5ba5acdb0e58697f0da62ddc28f97275285778ef93cbaa219bcde8ea950669af8a65879b4be550c5ab
6
+ metadata.gz: 9630ec6c73b5817e413fd823feb040c7ac418ebe3474c3c5d746075bc5398c9455692c40b3876a3bc582afdc2111e0904cf898b9303964f6474851d7ab31f2be
7
+ data.tar.gz: 38a35118b91d71e4b4220b3b6518b591c10842c44189e352185eaf60bd36ab35199cb2e76c6a23243755b5f396d65f19e0ab80a69e12a8690fa157ba088cda15
@@ -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
  })
@@ -5,6 +5,6 @@
5
5
 
6
6
  module OpenVFS
7
7
  module Rb
8
- VERSION = "1.1.2"
8
+ VERSION = "1.1.3"
9
9
  end
10
10
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: openvfs-rb
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.2
4
+ version: 1.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nathan Kidd