Skip to content

Commit e3b1a2e

Browse files
pftgclaude
andcommitted
fix: remove ActiveSupport runtime dependency (.presence → plain Ruby)
Replace .presence with plain Ruby conditional in Default reporter. The gem must work without Rails at runtime per engineering principles. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 993bcb9 commit e3b1a2e

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

lib/capybara/screenshot/diff/reporters/default.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@ class Default
88
def initialize(difference)
99
@difference = difference
1010

11-
screenshot_format = difference.comparison.options[:screenshot_format] || comparison.new_image_path.extname.delete_prefix(".").presence || "png"
11+
ext = comparison.new_image_path.extname.delete_prefix(".")
12+
screenshot_format = difference.comparison.options[:screenshot_format] || (ext unless ext.empty?) || "png"
1213
@annotated_image_path = comparison.new_image_path.sub_ext(".diff.#{screenshot_format}")
1314
@annotated_base_image_path = comparison.base_image_path.sub_ext(".diff.#{screenshot_format}")
1415
@heatmap_diff_path = comparison.new_image_path.sub_ext(".heatmap.diff.#{screenshot_format}")

0 commit comments

Comments
 (0)