diff --git a/release.rb b/release.rb index 31ec6ddc..13c45564 100644 --- a/release.rb +++ b/release.rb @@ -20,7 +20,7 @@ new_release_notes = [] new_release_notes <<= "\#\# #{next_version}\n" -new_release_notes <<= logs.split(/\n/) +new_release_notes <<= logs.split("\n") .reject { |line| line.include?("#{last_version} release notes") } .map { |x| rev = x[0..6] diff --git a/spec/statement_client_spec.rb b/spec/statement_client_spec.rb index 19bd223a..ad1bf34f 100644 --- a/spec/statement_client_spec.rb +++ b/spec/statement_client_spec.rb @@ -32,14 +32,14 @@ it "sets headers" do stub_request(:post, "localhost/v1/statement"). with(body: query, - headers: { - "User-Agent" => "trino-ruby/#{VERSION}", - "X-Trino-Catalog" => options[:catalog], - "X-Trino-Schema" => options[:schema], - "X-Trino-User" => options[:user], - "X-Trino-Language" => options[:language], - "X-Trino-Time-Zone" => options[:time_zone], - }).to_return(body: response_json.to_json) + headers: { + "User-Agent" => "trino-ruby/#{VERSION}", + "X-Trino-Catalog" => options[:catalog], + "X-Trino-Schema" => options[:schema], + "X-Trino-User" => options[:user], + "X-Trino-Language" => options[:language], + "X-Trino-Time-Zone" => options[:time_zone], + }).to_return(body: response_json.to_json) StatementClient.new(faraday, query, options) end @@ -56,14 +56,14 @@ retry_p = false stub_request(:post, "localhost/v1/statement"). with(body: query, - headers: { - "User-Agent" => "trino-ruby/#{VERSION}", - "X-Trino-Catalog" => options[:catalog], - "X-Trino-Schema" => options[:schema], - "X-Trino-User" => options[:user], - "X-Trino-Language" => options[:language], - "X-Trino-Time-Zone" => options[:time_zone], - }).to_return(body: response_json2.to_json) + headers: { + "User-Agent" => "trino-ruby/#{VERSION}", + "X-Trino-Catalog" => options[:catalog], + "X-Trino-Schema" => options[:schema], + "X-Trino-User" => options[:user], + "X-Trino-Language" => options[:language], + "X-Trino-Time-Zone" => options[:time_zone], + }).to_return(body: response_json2.to_json) stub_request(:get, "localhost/v1/next_uri"). with(headers: { @@ -85,15 +85,15 @@ retry_p = false stub_request(:post, "localhost/v1/statement"). with(body: query, - headers: { - "User-Agent" => "trino-ruby/#{VERSION}", - "X-Trino-Catalog" => options[:catalog], - "X-Trino-Schema" => options[:schema], - "X-Trino-User" => options[:user], - "X-Trino-Language" => options[:language], - "X-Trino-Time-Zone" => options[:time_zone], - "Accept" => "application/x-msgpack,application/json" - }).to_return(body: MessagePack.dump(response_json2), headers: {"Content-Type" => "application/x-msgpack"}) + headers: { + "User-Agent" => "trino-ruby/#{VERSION}", + "X-Trino-Catalog" => options[:catalog], + "X-Trino-Schema" => options[:schema], + "X-Trino-User" => options[:user], + "X-Trino-Language" => options[:language], + "X-Trino-Time-Zone" => options[:time_zone], + "Accept" => "application/x-msgpack,application/json" + }).to_return(body: MessagePack.dump(response_json2), headers: {"Content-Type" => "application/x-msgpack"}) stub_request(:get, "localhost/v1/next_uri"). with(headers: { @@ -251,14 +251,14 @@ it "sends DELETE request with empty body to /v1/query/{queryId}" do stub_request(:delete, "http://localhost/v1/query/#{query_id}"). with(body: "", - headers: { - "User-Agent" => "trino-ruby/#{VERSION}", - "X-Trino-Catalog" => options[:catalog], - "X-Trino-Schema" => options[:schema], - "X-Trino-User" => options[:user], - "X-Trino-Language" => options[:language], - "X-Trino-Time-Zone" => options[:time_zone], - }).to_return(body: {}.to_json) + headers: { + "User-Agent" => "trino-ruby/#{VERSION}", + "X-Trino-Catalog" => options[:catalog], + "X-Trino-Schema" => options[:schema], + "X-Trino-User" => options[:user], + "X-Trino-Language" => options[:language], + "X-Trino-Time-Zone" => options[:time_zone], + }).to_return(body: {}.to_json) Trino::Client.new(options).kill(query_id) end @@ -281,9 +281,9 @@ stub_request(:post, "localhost/v1/statement"). with(body: query, - headers: headers.merge({ - "X-Trino-Session" => options[:properties].map { |k, v| "#{k}=#{v}" }.join(", ") - })). + headers: headers.merge({ + "X-Trino-Session" => options[:properties].map { |k, v| "#{k}=#{v}" }.join(", ") + })). to_return(body: response_json.to_json) StatementClient.new(faraday, query, options) @@ -294,7 +294,7 @@ stub_request(:post, "localhost/v1/statement"). with(body: query, - headers: headers.merge("X-Trino-Client-Info" => "raw")). + headers: headers.merge("X-Trino-Client-Info" => "raw")). to_return(body: response_json.to_json) StatementClient.new(faraday, query, options) @@ -305,7 +305,7 @@ stub_request(:post, "localhost/v1/statement"). with(body: query, - headers: headers.merge("X-Trino-Client-Info" => '{"k1":"v1","k2":"v2"}')). + headers: headers.merge("X-Trino-Client-Info" => '{"k1":"v1","k2":"v2"}')). to_return(body: response_json.to_json) StatementClient.new(faraday, query, options) @@ -316,7 +316,7 @@ stub_request(:post, "localhost/v1/statement"). with(body: query, - headers: headers.merge("X-Trino-Client-Tags" => "k1:v1,k2:v2")). + headers: headers.merge("X-Trino-Client-Tags" => "k1:v1,k2:v2")). to_return(body: response_json.to_json) StatementClient.new(faraday, query, options) @@ -329,15 +329,15 @@ it "adds basic auth headers when ssl is enabled and a password is given" do stub_request(:post, "https://localhost/v1/statement"). with(body: query, - headers: { - "User-Agent" => "trino-ruby/#{VERSION}", - "X-Trino-Catalog" => options[:catalog], - "X-Trino-Schema" => options[:schema], - "X-Trino-User" => options[:user], - "X-Trino-Language" => options[:language], - "X-Trino-Time-Zone" => options[:time_zone], - }, - basic_auth: [options[:user], password] + headers: { + "User-Agent" => "trino-ruby/#{VERSION}", + "X-Trino-Catalog" => options[:catalog], + "X-Trino-Schema" => options[:schema], + "X-Trino-User" => options[:user], + "X-Trino-Language" => options[:language], + "X-Trino-Time-Zone" => options[:time_zone], + }, + basic_auth: [options[:user], password] ).to_return(body: response_json.to_json) options.merge!(ssl: {verify: true}, password: password) @@ -464,14 +464,14 @@ it "parse nested json properly" do stub_request(:post, "localhost/v1/statement"). with(body: query, - headers: { - "User-Agent" => "trino-ruby/#{VERSION}", - "X-Trino-Catalog" => options[:catalog], - "X-Trino-Schema" => options[:schema], - "X-Trino-User" => options[:user], - "X-Trino-Language" => options[:language], - "X-Trino-Time-Zone" => options[:time_zone], - }).to_return(body: nested_json.to_json(:max_nesting => false)) + headers: { + "User-Agent" => "trino-ruby/#{VERSION}", + "X-Trino-Catalog" => options[:catalog], + "X-Trino-Schema" => options[:schema], + "X-Trino-User" => options[:user], + "X-Trino-Language" => options[:language], + "X-Trino-Time-Zone" => options[:time_zone], + }).to_return(body: nested_json.to_json(:max_nesting => false)) StatementClient.new(faraday, query, options) end diff --git a/trino-client.gemspec b/trino-client.gemspec index 4c0c660c..9687b898 100644 --- a/trino-client.gemspec +++ b/trino-client.gemspec @@ -27,5 +27,5 @@ Gem::Specification.new do |gem| gem.add_development_dependency "webmock", ["~> 3.0"] gem.add_development_dependency "addressable", ["~> 2.4.0"] # 2.5.0 doesn't support Ruby 1.9.3 gem.add_development_dependency "simplecov", ["~> 0.10.0"] - gem.add_development_dependency "standard", ["~> 1.0.0"] + gem.add_development_dependency "standard", "~> 1.12.1" end