Skip to content

Commit bccf69d

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 bccf69d

2 files changed

Lines changed: 4 additions & 1 deletion

File tree

.github/workflows/ruby.yml

Lines changed: 3 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:
@@ -35,4 +36,6 @@ jobs:
3536
- name: Run tests
3637
env:
3738
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}
39+
RUBYOPT: "--enable-frozen-string-literal --debug-frozen-string-literal"
3840
run: bundle exec rake spec
41+

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)