uniqable 0.3.5 → 0.4

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
  SHA256:
3
- metadata.gz: d23a35ab4db3ce7e1fab9f0f2d85babe9348fd576f35a211d0b6efb6800250dd
4
- data.tar.gz: 73d06f7cb72df8f4ddd3a17ea99ba13ad45efc543753384262fec109a8cbccee
3
+ metadata.gz: 7edbf8a971d79a67b238754e0f0b05c32b93a71042a3b7dfa56a7b0893b74328
4
+ data.tar.gz: 54525e00eed37d7238c3638c07b58a1a93b9fdf92b02d8166c0959e05ddf956a
5
5
  SHA512:
6
- metadata.gz: 47742bd209a1f122428e76a41daba88620c7ae44f49c9f0071df6fd061a50db7457b0c47cc834b34b435643019cde2c64faaa1dbc9ee6b174362114a21d3a9fe
7
- data.tar.gz: 529fe623b7ad729c4a88fc3c97b198c23f8dabc693996eae367c13bc0299ff136061778bd9a28634102985a1af8f91929ccdbdd75f2b96dbcf1c611f6fb803fe
6
+ metadata.gz: 564996a410171fcefa1219db14a0eb9908df7ac0f436b2902bf2bb1e80494c816ca44c8605ea8668c849994b86b2a81f187b460ba331339159dbf0f71a7e050d
7
+ data.tar.gz: 15c687084a4da77585af395dec754330b6404afa93017137ab0696e324982a637698a5d014e676e19685d26a9941e9c68615a767d631eb57135e6dfda836c8c6
data/Gemfile CHANGED
@@ -7,6 +7,8 @@ git_source(:github) { |repo_name| "https://github.com/#{repo_name}" }
7
7
  # Specify your gem's dependencies in uniqable.gemspec
8
8
  gemspec
9
9
 
10
+ gem 'nanoid'
11
+
10
12
  group :test do
11
13
  gem 'rspec_junit_formatter'
12
14
  end
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- uniqable (0.3.5)
4
+ uniqable (0.4)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
@@ -25,6 +25,7 @@ GEM
25
25
  i18n (1.8.3)
26
26
  concurrent-ruby (~> 1.0)
27
27
  minitest (5.14.1)
28
+ nanoid (2.0.0)
28
29
  parallel (1.19.2)
29
30
  parser (2.7.1.4)
30
31
  ast (~> 2.4.1)
@@ -72,6 +73,7 @@ DEPENDENCIES
72
73
  activerecord (~> 5.0)
73
74
  awesome_print (~> 1.8.0)
74
75
  bundler (~> 1.16)
76
+ nanoid
75
77
  rake (>= 13.0.1)
76
78
  rspec (~> 3.9)
77
79
  rspec_junit_formatter
@@ -1,6 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require 'uniqable/version'
4
+ require 'nanoid'
4
5
 
5
6
  # Generates uniq, random token for ActiveRecord model's fields
6
7
  module Uniqable
@@ -66,7 +67,7 @@ module Uniqable
66
67
  # @TODO: split into 2 actions generate and set
67
68
  def uniqable_uid(field)
68
69
  loop do
69
- uniq_code = SecureRandom.hex(8)
70
+ uniq_code = Nanoid.generate(size: 16)
70
71
  if uniq_code =~ /\D+/
71
72
  send("#{field}=", uniq_code)
72
73
  break unless self.class.where(field => uniq_code).exists?
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Uniqable
4
- VERSION = '0.3.5'
4
+ VERSION = '0.4'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: uniqable
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.5
4
+ version: '0.4'
5
5
  platform: ruby
6
6
  authors:
7
7
  - Renat "MpaK" Ibragimov
8
- autorequire:
8
+ autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-06-25 00:00:00.000000000 Z
11
+ date: 2020-07-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activerecord
@@ -137,7 +137,7 @@ files:
137
137
  homepage: https://github.com/mpakus/uniqable
138
138
  licenses: []
139
139
  metadata: {}
140
- post_install_message:
140
+ post_install_message:
141
141
  rdoc_options: []
142
142
  require_paths:
143
143
  - lib
@@ -153,7 +153,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
153
153
  version: '0'
154
154
  requirements: []
155
155
  rubygems_version: 3.0.8
156
- signing_key:
156
+ signing_key:
157
157
  specification_version: 4
158
158
  summary: Uniqable - uniq and random token for ActiveRecord models
159
159
  test_files: []