passweird 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.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 812996470a6f5b36d8628335a0626a07d7c3814211a9364c3381442cfb5ac8fa
4
+ data.tar.gz: 219c285758450d74c46bfa3574aad4544c2ec7e98b15c70b20962b84bc932d70
5
+ SHA512:
6
+ metadata.gz: 1eb2bbb1acb328a700f377182d9605803bd457b24fd669a7d6f54ccf3deca2f047d418298152a405c0dbe2a69183d44a1d0c38d8ca0dd3c4c1c627a93dda4322
7
+ data.tar.gz: 38392f7eb15a8bd0ac29e541cac13ce8eae5a475d915ed3063c93a3a836cd84bb14d27cebfe8d98e8f852f78df1e0bc49bcc3027e2c1a7f67d10999b3321ddc1
data/.rspec ADDED
@@ -0,0 +1,3 @@
1
+ --format documentation
2
+ --color
3
+ --require spec_helper
data/.rubocop.yml ADDED
@@ -0,0 +1,13 @@
1
+ AllCops:
2
+ TargetRubyVersion: 2.6
3
+
4
+ Style/StringLiterals:
5
+ Enabled: true
6
+ EnforcedStyle: double_quotes
7
+
8
+ Style/StringLiteralsInInterpolation:
9
+ Enabled: true
10
+ EnforcedStyle: double_quotes
11
+
12
+ Layout/LineLength:
13
+ Max: 120
data/CHANGELOG.md ADDED
@@ -0,0 +1,5 @@
1
+ ## [Unreleased]
2
+
3
+ ## [0.1.0] - 2025-01-22
4
+
5
+ - Initial release
@@ -0,0 +1,84 @@
1
+ # Contributor Covenant Code of Conduct
2
+
3
+ ## Our Pledge
4
+
5
+ We as members, contributors, and leaders pledge to make participation in our community a harassment-free experience for everyone, regardless of age, body size, visible or invisible disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, religion, or sexual identity and orientation.
6
+
7
+ We pledge to act and interact in ways that contribute to an open, welcoming, diverse, inclusive, and healthy community.
8
+
9
+ ## Our Standards
10
+
11
+ Examples of behavior that contributes to a positive environment for our community include:
12
+
13
+ * Demonstrating empathy and kindness toward other people
14
+ * Being respectful of differing opinions, viewpoints, and experiences
15
+ * Giving and gracefully accepting constructive feedback
16
+ * Accepting responsibility and apologizing to those affected by our mistakes, and learning from the experience
17
+ * Focusing on what is best not just for us as individuals, but for the overall community
18
+
19
+ Examples of unacceptable behavior include:
20
+
21
+ * The use of sexualized language or imagery, and sexual attention or
22
+ advances of any kind
23
+ * Trolling, insulting or derogatory comments, and personal or political attacks
24
+ * Public or private harassment
25
+ * Publishing others' private information, such as a physical or email
26
+ address, without their explicit permission
27
+ * Other conduct which could reasonably be considered inappropriate in a
28
+ professional setting
29
+
30
+ ## Enforcement Responsibilities
31
+
32
+ Community leaders are responsible for clarifying and enforcing our standards of acceptable behavior and will take appropriate and fair corrective action in response to any behavior that they deem inappropriate, threatening, offensive, or harmful.
33
+
34
+ Community leaders have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, and will communicate reasons for moderation decisions when appropriate.
35
+
36
+ ## Scope
37
+
38
+ This Code of Conduct applies within all community spaces, and also applies when an individual is officially representing the community in public spaces. Examples of representing our community include using an official e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event.
39
+
40
+ ## Enforcement
41
+
42
+ Instances of abusive, harassing, or otherwise unacceptable behavior may be reported to the community leaders responsible for enforcement at TODO: Write your email address. All complaints will be reviewed and investigated promptly and fairly.
43
+
44
+ All community leaders are obligated to respect the privacy and security of the reporter of any incident.
45
+
46
+ ## Enforcement Guidelines
47
+
48
+ Community leaders will follow these Community Impact Guidelines in determining the consequences for any action they deem in violation of this Code of Conduct:
49
+
50
+ ### 1. Correction
51
+
52
+ **Community Impact**: Use of inappropriate language or other behavior deemed unprofessional or unwelcome in the community.
53
+
54
+ **Consequence**: A private, written warning from community leaders, providing clarity around the nature of the violation and an explanation of why the behavior was inappropriate. A public apology may be requested.
55
+
56
+ ### 2. Warning
57
+
58
+ **Community Impact**: A violation through a single incident or series of actions.
59
+
60
+ **Consequence**: A warning with consequences for continued behavior. No interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, for a specified period of time. This includes avoiding interactions in community spaces as well as external channels like social media. Violating these terms may lead to a temporary or permanent ban.
61
+
62
+ ### 3. Temporary Ban
63
+
64
+ **Community Impact**: A serious violation of community standards, including sustained inappropriate behavior.
65
+
66
+ **Consequence**: A temporary ban from any sort of interaction or public communication with the community for a specified period of time. No public or private interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, is allowed during this period. Violating these terms may lead to a permanent ban.
67
+
68
+ ### 4. Permanent Ban
69
+
70
+ **Community Impact**: Demonstrating a pattern of violation of community standards, including sustained inappropriate behavior, harassment of an individual, or aggression toward or disparagement of classes of individuals.
71
+
72
+ **Consequence**: A permanent ban from any sort of public interaction within the community.
73
+
74
+ ## Attribution
75
+
76
+ This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 2.0,
77
+ available at https://www.contributor-covenant.org/version/2/0/code_of_conduct.html.
78
+
79
+ Community Impact Guidelines were inspired by [Mozilla's code of conduct enforcement ladder](https://github.com/mozilla/diversity).
80
+
81
+ [homepage]: https://www.contributor-covenant.org
82
+
83
+ For answers to common questions about this code of conduct, see the FAQ at
84
+ https://www.contributor-covenant.org/faq. Translations are available at https://www.contributor-covenant.org/translations.
data/Gemfile ADDED
@@ -0,0 +1,18 @@
1
+ # frozen_string_literal: true
2
+
3
+ source "https://rubygems.org"
4
+
5
+ # Specify your gem's dependencies in passweird.gemspec
6
+ gemspec
7
+
8
+ gem "rake", "~> 13.0"
9
+
10
+ gem "rspec", "~> 3.0"
11
+
12
+ gem "rubocop", "~> 1.21"
13
+
14
+ gem "activerecord", "~> 6.0"
15
+
16
+ gem "sqlite3", "~> 1.4", ">= 1.4.2"
17
+
18
+ gem "database_cleaner", "~> 2.1"
data/Gemfile.lock ADDED
@@ -0,0 +1,92 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ passweird (0.1.0)
5
+ activerecord (~> 6.0)
6
+
7
+ GEM
8
+ remote: https://rubygems.org/
9
+ specs:
10
+ activemodel (6.1.7.10)
11
+ activesupport (= 6.1.7.10)
12
+ activerecord (6.1.7.10)
13
+ activemodel (= 6.1.7.10)
14
+ activesupport (= 6.1.7.10)
15
+ activesupport (6.1.7.10)
16
+ concurrent-ruby (~> 1.0, >= 1.0.2)
17
+ i18n (>= 1.6, < 2)
18
+ minitest (>= 5.1)
19
+ tzinfo (~> 2.0)
20
+ zeitwerk (~> 2.3)
21
+ ast (2.4.2)
22
+ concurrent-ruby (1.3.5)
23
+ database_cleaner (2.1.0)
24
+ database_cleaner-active_record (>= 2, < 3)
25
+ database_cleaner-active_record (2.2.0)
26
+ activerecord (>= 5.a)
27
+ database_cleaner-core (~> 2.0.0)
28
+ database_cleaner-core (2.0.1)
29
+ diff-lcs (1.5.1)
30
+ i18n (1.14.7)
31
+ concurrent-ruby (~> 1.0)
32
+ json (2.9.1)
33
+ language_server-protocol (3.17.0.3)
34
+ minitest (5.25.4)
35
+ parallel (1.26.3)
36
+ parser (3.3.7.0)
37
+ ast (~> 2.4.1)
38
+ racc
39
+ racc (1.8.1)
40
+ rainbow (3.1.1)
41
+ rake (13.2.1)
42
+ regexp_parser (2.10.0)
43
+ rspec (3.13.0)
44
+ rspec-core (~> 3.13.0)
45
+ rspec-expectations (~> 3.13.0)
46
+ rspec-mocks (~> 3.13.0)
47
+ rspec-core (3.13.2)
48
+ rspec-support (~> 3.13.0)
49
+ rspec-expectations (3.13.3)
50
+ diff-lcs (>= 1.2.0, < 2.0)
51
+ rspec-support (~> 3.13.0)
52
+ rspec-mocks (3.13.2)
53
+ diff-lcs (>= 1.2.0, < 2.0)
54
+ rspec-support (~> 3.13.0)
55
+ rspec-support (3.13.2)
56
+ rubocop (1.70.0)
57
+ json (~> 2.3)
58
+ language_server-protocol (>= 3.17.0)
59
+ parallel (~> 1.10)
60
+ parser (>= 3.3.0.2)
61
+ rainbow (>= 2.2.2, < 4.0)
62
+ regexp_parser (>= 2.9.3, < 3.0)
63
+ rubocop-ast (>= 1.36.2, < 2.0)
64
+ ruby-progressbar (~> 1.7)
65
+ unicode-display_width (>= 2.4.0, < 4.0)
66
+ rubocop-ast (1.37.0)
67
+ parser (>= 3.3.1.0)
68
+ ruby-progressbar (1.13.0)
69
+ sqlite3 (1.7.3-arm64-darwin)
70
+ sqlite3 (1.7.3-x86_64-linux)
71
+ tzinfo (2.0.6)
72
+ concurrent-ruby (~> 1.0)
73
+ unicode-display_width (3.1.4)
74
+ unicode-emoji (~> 4.0, >= 4.0.4)
75
+ unicode-emoji (4.0.4)
76
+ zeitwerk (2.6.18)
77
+
78
+ PLATFORMS
79
+ arm64-darwin-24
80
+ x86_64-linux
81
+
82
+ DEPENDENCIES
83
+ activerecord (~> 6.0)
84
+ database_cleaner (~> 2.1)
85
+ passweird!
86
+ rake (~> 13.0)
87
+ rspec (~> 3.0)
88
+ rubocop (~> 1.21)
89
+ sqlite3 (~> 1.4, >= 1.4.2)
90
+
91
+ BUNDLED WITH
92
+ 2.3.27
data/LICENSE.txt ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2025 TODO: Write your name
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,57 @@
1
+ # Passweird
2
+
3
+ A library to assess password security by giving the ability to check it against an arbitrary blacklist
4
+
5
+ ### Example Usage
6
+
7
+ $ Passweird::Checker.blacklisted?("my-password")
8
+
9
+ This will check if the given string, Its substrings or leet speak equivalents are registered in the blacklist.
10
+
11
+ ### Registering a blacklisted term
12
+
13
+ The blacklist is managed in the database through [Active Record](https://guides.rubyonrails.org/active_record_basics.html).
14
+
15
+ $ Passweird::BlacklistedTerm.create(term: "banned-term") # Add to blacklist
16
+
17
+ There is no further set up needed if within a [Ruby on Rails](https://guides.rubyonrails.org) application, otherwise you need to establish the connection with the database yourself; see [docs](https://api.rubyonrails.org/classes/ActiveRecord/ConnectionHandling.html#method-i-establish_connection).
18
+
19
+ ## Installation
20
+
21
+ Install the gem and add to the application's Gemfile by executing:
22
+
23
+ $ bundle add passweird
24
+
25
+ If bundler is not being used to manage dependencies, install the gem by executing:
26
+
27
+ $ gem install passweird
28
+
29
+ ## Usage
30
+ ### Prerequisite
31
+ In a rails environment, run this migration script to automatically generate the required table
32
+
33
+ $ bin/rails generate migration CreatePassweirdBlacklistedTerms term:string:index
34
+
35
+ Otherwise, run these SQL commands in your database to generate the table manually
36
+
37
+ $ CREATE TABLE `passweird_blacklisted_terms` (`id` int(11) auto_increment PRIMARY KEY, `term` varchar(255) NOT NULL, `created_at` datetime, `updated_at` datetime);
38
+
39
+ $ CREATE INDEX index_passweird_blacklisted_terms_on_term ON passweird_blacklisted_terms (term);
40
+
41
+ ## Development
42
+
43
+ After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
44
+
45
+ To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and the created tag, and push the `.gem` file to [rubygems.org](https://rubygems.org).
46
+
47
+ ## Contributing
48
+
49
+ Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/passweird. 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]/passweird/blob/main/CODE_OF_CONDUCT.md).
50
+
51
+ ## License
52
+
53
+ The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
54
+
55
+ ## Code of Conduct
56
+
57
+ Everyone interacting in the Passweird project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/[USERNAME]/passweird/blob/main/CODE_OF_CONDUCT.md).
data/Rakefile ADDED
@@ -0,0 +1,12 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "bundler/gem_tasks"
4
+ require "rspec/core/rake_task"
5
+
6
+ RSpec::Core::RakeTask.new(:spec)
7
+
8
+ require "rubocop/rake_task"
9
+
10
+ RuboCop::RakeTask.new
11
+
12
+ task default: %i[spec rubocop]
@@ -0,0 +1,12 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "active_record"
4
+
5
+ module Passweird
6
+ # ActiveRecord model that represents a term that is blacklisted in the database.
7
+ class BlacklistedTerm < ActiveRecord::Base
8
+ self.table_name = "passweird_blacklisted_terms"
9
+
10
+ validates :term, presence: true, uniqueness: true
11
+ end
12
+ end
@@ -0,0 +1,54 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Passweird
4
+ # The Checker class is responsible for checking if a password is blacklisted
5
+ # by generating possible terms from substrings and leet speak conversions.
6
+ #
7
+ # Example usage:
8
+ # checker = Passweird::Checker.new("password")
9
+ # checker.blacklisted?
10
+ class Checker
11
+ attr_reader :password
12
+
13
+ def self.blacklisted?(password)
14
+ new(password).blacklisted?
15
+ end
16
+
17
+ def initialize(password)
18
+ raise ArgumentError, "password must be a String" unless password.is_a?(String)
19
+
20
+ @password = password
21
+ end
22
+
23
+ # Checks if the password is blacklisted
24
+ #
25
+ # @return [Boolean] true if the password is blacklisted, false otherwise
26
+ def blacklisted?
27
+ @blacklisted ||= BlacklistedTerm.exists?(term: possible_terms)
28
+ end
29
+
30
+ # Retrieves the blacklisted terms that match the possible terms
31
+ #
32
+ # @return [ActiveRecord::Relation] a collection of blacklisted terms
33
+ def blacklisted_terms
34
+ @blacklisted_terms ||= BlacklistedTerm.where("LOWER(term) IN ?", possible_terms)
35
+ end
36
+
37
+ # Generates all possible terms from substrings and leet speak equivalents
38
+ #
39
+ # @return [Array<String>] an array of unique possible terms
40
+ def possible_terms
41
+ @possible_terms ||= (substrings + unleeted_substrings).uniq
42
+ end
43
+
44
+ private
45
+
46
+ def unleeted_substrings
47
+ @unleeted_substrings ||= LeetSpeak.unleet_all(substrings)
48
+ end
49
+
50
+ def substrings
51
+ @substrings ||= Substringer.substrings(password)
52
+ end
53
+ end
54
+ end
@@ -0,0 +1,72 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Passweird
4
+ # The LeetSpeak class is responsible for converting a given string
5
+ # into leet speak (1337 5p34k) and converting it back to normal text.
6
+ #
7
+ # Example usage:
8
+ # leet_speak = Passweird::LeetSpeak.new("example")
9
+ # leet_string = leet_speak.leet
10
+ # # => "3x4mpl3"
11
+ # normal_string = leet_speak.unleeted
12
+ # # => "example"
13
+ class LeetSpeak
14
+ attr_reader :given_string
15
+
16
+ LEET_CHAR_EQUIVALENTS = {
17
+ "T" => "7", "t" => "7",
18
+ "E" => "3", "e" => "3",
19
+ "I" => "1", "i" => "1",
20
+ "L" => "1", "l" => "1",
21
+ "O" => "0", "o" => "0",
22
+ "S" => "5", "s" => "5",
23
+ "A" => "4", "a" => "4",
24
+ "G" => "6", "g" => "6",
25
+ "B" => "8", "b" => "8"
26
+ }.freeze
27
+
28
+ def self.leet(given_string)
29
+ new(given_string).leet
30
+ end
31
+
32
+ def self.leet_all(array_of_strings)
33
+ raise ArgumentError, "array_of_strings must be an Array" unless array_of_strings.is_a?(Array)
34
+
35
+ array_of_strings.map { |string| leet(string) }
36
+ end
37
+
38
+ def self.unleeted(given_string)
39
+ new(given_string).unleeted
40
+ end
41
+
42
+ def self.unleet_all(array_of_strings)
43
+ raise ArgumentError, "array_of_strings must be an Array" unless array_of_strings.is_a?(Array)
44
+
45
+ array_of_strings.map { |string| unleeted(string) }
46
+ end
47
+
48
+ def initialize(given_string)
49
+ raise ArgumentError, "given_string must be a String" unless given_string.is_a?(String)
50
+
51
+ @given_string = given_string
52
+ end
53
+
54
+ # Converts the given_string to leet speak
55
+ #
56
+ # @return [String] the converted leet speak string
57
+ def leet
58
+ given_string.gsub(/[#{LEET_CHAR_EQUIVALENTS.keys.join}]/, LEET_CHAR_EQUIVALENTS)
59
+ end
60
+
61
+ def leet?
62
+ given_string != leet
63
+ end
64
+
65
+ # Converts the leet speak string back to normal text
66
+ #
67
+ # @return [String] the converted normal text string
68
+ def unleeted
69
+ given_string.gsub(/[#{LEET_CHAR_EQUIVALENTS.values.join}]/, LEET_CHAR_EQUIVALENTS.invert)
70
+ end
71
+ end
72
+ end
@@ -0,0 +1,47 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Passweird
4
+ # The Substringer class is responsible for generating all unique substrings
5
+ # of a given root string with a specified minimum length.
6
+ #
7
+ # Example usage:
8
+ # substringer = Passweird::Substringer.new("example")
9
+ # substrings = substringer.substrings(min_length: 3)
10
+ # # => ["exa", "exam", "examp", "exampl", "example", "xam", "xamp", "xampl", "xample", ...]
11
+ class Substringer
12
+ attr_reader :root_string
13
+
14
+ def self.substrings(root_string, min_length: 3)
15
+ new(root_string).substrings(min_length: min_length)
16
+ end
17
+
18
+ def initialize(root_string)
19
+ raise ArgumentError, "root_string must be a String" unless root_string.is_a?(String)
20
+
21
+ @root_string = root_string
22
+ end
23
+
24
+ # Generates all unique substrings of the root_string with a minimum length
25
+ #
26
+ # @param min_length [Integer] the minimum length of the substrings
27
+ # @return [Array<String>] an array of unique substrings
28
+ def substrings(min_length: 3)
29
+ raise ArgumentError, "min_length must be an Integer" unless min_length.is_a?(Integer)
30
+ raise ArgumentError, "min_length must be greater than 0" if min_length <= 0
31
+
32
+ return [root_string] if root_string.length < min_length
33
+
34
+ ([root_string] + get_substrings(min_length)).uniq
35
+ end
36
+
37
+ private
38
+
39
+ def get_substrings(min_length)
40
+ (0..root_string.length - min_length).flat_map do |start|
41
+ (min_length..root_string.length - start).map do |length|
42
+ root_string[start, length]
43
+ end
44
+ end.uniq
45
+ end
46
+ end
47
+ end
@@ -0,0 +1,5 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Passweird
4
+ VERSION = "0.1.0"
5
+ end
data/lib/passweird.rb ADDED
@@ -0,0 +1,12 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "passweird/version"
4
+ require_relative "passweird/blacklisted_term"
5
+ require_relative "passweird/checker"
6
+ require_relative "passweird/substringer"
7
+ require_relative "passweird/leet_speak"
8
+
9
+ module Passweird
10
+ class Error < StandardError; end
11
+ # Your code goes here...
12
+ end
data/passweird.gemspec ADDED
@@ -0,0 +1,35 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "lib/passweird/version"
4
+
5
+ Gem::Specification.new do |spec|
6
+ spec.name = "passweird"
7
+ spec.version = Passweird::VERSION
8
+ spec.authors = ["Rupert Señga"]
9
+ spec.email = ["pertsenga@gmail.com"]
10
+
11
+ spec.summary = "A library to assess password security and give the ability to check it against an arbitrary blacklist"
12
+ spec.homepage = "https://github.com/pertsenga/passweird"
13
+ spec.license = "MIT"
14
+ spec.required_ruby_version = ">= 2.6.0"
15
+
16
+ spec.metadata["homepage_uri"] = spec.homepage
17
+ spec.metadata["source_code_uri"] = "https://github.com/pertsenga/passweird"
18
+ spec.metadata["changelog_uri"] = "https://github.com/pertsenga/passweird/blob/main/CHANGELOG.md"
19
+
20
+ # Specify which files should be added to the gem when it is released.
21
+ # The `git ls-files -z` loads the files in the RubyGem that have been added into git.
22
+ spec.files = Dir.chdir(__dir__) do
23
+ `git ls-files -z`.split("\x0").reject do |f|
24
+ (f == __FILE__) || f.match(%r{\A(?:(?:bin|test|spec|features)/|\.(?:git|travis|circleci)|appveyor)})
25
+ end
26
+ end
27
+ spec.bindir = "exe"
28
+ spec.executables = spec.files.grep(%r{\Aexe/}) { |f| File.basename(f) }
29
+ spec.require_paths = ["lib"]
30
+
31
+ spec.add_dependency "activerecord", "~> 6.0"
32
+
33
+ # For more information and examples about making a new gem, check out our
34
+ # guide at: https://bundler.io/guides/creating_gem.html
35
+ end
data/sig/passweird.rbs ADDED
@@ -0,0 +1,4 @@
1
+ module Passweird
2
+ VERSION: String
3
+ # See the writing guide of rbs: https://github.com/ruby/rbs#guides
4
+ end
metadata ADDED
@@ -0,0 +1,78 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: passweird
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - Rupert Señga
8
+ autorequire:
9
+ bindir: exe
10
+ cert_chain: []
11
+ date: 2025-01-23 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: activerecord
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '6.0'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '6.0'
27
+ description:
28
+ email:
29
+ - pertsenga@gmail.com
30
+ executables: []
31
+ extensions: []
32
+ extra_rdoc_files: []
33
+ files:
34
+ - ".rspec"
35
+ - ".rubocop.yml"
36
+ - CHANGELOG.md
37
+ - CODE_OF_CONDUCT.md
38
+ - Gemfile
39
+ - Gemfile.lock
40
+ - LICENSE.txt
41
+ - README.md
42
+ - Rakefile
43
+ - lib/passweird.rb
44
+ - lib/passweird/blacklisted_term.rb
45
+ - lib/passweird/checker.rb
46
+ - lib/passweird/leet_speak.rb
47
+ - lib/passweird/substringer.rb
48
+ - lib/passweird/version.rb
49
+ - passweird.gemspec
50
+ - sig/passweird.rbs
51
+ homepage: https://github.com/pertsenga/passweird
52
+ licenses:
53
+ - MIT
54
+ metadata:
55
+ homepage_uri: https://github.com/pertsenga/passweird
56
+ source_code_uri: https://github.com/pertsenga/passweird
57
+ changelog_uri: https://github.com/pertsenga/passweird/blob/main/CHANGELOG.md
58
+ post_install_message:
59
+ rdoc_options: []
60
+ require_paths:
61
+ - lib
62
+ required_ruby_version: !ruby/object:Gem::Requirement
63
+ requirements:
64
+ - - ">="
65
+ - !ruby/object:Gem::Version
66
+ version: 2.6.0
67
+ required_rubygems_version: !ruby/object:Gem::Requirement
68
+ requirements:
69
+ - - ">="
70
+ - !ruby/object:Gem::Version
71
+ version: '0'
72
+ requirements: []
73
+ rubygems_version: 3.3.27
74
+ signing_key:
75
+ specification_version: 4
76
+ summary: A library to assess password security and give the ability to check it against
77
+ an arbitrary blacklist
78
+ test_files: []