globalid 0.2.1 → 0.2.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of globalid might be problematic. Click here for more details.

Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/global_id/global_id.rb +2 -2
  3. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 82142d7e95abab35aacc3b0a9aed4e6d44308834
4
- data.tar.gz: e21a62ca151b606aa6639d8cd58110d40e3de2ef
3
+ metadata.gz: 18b15edf85a6adec6677a63e25b88f7e0a603317
4
+ data.tar.gz: 070999cf1c6910f232e0139d398d635184d285ef
5
5
  SHA512:
6
- metadata.gz: 488500c69b84eafbfea3e445b8c96c01716438cdd1fa894d038869e823cbbca6ce84cbda829bc7a5f4722f42779d3c82aa6b12f10b5b4d7152e7120fc7611c2a
7
- data.tar.gz: 5280cee5f515c54f3625bb407a297f48b685104895181d9b98ce282762aa18f0160e570aa6987e4cac756f741dac62fa738df4262f64477ae9c89a7a6ca551ce
6
+ metadata.gz: 70412b970cb49cf9b7435616a1e5a7924a7c4dc11c70e5e1fb676e71441721f89d7fe39141c3817d375ccc264ef5d4c8413ea194cf5d5d1db02d0577b6595ba3
7
+ data.tar.gz: 75b5e5854eb5d330201bf55c49245a2d3d735ab29a74181458a321d6d625813744246ad0c01d6c7e230eb36d91cebc4cb6291e6e297b75c27b5922370d764285
@@ -31,8 +31,8 @@ class GlobalID
31
31
  private
32
32
  # We removed the base64 padding character = during #to_param, now we're adding it back so decoding will work
33
33
  def repad_gid(gid)
34
- padding_chars = 4 - gid.length % 4
35
- gid + '=' * padding_chars
34
+ padding_chars = gid.length.modulo(4).zero? ? 0 : (4 - gid.length.modulo(4))
35
+ gid + ('=' * padding_chars)
36
36
  end
37
37
  end
38
38
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: globalid
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - David Heinemeier Hansson