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

Return an Enumerator for #each_key without a block #2

Merged
merged 1 commit into from Dec 13, 2014
Merged

Return an Enumerator for #each_key without a block #2

merged 1 commit into from Dec 13, 2014

Conversation

joeyates
Copy link
Contributor

* Makes the implementation more conformant with MRI
@@ -149,11 +149,17 @@ def self.each_pair(file)

#Iterates over each key in the _file_.
def self.each_key(file)
keys = []
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

-Any reason to not check block_given? at the beginning and return self.keys.each? Seems simpler.-

Edit: haha I don't know what I'm talking about...never mind.

presidentbeef added a commit that referenced this pull request Dec 13, 2014
…thout_block

Return an Enumerator for #each_key without a block
@presidentbeef presidentbeef merged commit a9b451d into presidentbeef:master Dec 13, 2014
@presidentbeef
Copy link
Owner

Thanks, Joe!

Are you actually using this library? I kind of assumed anyone who installed it was just confused...

I'll push a new gem version.

@joeyates
Copy link
Contributor Author

I hope I'm not confused...

I'm using https://github.com/y10k/rims which depends on the MRI Ruby builtin. As I didn't have GDBM installed when I compiled Ruby, I had to install libgdbm-dev and then reinstall Ruby to use it. I'm sure I'm not the first to have to do this.

If this gem became the replacement for the builtin an GDBM was removed from MRI core, it would be good - one less dependency. It might be worth proposing as much to the MRI maintainers.

@presidentbeef
Copy link
Owner

I worry some people think this is how you get gdbm because the gem is named "gdbm" - but you need the actual gdbm C library installed no matter what.

@presidentbeef
Copy link
Owner

I released version 1.3.0 of the gem.

Please let me know if I can help with anything else! I'm just glad someone found this useful.

@joeyates
Copy link
Contributor Author

Thanks.

I'll try bugging the MRI maintainers about removing GDBM from the standard library. Who knows.

@presidentbeef
Copy link
Owner

I suspect an FFI-based library for GDBM would need to use Fiddle instead of relying on the FFI gem.

Repository owner locked and limited conversation to collaborators May 20, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants