Skip to content

Commit

Permalink
Merge pull request #2749 from ganmacs/ci-ruby-2.7
Browse files Browse the repository at this point in the history
Add ruby 2.7.0
  • Loading branch information
ganmacs authored Dec 27, 2019
2 parents 8d0f413 + b4ab3c2 commit 5ef1c03
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 14 deletions.
5 changes: 2 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ matrix:
dist: xenial
- rvm: 2.6.5
os: linux
- rvm: 2.7.0
os: linux
- rvm: ruby-head
os: linux
- rvm: ruby-head
Expand Down Expand Up @@ -57,9 +59,6 @@ branches:
- v0.12
- v0.14

before_install:
- gem update --system=2.7.8

sudo: false
dist: trusty # for TLSv1.2 support

Expand Down
2 changes: 1 addition & 1 deletion fluentd.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ Gem::Specification.new do |gem|
gem.add_runtime_dependency("certstore_c", ["~> 0.1.2"])
end

gem.add_development_dependency("rake", ["~> 11.0"])
gem.add_development_dependency("rake", ["~> 12.0"])
gem.add_development_dependency("flexmock", ["~> 2.0"])
gem.add_development_dependency("parallel_tests", ["~> 0.15.3"])
gem.add_development_dependency("simplecov", ["~> 0.7"])
Expand Down
21 changes: 13 additions & 8 deletions lib/fluent/config/literal_parser.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
require 'json'
require 'yajl'
require 'socket'
require 'irb/ruby-lex' # RubyLex
require 'ripper'

require 'fluent/config/basic_parser'

Expand Down Expand Up @@ -155,15 +155,20 @@ def scan_nonquoted_string(boundary_charset = LINE_END)
end

def scan_embedded_code
rlex = RubyLex.new
src = '"#{'+@ss.rest+"\n=end\n}"
src = '"#{'+@ss.rest+"\n=begin\n=end\n}"

input = StringIO.new(src)
input.define_singleton_method(:encoding) { external_encoding }
rlex.set_input(input)
seek = -1
while (seek = src.index('}', seek + 1))
unless Ripper.sexp(src[0..seek] + '"').nil? # eager parsing until valid expression
break
end
end

unless seek
raise Fluent::ConfigParseError, @ss.rest
end

tk = rlex.token
code = src[3,tk.seek-3]
code = src[3, seek-3]

if @ss.rest.length < code.length
@ss.pos += @ss.rest.length
Expand Down
4 changes: 2 additions & 2 deletions lib/fluent/plugin/out_http.rb
Original file line number Diff line number Diff line change
Expand Up @@ -212,9 +212,9 @@ def send_request(uri, req)
end

if res.is_a?(Net::HTTPSuccess)
log.debug { "#{res.code} #{res.message}#{res.body}" }
log.debug { "#{res.code} #{res.message.rstrip}#{res.body.lstrip}" }
else
msg = "#{res.code} #{res.message}#{res.body}"
msg = "#{res.code} #{res.message.rstrip} #{res.body.lstrip}"

if @retryable_response_codes.include?(res.code.to_i)
raise RetryableResponse, msg
Expand Down

0 comments on commit 5ef1c03

Please sign in to comment.