i18n-context-generator 0.5.1 → 0.5.2

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: 2109020f4ff761dcf5fdd9817499b551619dc8ee17cef9e88acc881ac5ad647f
4
- data.tar.gz: 26c9e86a187bbe4f2a0523754a7ee78912d96d9e532e261143ce905106cfd3da
3
+ metadata.gz: dcb1a093f3a2207078b47a564a3d67fde8b31af4b74825f920b9ffb80351180f
4
+ data.tar.gz: 5d118d38f5399039bd53a97027388c880ebf8ee2fd1c46298fde2f5a8f5a2170
5
5
  SHA512:
6
- metadata.gz: ed14b199d897b8ee27dbd793c372df01b72efc4a9b6a1122cd9fa724abb76030b93e1c967f82c02c5fafb4e104fba3b8abe10b9b1d672d95521b9b9f04d6b555
7
- data.tar.gz: e13a1a8d4c17823597727717afb4f5950d0790109c35a124262989504123165a2111482fe9d27bf9baff3de930c9bc8fb6159edb1dee1ed9a8ad863beb6c346c
6
+ metadata.gz: 1a15c0a6c0415a445a4a5d3274a300281713606632a65b4cd759c2de179eaf1f0c832d211ccc4855d1297c13f8cfbcc86b767278f50c12d1f02e39d0272fc446
7
+ data.tar.gz: a7b20b6c494dc5357b7751cf76ad9cd7befc774cb6f1198fe49ec6874826a2f1f682f373bb2afe2637d6e72094a2950b99cc48c6a100ff30a2d339a5f95f7636
@@ -63,14 +63,23 @@ module I18nContextGenerator
63
63
  pending_tag: nil,
64
64
  file_path: file_path,
65
65
  added_file_lines: [],
66
- xml_comment_state: {}
66
+ xml_comment_state: {},
67
+ in_hunk: false
67
68
  }
68
69
  end
69
70
 
70
71
  def parse_xml_diff!(state, diff_output)
71
72
  diff_output.each_line do |line|
73
+ if line.start_with?('diff ')
74
+ state[:file_line] = nil
75
+ state[:in_hunk] = false
76
+ next
77
+ end
78
+
72
79
  next if update_xml_hunk_line?(state, line)
73
- next if line.start_with?('diff ', 'index ', '--- ', '+++ ')
80
+ next if !state[:in_hunk] && line.start_with?('index ', '--- ', '+++ ')
81
+ next unless state[:in_hunk]
82
+ next if line.start_with?('\\')
74
83
 
75
84
  is_removed = line.start_with?('-')
76
85
  is_added = line.start_with?('+')
@@ -103,6 +112,7 @@ module I18nContextGenerator
103
112
  state[:current_string] = nil
104
113
  state[:pending_tag] = nil
105
114
  state[:xml_comment_state] = {}
115
+ state[:in_hunk] = true
106
116
  true
107
117
  end
108
118
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module I18nContextGenerator
4
- VERSION = '0.5.1'
4
+ VERSION = '0.5.2'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: i18n-context-generator
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.1
4
+ version: 0.5.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Automattic
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2026-07-24 00:00:00.000000000 Z
11
+ date: 2026-08-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: concurrent-ruby