Skip to content

Commit

Permalink
Merge pull request #1442 from octokit/base64
Browse files Browse the repository at this point in the history
Drop support for Ruby 1.9.2 in `Octokit::Client::Contents#create_contents`
  • Loading branch information
nickfloyd committed Jun 8, 2022
2 parents c1f4c60 + be67ec0 commit dd622a3
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions lib/octokit/client/contents.rb
Expand Up @@ -80,9 +80,7 @@ def create_contents(*args)
end
raise ArgumentError, 'content or :file option required' if content.nil?

options[:content] = Base64.respond_to?(:strict_encode64) ?
Base64.strict_encode64(content) :
Base64.encode64(content).delete("\n") # Ruby 1.9.2
options[:content] = Base64.strict_encode64(content)
options[:message] = message
url = "#{Repository.path repo}/contents/#{path}"
put url, options
Expand Down

0 comments on commit dd622a3

Please sign in to comment.