| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
|
This looks reasonable. WDYT @tjschuck ? |
Sorry, something went wrong.
|
Yep, this looks good to me. Sorry for the delay, @mattwildig, and thanks! ❤️ ❤️ 😻 ❤️ |
Sorry, something went wrong.
Make version attribute a plain String
|
(Building and publishing a new version of the gem shortly -- stay tuned for that.) |
Sorry, something went wrong.
|
@mattwildig @tmm1 Version 3.1.10 has been pushed to RubyGems. |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
This is a fix for #106. It looks fairly simple so I thought I’d do a quick PR.
When splitting the hash into the components to populate the attributes in Password the salt and hash were being converted into plain strings with to_str, but the version wasn’t. This was causing problems when trying to use == on that attribute (a change to Psych to how strings are serialized to Yaml does this).
This fix just adds a call to to_str to the version, to match the salt and hash (the cost is converted with to_i) and adds a matching spec.
As an aside: This fixes the immediate issue. Dumping a Password to Yaml now looks something like this:
which is what it looked like in Ruby 2.1 (or more accurately with the version of Psych in Ruby 2.1). The version, cost, salt and checksum are all duplicated. Is it worth adding init_with and encode_with methods to avoid this repetition?