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

CI: Use RUBYOPT: "--enable-frozen-string-literal" to find any incompatibilities #1354

Closed
wants to merge 7 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .github/workflows/octokit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,17 @@ jobs:
ruby-version: ${{ matrix.ruby }}
- name: Setup .netrc
run: chmod 600 spec/fixtures/.netrc
- name: Ruby 2.5 needs a newer RubyGems to support frozen-string-literal
if: ${{ matrix.ruby == '2.5' }}
run: gem update --system 2.7.11
- name: Install dependencies
run: |
bundle config set path .bundle/gems
bundle config set without development
bundle install --jobs 4 --retry 3
gem env version
- name: Test with RSpec
env:
GITHUB_CI: 1
RUBYOPT: --enable-frozen-string-literal
run: bundle exec rspec -w
6 changes: 3 additions & 3 deletions lib/octokit/error.rb
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ def response_error
def response_error_summary
return nil unless data.is_a?(Hash) && !Array(data[:errors]).empty?

summary = "\nError summary:\n"
summary = +"\nError summary:\n"
summary << data[:errors].map do |error|
if error.is_a? Hash
error.map { |k,v| " #{k}: #{v}" }
Expand All @@ -195,8 +195,8 @@ def response_error_summary
def build_error_message
return nil if @response.nil?

message = "#{@response[:method].to_s.upcase} "
message << redact_url(@response[:url].to_s) + ": "
message = +"#{@response[:method].to_s.upcase} "
message << redact_url(@response[:url].to_s.dup) + ": "
message << "#{@response[:status]} - "
message << "#{response_message}" unless response_message.nil?
message << "#{response_error}" unless response_error.nil?
Expand Down