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

Use dig_rb instead of ruby_dig when backport_dig is not installed #1794

Merged
merged 1 commit into from
Dec 18, 2017

Conversation

okkez
Copy link
Contributor

@okkez okkez commented Dec 18, 2017

Because ruby_dig 0.0.2 does not support a object that responds to dig
method properly. On the other hand, dig_rb 1.0.1 supports it properly.

Because ruby_dig 0.0.2 does not support a object that responds to dig
method properly. On the other hand, dig_rb 1.0.1 supports it properly.
@okkez
Copy link
Contributor Author

okkez commented Dec 18, 2017

For example, fluent-plugin-geoip uses geoip2_c's GeoIP2::LookupResult#dig with hash (pseudo code):

db = GeoIP2::Database.new(db_path)
result = db.lookup(ip)
keys = [:hostname, :city, :names, :en]
hash = { hostname: result }
hash.dig(*keys") # => "Mountain View"

If we use ruby_dig 0.0.2, the last line will return nil.

@repeatedly repeatedly merged commit a635229 into fluent:master Dec 18, 2017
@okkez okkez deleted the use-dig-rb branch December 19, 2017 00:35
okkez added a commit to okkez/fluent-plugin-geoip that referenced this pull request Dec 19, 2017
Because Fluentd v1.0.1 or older uses ruby_dig.
See also fluent/fluentd#1794
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.

2 participants