quickid 0.1.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.
Files changed (4) hide show
  1. checksums.yaml +7 -0
  2. data/lib/quickid.rb +27 -0
  3. data/lib/quickid/version.rb +5 -0
  4. metadata +45 -0
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 9bf7426c5fff4a4d02adc9eeadcee5cc8a7d8cccb70a95a11984845ac9bcc044
4
+ data.tar.gz: 4eae51ed110f88875dd6766a8beb3570b0cc63f5bd1f04f4a8506124787f4b5c
5
+ SHA512:
6
+ metadata.gz: 7854367d0edfefbd2813a3cca7f0dac29f0cadb499e1985d52cfe2ba098b4b9e9936ee288303c660dc7ec8d5f97902c3347b84a26214ba2cfda413d715245888
7
+ data.tar.gz: 569a0c2153b573337ffdc270d6a4822f6f0e2f84d03349960f613d0cab7f3e7ebcc9659083c280afc6b4916cfee1f35cf36a88a2441ba855f79178ff31d52d28
@@ -0,0 +1,27 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'quickid/version'
4
+
5
+ # Quick id
6
+ module Quickid
7
+ class Error < StandardError; end
8
+
9
+ LETTERS = ('a'..'z').to_a
10
+ NUMERALS = (0..9).to_a
11
+
12
+ def self.id
13
+ id = []
14
+
15
+ 5.times do
16
+ fakebit = rand(2)
17
+
18
+ id << if fakebit.zero?
19
+ LETTERS.sample
20
+ else
21
+ NUMERALS.sample
22
+ end
23
+ end
24
+
25
+ id.join
26
+ end
27
+ end
@@ -0,0 +1,5 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Quickid
4
+ VERSION = '0.1.0'
5
+ end
metadata ADDED
@@ -0,0 +1,45 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: quickid
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - icetimux
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2020-11-27 00:00:00.000000000 Z
12
+ dependencies: []
13
+ description:
14
+ email: icetimux@gmail.com
15
+ executables: []
16
+ extensions: []
17
+ extra_rdoc_files: []
18
+ files:
19
+ - lib/quickid.rb
20
+ - lib/quickid/version.rb
21
+ homepage: https://github.com/IceTimux/quickid
22
+ licenses:
23
+ - GPL-2.0-only
24
+ metadata:
25
+ source_code_uri: https://github.com/IceTimux/quickid
26
+ post_install_message:
27
+ rdoc_options: []
28
+ require_paths:
29
+ - lib
30
+ required_ruby_version: !ruby/object:Gem::Requirement
31
+ requirements:
32
+ - - ">="
33
+ - !ruby/object:Gem::Version
34
+ version: '2.7'
35
+ required_rubygems_version: !ruby/object:Gem::Requirement
36
+ requirements:
37
+ - - ">="
38
+ - !ruby/object:Gem::Version
39
+ version: '0'
40
+ requirements: []
41
+ rubygems_version: 3.1.2
42
+ signing_key:
43
+ specification_version: 4
44
+ summary: random 5 character long alphanumeric strings
45
+ test_files: []