Skip to content

Commit 0ea6529

Browse files
committed
Fix compatibility with --enable-frozen-string-literal
This has been a supported option of Ruby since Ruby 2.3, and even without it, mutating a string literal emits a warning.
1 parent 6889c47 commit 0ea6529

2 files changed

Lines changed: 5 additions & 1 deletion

File tree

.github/workflows/ruby.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ jobs:
2222
- 3.2
2323
- 3.3
2424
- 3.4
25+
- 4.0
2526
- head
2627

2728
steps:
@@ -36,3 +37,6 @@ jobs:
3637
env:
3738
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}
3839
run: bundle exec rake spec
40+
env:
41+
RUBYOPT: "--enable-frozen-string-literal --debug-frozen-string-literal"
42+

lib/docx/containers/paragraph.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ def to_s
4444

4545
# Return paragraph as a <p></p> HTML fragment with formatting based on properties.
4646
def to_html
47-
html = ''
47+
html = +''
4848
text_runs.each do |text_run|
4949
html << text_run.to_html
5050
end

0 commit comments

Comments
 (0)