-
Notifications
You must be signed in to change notification settings - Fork 0
Test Pr #1
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
Test Pr #1
Conversation
| io-endpoint (0.14.0) | ||
| io-event (1.7.3) | ||
| io-stream (0.6.1) | ||
| json (2.5.1) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using an older version of the json gem (2.5.1). More recent versions include security fixes and performance improvements. Should upgrade to latest stable version.
| options[:debug_output] = $stdout if @debug | ||
|
|
||
| response = self.class.get @base_url, options | ||
| response = Sync do |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The code uses 'Sync' which appears to be undefined. For async/await pattern in Ruby, it should be 'Async' (capital A) instead of 'Sync'. This is a common class provided by the async gem.
|
|
||
| def with_fetch(params = {}) | ||
| options = { headers: { 'User-Agent' => @user_agent } } | ||
| options[:query] = params if params&.any? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The safe navigation operator (&.) with any? could cause issues if params is not nil but also not a collection that responds to any?. Should check if params is a Hash first or use params.is_a?(Hash) && !params.empty?
| response = self.class.get @base_url, options | ||
| response = Sync do | ||
| internet = Async::HTTP::Internet.new | ||
| internet.get @base_url, options |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The Async::HTTP::Internet#get method expects headers to be passed directly, not nested in an options hash. The correct format should be internet.get(@base_url, headers: { 'User-Agent' => @user_agent })
| spec.add_dependency 'async-http' | ||
|
|
||
| # Dev dependencies | ||
| spec.add_development_dependency 'simplecov', '< 0.18' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using an upper bound version constraint ('< 0.18') without a lower bound can be problematic. It's better to specify a range with both lower and upper bounds (e.g. '>= 0.17.1, < 0.18') to ensure compatibility.
|
|
||
| # Prod dependencies | ||
| spec.add_dependency 'httparty', '~> 0.18.1' | ||
| spec.add_dependency 'async-http' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The dependency is specified without a version constraint. This can lead to compatibility issues if breaking changes are introduced in future versions. It's recommended to specify version constraints for all dependencies (e.g. '~> 1.0').
No description provided.