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

feat: client can be used as a resource #127

Merged
merged 6 commits into from
Nov 28, 2022
Merged

feat: client can be used as a resource #127

merged 6 commits into from
Nov 28, 2022

Conversation

bednar
Copy link
Contributor

@bednar bednar commented Nov 28, 2022

Closes #120

Proposed Changes

The InfluxDB::Client can be also used as a resource:

InfluxDB2::Client.use('https://localhost:8086', 'my-token') do |client|
  client.do_something
end

Checklist

  • CHANGELOG.md updated
  • Rebased/mergeable
  • A test has been added if appropriate
  • rake test completes successfully
  • Commit messages are conventional
  • Sign CLA (if not already signed)

@codecov-commenter
Copy link

codecov-commenter commented Nov 28, 2022

Codecov Report

Base: 48.19% // Head: 48.22% // Increases project coverage by +0.02% 🎉

Coverage data is based on head (728273c) compared to base (7297785).
Patch coverage: 100.00% of modified lines in pull request are covered.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #127      +/-   ##
==========================================
+ Coverage   48.19%   48.22%   +0.02%     
==========================================
  Files          77       77              
  Lines        7942     7946       +4     
==========================================
+ Hits         3828     3832       +4     
  Misses       4114     4114              
Impacted Files Coverage Δ
lib/influxdb2/client/client.rb 100.00% <100.00%> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@bednar bednar marked this pull request as ready for review November 28, 2022 13:55
@bednar bednar merged commit a9fbd2d into master Nov 28, 2022
@bednar bednar deleted the client_as_resource branch November 28, 2022 21:51
@bednar bednar added this to the 2.9.0 milestone Nov 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support for autoclose client if is used in do-end statement
3 participants