Skip to content

Commit

Permalink
Merge pull request #79 from treasure-data/dependabot/bundler/standard…
Browse files Browse the repository at this point in the history
…-tw-1.12.1

Update standard requirement from ~> 1.0.0 to ~> 1.12.1
  • Loading branch information
yuokada authored Dec 27, 2022
2 parents d1b619a + 8fb2672 commit d82433f
Show file tree
Hide file tree
Showing 3 changed files with 58 additions and 58 deletions.
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

0 comments on commit d82433f

Please sign in to comment.