Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Improve Sorting of Bibliographies #50

Closed
inukshuk opened this Issue · 3 comments

2 participants

@inukshuk
Owner

No description provided.

@casutton

Actually, I think that sorting of bibliographies is broken. Currently the sort method of Bibliography does nothing: it non-destructively sorts the data, throws away the sorted list, and returns the original object. I think you problem meant to either use sort! or to not return self.

I can submit a pull request for this if you'd like. I wasn't sure whether to do this, though, because it seemed like the root cause might be elsewhere. Ordinarily the sort method wouldn't be required at all, right?

@inukshuk
Owner

You're spot on, this was supposed to be sort! originally; however, since this is contingent on #49 (we've also discussed this here #70) I have not touched in a while.

As I see it now, I think the best approach would be to rename the method to sort! (and use the bang method internally like you suggest) and add a new sort method like this:

def sort(*arguments, &block)
  dup.sort(*arguments, &block)
end

What do you think?

@casutton

Yes, I agree. I've created a pull request for this.

@inukshuk inukshuk closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.