Skip to content

Commit 95216e7

Browse files
authored
Merge pull request #6607 from rubyforgood/dependabot/bundler/sablon-0.4.3
build(deps): bump sablon from 0.3.2 to 0.4.3
2 parents 01f3fe3 + 687e123 commit 95216e7

File tree

3 files changed

+8
-4
lines changed

3 files changed

+8
-4
lines changed

Gemfile.lock

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -577,9 +577,9 @@ GEM
577577
logger
578578
ruby2_keywords (0.0.5)
579579
rubyzip (2.4.1)
580-
sablon (0.3.2)
580+
sablon (0.4.3)
581581
nokogiri (>= 1.8.5)
582-
rubyzip (>= 1.1.1)
582+
rubyzip (>= 1.3.0)
583583
safe_shell (1.1.0)
584584
sanitize (7.0.0)
585585
crass (~> 1.0.2)

app/models/case_court_report.rb

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@ class CaseCourtReport
77

88
def initialize(path_to_template:, context:)
99
@context = context
10+
# Validate template exists before processing (sablon 0.4+ no longer raises Zip::Error)
11+
raise Zip::Error, "Template file not found: #{path_to_template}" unless File.exist?(path_to_template)
12+
1013
# NOTE: this is what is used for docx templates
1114
@template = Sablon.template(path_to_template)
1215
end

spec/models/case_court_report_spec.rb

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -393,8 +393,9 @@
393393
path_to_template: nonexistent_path
394394
}
395395
context = CaseCourtReportContext.new(args).context
396-
bad_report = CaseCourtReport.new(path_to_template: nonexistent_path, context: context)
397-
expect { bad_report.generate_to_string }.to raise_error(Zip::Error)
396+
expect {
397+
CaseCourtReport.new(path_to_template: nonexistent_path, context: context)
398+
}.to raise_error(Zip::Error, /Template file not found/)
398399
end
399400
end
400401

0 commit comments

Comments
 (0)