cryptophysh 0.1.0 → 1.0.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
  SHA256:
3
- metadata.gz: 957a63052b088f7b15a1620ae066317d8bb3c9dbca75c6a0b2012859372eb640
4
- data.tar.gz: 430c1aff9f6feaf25ae884150c54eece6cc75ac2e720ad55f6bb35652f1b73dd
3
+ metadata.gz: 89e6345b45e72bedead67f267fb4e91de869c612d279bd6109a2c492d96b31b3
4
+ data.tar.gz: fbfc2428b41cbf14758a1296a235242d038be6649319d26a8f24bd7f831a64d0
5
5
  SHA512:
6
- metadata.gz: b49cb9ee4064ae7819d6e7f0645ae87be210717e742f4e02c79426da2e34ca155035212765a4038ec7e46f71b2421e43b9f29497a5feaa014c70265e366b5e20
7
- data.tar.gz: 2ec170aa3d7ad70d554c52da14ed3527a373fd539692af4325b31ad7fac68c37ed0e082e309cbf87025f0b1fbfaf98c53a327d2631b19b25d99d9a379b8a4a2f
6
+ metadata.gz: f980abb1543ec8c4743dc02d4800058495ed36d9946c43cdc13da5d7378001e0207f7868fa3fca0f97f117a24c96f912068d5dc7aefcb4fe60a184f6cd9f45eb
7
+ data.tar.gz: 6cc97e8e7822e63dd3233129bdc91c9958d964df47bf27a069a54f6941b7e60e82b9749917e5f9766c1431a39e58a967611ad6c26875733ca77363dab455db40
data/CHANGELOG.md CHANGED
@@ -3,3 +3,5 @@
3
3
  ## [0.1.0] - 2024-07-10
4
4
 
5
5
  - Initial release
6
+ - Add Cryptophysh::generate_password as a module method
7
+ - Add Cryptophysh::PasswordGenerator class
data/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  My attempt to produce a solution to the requirements listed [here](https://github.com/krystal/code-tasks/blob/main/password-generator.md). Essentially, a library/gem you can include in to your own code to add a `::generate_password` class method on a class.
4
4
 
5
- Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/cryptophysh`. To experiment with that code, run `bin/console` for an interactive prompt.
5
+ I've pushed the built gem up to RubyGems for completeness' sake.
6
6
 
7
7
  ## Installation
8
8
 
@@ -36,7 +36,7 @@ To install this gem onto your local machine, run `bundle exec rake install`. To
36
36
 
37
37
  ## Contributing
38
38
 
39
- Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/cryptophysh. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [code of conduct](https://github.com/[USERNAME]/cryptophysh/blob/master/CODE_OF_CONDUCT.md).
39
+ Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/cryptophysh. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [code of conduct](https://github.com/kryptykphysh/cryptophysh/blob/master/CODE_OF_CONDUCT.md).
40
40
 
41
41
  ## License
42
42
 
@@ -11,6 +11,8 @@ module Cryptophysh
11
11
  DEFAULT_SPECIAL_COUNT = 3
12
12
  SPECIAL_CHARACTERS = %w[@ % ! ? * ^ &].freeze
13
13
 
14
+ # Instantiatates a new PasswordGenerator instance.
15
+ #
14
16
  # @param length [Integer] the total length of any password generated with the #generate_password method
15
17
  # @param uppercase [true, false] include one or more uppercase `A-Z` characters
16
18
  # @param lowercase [true, false] include one or more lowercase `a-z` characters
@@ -53,6 +55,8 @@ module Cryptophysh
53
55
  end
54
56
 
55
57
  def character_string(size)
58
+ return "" unless size&.positive?
59
+
56
60
  chars = ("a".."z").to_a
57
61
  result = ""
58
62
  size.times { result += chars.sample }
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Cryptophysh
4
- VERSION = "0.1.0"
4
+ VERSION = "1.0.0"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cryptophysh
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 1.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kryptyk Physh
@@ -43,7 +43,7 @@ description: |
43
43
 
44
44
  My attempt to produce a solution to the requirements listed [here](https://github.com/krystal/code-tasks/blob/main/password-generator.md). Essentially, a library/gem you can include in to your own code to add a `::generate_password` class method on a class.
45
45
 
46
- Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/cryptophysh`. To experiment with that code, run `bin/console` for an interactive prompt.
46
+ I've pushed the built gem up to RubyGems for completeness' sake.
47
47
 
48
48
  ## Installation
49
49
 
@@ -77,7 +77,7 @@ description: |
77
77
 
78
78
  ## Contributing
79
79
 
80
- Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/cryptophysh. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [code of conduct](https://github.com/[USERNAME]/cryptophysh/blob/master/CODE_OF_CONDUCT.md).
80
+ Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/cryptophysh. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [code of conduct](https://github.com/kryptykphysh/cryptophysh/blob/master/CODE_OF_CONDUCT.md).
81
81
 
82
82
  ## License
83
83