random_password 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: fbf6fb59e147cb55fa8e46a10eb8716dfa1655c9f5ff0a7fede162c50b618c6a
4
- data.tar.gz: 9320074931f80d3c902b4de4b6a12a16492343d994729730908c5d758ea1a3a8
3
+ metadata.gz: c0b4536097be0bf9a13101083786ce18063b7c2f91b84f0d2851e443237797cf
4
+ data.tar.gz: 1f836461c2bf116985ab5e2f26339f264f7d28d0bd19427d5dbf48acb30af121
5
5
  SHA512:
6
- metadata.gz: 3c328a94be89ffe178acf65505114ee6c7151eef15ad5777acc28152bcf49b5c4c2acf9028baa78feb57d1db0b3a6ed4e75692f9fec4d87ce81184d04e738f71
7
- data.tar.gz: dfc5b13f2461f7c6842b9c907fbc57eef6a7c0ac0f5ce73d5f766726e6326a320eb3445ae74b34307afe2352f6d814260941f74500f72b15fdf6f322ab153645
6
+ metadata.gz: fc5a3ed654248b9e57b67b12f981761720bf9489a3008c90fd68bccabf851c2a9ceebb8e2df2d0ce606de7a9fb2e4c23df13c7fb12b3e5ccfd5e35e91effda96
7
+ data.tar.gz: 29685c909a676f7905f066230124525ea296a7280b70d4d05be19ff50564cc61f75dd5e028874bcdba948946df15cdbfcd72e613110a86ac6e0e5b2c7d0508c7
@@ -0,0 +1,7 @@
1
+ ## 0.1.1
2
+
3
+ * Refactor RandomPassword::Base for code readability
4
+
5
+ ## 0.1.0
6
+
7
+ * First release
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- random_password (0.1.0)
4
+ random_password (0.1.1)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
@@ -44,8 +44,8 @@ PLATFORMS
44
44
 
45
45
  DEPENDENCIES
46
46
  bundler (~> 1.16)
47
- random_password!
48
47
  rake (~> 10.0)
48
+ random_password!
49
49
  rspec (~> 3.0)
50
50
  rubocop (~> 0.52.1)
51
51
  rubocop-rspec (~> 1.22.2)
data/README.md CHANGED
@@ -1,5 +1,7 @@
1
1
  # 🔑 RandomPassword
2
2
 
3
+ [![Gem Version](https://badge.fury.io/rb/random_password.svg)](https://badge.fury.io/rb/random_password)
4
+
3
5
  🔑 RandomPassword is a strong password generator that help your way to generate secure password quickly.
4
6
 
5
7
 
@@ -11,7 +11,7 @@ module RandomPassword
11
11
  end
12
12
 
13
13
  def generate
14
- password_letters.shuffle(random: Random.new).join[0...@length]
14
+ password_letters.shuffle(random: Random.new).join[0, @length]
15
15
  end
16
16
 
17
17
  def update(**options)
@@ -25,21 +25,21 @@ module RandomPassword
25
25
 
26
26
  def password_letters
27
27
  passwords = []
28
- passwords.concat((0...@digits).map { random_digit })
29
- passwords.concat((0...@symbols).map { random_symbol })
30
- passwords.concat((0...(@length - @digits - @symbols)).map { random_letter })
28
+ passwords.concat(@digits.times.map { random_digit })
29
+ passwords.concat(@symbols.times.map { random_symbol })
30
+ passwords.concat((@length - @digits - @symbols).times.map { random_letter })
31
31
  end
32
32
 
33
33
  def random_letter
34
- LETTERS[rand(LETTERS.size)]
34
+ LETTERS.sample
35
35
  end
36
36
 
37
37
  def random_digit
38
- DIGITS[rand(DIGITS.size)]
38
+ DIGITS.sample
39
39
  end
40
40
 
41
41
  def random_symbol
42
- SYMBOLS[rand(SYMBOLS.size)]
42
+ SYMBOLS.sample
43
43
  end
44
44
  end
45
45
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module RandomPassword
4
- VERSION = '0.1.0'.freeze
4
+ VERSION = '0.1.1'.freeze
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: random_password
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - akinrt
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-02-22 00:00:00.000000000 Z
11
+ date: 2018-02-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -93,6 +93,7 @@ files:
93
93
  - ".rubocop.yml"
94
94
  - ".rubocop_todo.yml"
95
95
  - ".travis.yml"
96
+ - CHANGELOG.md
96
97
  - CODE_OF_CONDUCT.md
97
98
  - Gemfile
98
99
  - Gemfile.lock