shortuuid 0.1.0 → 0.2.0

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 7568f64707580413ed1bf487b84a93b4861034cc
4
- data.tar.gz: 169495ec553794009e0e722a0adbe0a1f52ab0cd
3
+ metadata.gz: 43d6287dfa30ce383492940acbc5aed2db6b6005
4
+ data.tar.gz: 257bb266f23edd99373c6246dce729c7afba5bf5
5
5
  SHA512:
6
- metadata.gz: cc105c3553cc37d8485395ef12f5311000643930c42caeb32227db1eeb11f8de6154418220adf028ff4abd850cd1b11b6b7b380065a554bf0f9eb5be93dd7d58
7
- data.tar.gz: 2c0e5c071f37ed1a1037f99763d0bb000aed63cec46aed6ebf22c1f9319c224e8c7c9a3fbe84b60e29759093094aaac14b628a2139596dc214999e2848740639
6
+ metadata.gz: 703598bfa280f457e1763eaf9be4a6c6dcd2f5f2d6389eac26a3049f5ade8e168f43f386e5e895b471a7fe6867007a4685c6a0ab75d7d4b9c7545e9a661194c7
7
+ data.tar.gz: 6714d737b7e3b68b06c6ebac233649430a15a92eca6a0f73e609d44718da5d00b40040ae145283c0c8e214737b5bbe94e6e10ab3494d78dee018708599354abe
@@ -0,0 +1,3 @@
1
+ dependencies:
2
+ pre:
3
+ - gem install bundler --pre
@@ -3,10 +3,12 @@ require 'radix'
3
3
 
4
4
  module ShortUUID
5
5
  def self.shorten(uuid, alphabet = Radix::BASE::B62)
6
+ return nil unless uuid && !uuid.empty?
6
7
  uuid.split('-').join.to_i(16).b(10).to_s(alphabet)
7
8
  end
8
9
 
9
10
  def self.expand(short_uuid, alphabet = Radix::BASE::B62)
11
+ return nil unless short_uuid && !short_uuid.empty?
10
12
  uuid = short_uuid.b(alphabet).to_i.to_s(16).rjust(32, '0')
11
13
  [
12
14
  uuid[0..7],
@@ -1,3 +1,3 @@
1
1
  module ShortUUID
2
- VERSION = "0.1.0"
2
+ VERSION = "0.2.0"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: shortuuid
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sudhir Jonathan
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-05-08 00:00:00.000000000 Z
11
+ date: 2016-05-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: radix
@@ -82,6 +82,7 @@ files:
82
82
  - Rakefile
83
83
  - bin/console
84
84
  - bin/setup
85
+ - circle.yml
85
86
  - lib/shortuuid.rb
86
87
  - lib/shortuuid/version.rb
87
88
  - shortuuid.gemspec