Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make ErbTemplateProcessor aware of `String#<<` method for Ruby 2.5 #1149

Merged
merged 1 commit into from Dec 28, 2017

Conversation

Projects
None yet
2 participants
@pocke
Copy link
Contributor

pocke commented Dec 22, 2017

Currently, the test fails on Ruby 2.5.

$ ruby -v
ruby 2.5.0rc1 (2017-12-14 trunk 61243) [x86_64-linux]
$ bundle exec rake
Run options: --seed 24396

.................................................
�[1m�[32mNo warnings found�[0m

...



..Unrecognized action on _erbout: <<
Coverage report generated for Unit Tests to /home/pocke/ghq/github.com/presidentbeef/brakeman/coverage. 6542 / 11879 LOC (55.07%) covered.
rake aborted!
Command failed with status (1): [ruby -I"lib" -I"/home/pocke/.rbenv/versions/2.5.0-rc1/lib/ruby/gems/2.5.0/gems/rake-10.1.1/lib" "/home/pocke/.rbenv/versions/2.5.0-rc1/lib/ruby/gems/2.5.0/gems/rake-10.1.1/lib/rake/rake_test_loader.rb" "test/tests/*.rb" ]

Tasks: TOP => default => test
(See full trace by running task with --trace)

Because ERB uses String#<< instead of concat in Ruby 2.5.
See ruby/ruby#1612

This pull-request will fix the problem.

Make ErbTemplateProcessor aware of `String#<<` method for Ruby 2.5
Currently, the test fails on Ruby 2.5.

```
$ ruby -v
ruby 2.5.0rc1 (2017-12-14 trunk 61243) [x86_64-linux]
$ bundle exec rake
Run options: --seed 24396

.................................................
�[1m�[32mNo warnings found�[0m

...



..Unrecognized action on _erbout: <<
Coverage report generated for Unit Tests to /home/pocke/ghq/github.com/presidentbeef/brakeman/coverage. 6542 / 11879 LOC (55.07%) covered.
rake aborted!
Command failed with status (1): [ruby -I"lib" -I"/home/pocke/.rbenv/versions/2.5.0-rc1/lib/ruby/gems/2.5.0/gems/rake-10.1.1/lib" "/home/pocke/.rbenv/versions/2.5.0-rc1/lib/ruby/gems/2.5.0/gems/rake-10.1.1/lib/rake/rake_test_loader.rb" "test/tests/*.rb" ]

Tasks: TOP => default => test
(See full trace by running task with --trace)
```

Because ERB uses `String#<<` instead of `concat` in Ruby 2.5.
See ruby/ruby#1612

This pull-request will fix the problem.
@presidentbeef

This comment has been minimized.

Copy link
Owner

presidentbeef commented Dec 26, 2017

Hi @pocke, thank you for this. It appears there are other incompatibilities with ERB in 2.5.0 that need to be tracked down before I can merge this.

@presidentbeef

This comment has been minimized.

Copy link
Owner

presidentbeef commented Dec 26, 2017

@presidentbeef presidentbeef merged commit a0833d3 into presidentbeef:master Dec 28, 2017

5 checks passed

ci/circleci Your tests passed on CircleCI!
Details
codeclimate All good!
Details
codeclimate/diff-coverage 100% (80% threshold)
Details
codeclimate/total-coverage 94% (0.0% change)
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details

@pocke pocke deleted the pocke:ruby25 branch Dec 28, 2017

Repository owner locked and limited conversation to collaborators Feb 6, 2018

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
You can’t perform that action at this time.