File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 22
33## Unreleased
44
5- - Add ` GettextPO::File#each_message ` method.
5+ - Add ` GettextPO::File#each_message ` ,
6+ ` GettextPO::Message#each_workflow_flag ` , and
7+ ` GettextPO::Message#each_sticky_flag ` methods.
68
79## CRuby version 0.2.1 - 2026-03-16
810
Original file line number Diff line number Diff line change @@ -487,6 +487,11 @@ UPDATE_FLAG (workflow);
487487
488488/**
489489 * Document-method: workflow_flag_iterator
490+ * call-seq: workflow_flag_iterator -> GettextPO::FlagIterator
491+ *
492+ * You may find it handy to use the #workflow_flag_iterator method to
493+ * iterate over the sticky flag. This is for more versatile
494+ * manipulation.
490495 */
491496FLAG_ITER (workflow );
492497
@@ -565,6 +570,11 @@ UPDATE_FLAG (sticky);
565570
566571/**
567572 * Document-method: sticky_flag_iterator
573+ * call-seq: sticky_flag_iterator -> GettextPO::FlagIterator
574+ *
575+ * You may find it handy to use the #sticky_flag_iterator method to
576+ * iterate over the sticky flag. This is for more versatile
577+ * manipulation.
568578 */
569579FLAG_ITER (sticky );
570580#endif
Original file line number Diff line number Diff line change @@ -76,6 +76,28 @@ def file_positions
7676 end
7777 positions
7878 end
79+
80+ def each_sticky_flag # yields: flag
81+ iter = sticky_flag_iterator
82+ while true
83+ begin
84+ yield iter . next
85+ rescue StopIteration
86+ return
87+ end
88+ end
89+ end
90+
91+ def each_workflow_flag # yields: flag
92+ iter = workflow_flag_iterator
93+ while true
94+ begin
95+ yield iter . next
96+ rescue StopIteration
97+ return
98+ end
99+ end
100+ end
79101 end
80102
81103 class File
You can’t perform that action at this time.
0 commit comments