Skip to content

Commit e1c3863

Browse files
committed
Fix message each workflow flag without given block.
1 parent f6a47bc commit e1c3863

3 files changed

Lines changed: 10 additions & 3 deletions

File tree

CHANGELOG.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
## Unreleased
44

55
- Enable file each message method, message iterator each method flag
6-
iterator each method, and message each sticky flag method to run
7-
without given block.
6+
iterator each method, message each sticky flag method, and message
7+
each workflow flag method to run without given block.
88

99
## CRuby and mruby version 0.3.0 - 2026-03-17
1010

mrblib/mrb_gettextpo_common.rb

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,12 @@ def each_sticky_flag
9898
end
9999
end
100100

101-
def each_workflow_flag # yields: flag
101+
# call-seq:
102+
# each_workflow_flag { |flag| ... }
103+
# each_workflow_flag -> Enumerator
104+
def each_workflow_flag
105+
block_given? or return enum_for(__method__)
106+
102107
iter = workflow_flag_iterator
103108
while true
104109
begin

test/message.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,9 @@
9292
path = File.expand_path(File.join(__FILE__, "../../test.cruby/resources/flag.po"))
9393
iterator = GettextPO::File.read(path).message_iterator
9494
message = iterator.next
95+
9596
assert_equal ['no-wrap'], message.each_sticky_flag.to_a
97+
assert_equal ['fuzzy'], message.each_workflow_flag.to_a
9698

9799
true
98100
end

0 commit comments

Comments
 (0)