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

Update standard requirement from ~> 1.0.0 to ~> 1.12.1 #79

Merged
merged 2 commits into from
Dec 27, 2022
Merged
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
2 changes: 1 addition & 1 deletion release.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
112 changes: 56 additions & 56 deletions spec/statement_client_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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: {
Expand All @@ -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: {
Expand Down Expand Up @@ -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
Expand All @@ -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)
Expand All @@ -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)
Expand All @@ -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)
Expand All @@ -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)
Expand All @@ -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)
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion trino-client.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -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