pwm 1.2.2 → 1.2.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +10 -7
- data/.rspec +2 -1
- data/.rubocop.yml +4 -6
- data/CODE_OF_CONDUCT.md +27 -0
- data/Gemfile +1 -1
- data/Guardfile +28 -0
- data/README.md +64 -16
- data/Rakefile +2 -2
- data/bin/console +14 -0
- data/bin/cucumber +16 -0
- data/bin/guard +16 -0
- data/bin/rake +16 -0
- data/bin/rspec +16 -0
- data/bin/rubocop +16 -0
- data/bin/setup +7 -0
- data/{bin → exe}/pwm +0 -0
- data/lib/pwm.rb +13 -10
- data/lib/pwm/version.rb +3 -1
- data/pwm.gemspec +27 -21
- metadata +79 -24
- data/.gemtest +0 -0
- data/.travis.yml +0 -6
- data/CONTRIBUTING.md +0 -12
- data/features/pwm.feature +0 -20
- data/features/step_definitions/pwm.rb +0 -3
- data/features/support/env.rb +0 -4
- data/spec/pwm_spec.rb +0 -64
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0516128f2c7326827ece168be83d0150566ad4ab
|
4
|
+
data.tar.gz: a177d696b45ffaf3150dd37ed6c92dcd19cbd143
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 14a6e31cf9d26a9e8476706f0de518863f766c3eccd66132c90e15b83c10b445e79e18506328ac3a351f2c0282d5d48fcc1f0e09f2ae7bccab7c954efac2ef95
|
7
|
+
data.tar.gz: ef66a41a1138980c4b4f579c21314993972244a637fafae3d346ce3958d51715efee76d54b8ee1bcae049ce38d722d5703141bf17e3df136eabbdea616c3265e
|
data/.gitignore
CHANGED
data/.rspec
CHANGED
@@ -1 +1,2 @@
|
|
1
|
-
--
|
1
|
+
--format documentation
|
2
|
+
--color
|
data/.rubocop.yml
CHANGED
data/CODE_OF_CONDUCT.md
ADDED
@@ -0,0 +1,27 @@
|
|
1
|
+
# Contributor Code of Conduct
|
2
|
+
|
3
|
+
As contributors and maintainers of this project, we pledge to respect all people
|
4
|
+
who contribute through reporting issues, posting feature requests, updating
|
5
|
+
documentation, submitting pull requests or patches, and other activities.
|
6
|
+
|
7
|
+
We are committed to making participation in this project a harassment-free
|
8
|
+
experience for everyone, regardless of level of experience, gender, gender
|
9
|
+
identity and expression, sexual orientation, disability, personal appearance,
|
10
|
+
body size, race, ethnicity, age, or religion.
|
11
|
+
|
12
|
+
Examples of unacceptable behavior by participants include the use of sexual
|
13
|
+
language or imagery, derogatory comments or personal attacks, trolling, public
|
14
|
+
or private harassment, insults, or other unprofessional conduct.
|
15
|
+
|
16
|
+
Project maintainers have the right and responsibility to remove, edit, or reject
|
17
|
+
comments, commits, code, wiki edits, issues, and other contributions that are
|
18
|
+
not aligned to this Code of Conduct. Project maintainers who do not follow the
|
19
|
+
Code of Conduct may be removed from the project team.
|
20
|
+
|
21
|
+
Instances of abusive, harassing, or otherwise unacceptable behavior may be
|
22
|
+
reported by opening an issue or contacting one or more of the project
|
23
|
+
maintainers.
|
24
|
+
|
25
|
+
This Code of Conduct is adapted from the [Contributor
|
26
|
+
Covenant](http://contributor-covenant.org), version 1.0.0, available at
|
27
|
+
[http://contributor-covenant.org/version/1/0/0/](http://contributor-covenant.org/version/1/0/0/)
|
data/Gemfile
CHANGED
data/Guardfile
ADDED
@@ -0,0 +1,28 @@
|
|
1
|
+
group :fail_fast, halt_on_fail: true do
|
2
|
+
guard :rspec, cmd: 'bundle exec rspec' do
|
3
|
+
require 'guard/rspec/dsl'
|
4
|
+
dsl = Guard::RSpec::Dsl.new(self)
|
5
|
+
|
6
|
+
rspec = dsl.rspec
|
7
|
+
watch(rspec.spec_helper) { rspec.spec_dir }
|
8
|
+
watch(rspec.spec_support) { rspec.spec_dir }
|
9
|
+
watch(rspec.spec_files)
|
10
|
+
|
11
|
+
ruby = dsl.ruby
|
12
|
+
dsl.watch_spec_files_for(ruby.lib_files)
|
13
|
+
end
|
14
|
+
|
15
|
+
guard 'cucumber' do
|
16
|
+
watch(%r{^features/.+\.feature$})
|
17
|
+
watch(%r{^features/support/.+$}) { 'features' }
|
18
|
+
|
19
|
+
watch(%r{^features/step_definitions/(.+)_steps\.rb$}) do |m|
|
20
|
+
Dir[File.join("**/#{m[1]}.feature")][0] || 'features'
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
24
|
+
guard :rubocop do
|
25
|
+
watch(/.+\.rb$/)
|
26
|
+
watch(%r{(?:.+/)?\.rubocop\.yml$}) { |m| File.dirname(m[0]) }
|
27
|
+
end
|
28
|
+
end
|
data/README.md
CHANGED
@@ -1,15 +1,50 @@
|
|
1
1
|
# pwm
|
2
2
|
|
3
|
-
pwm very simply generates reasonably secure passwords. That's it; that's
|
4
|
-
|
3
|
+
pwm very simply generates reasonably secure passwords. That's it; that's all it
|
4
|
+
does.
|
5
5
|
|
6
|
-
Passwords are chosen from the set of all upper-case letters except I and
|
7
|
-
|
8
|
-
|
9
|
-
used for the same reason.
|
6
|
+
Passwords are chosen from the set of all upper-case letters except I and O, all
|
7
|
+
lower-case letters except l, and the digits 2 through 9. 0 and O are not used to
|
8
|
+
avoid confusion with each other. I, l, and 1 are not used for the same reason.
|
10
9
|
|
11
|
-
Starting with version 1.1.0, passwords are guaranteed to contain at
|
12
|
-
|
10
|
+
Starting with version 1.1.0, passwords are guaranteed to contain at least one
|
11
|
+
upper-case letter, one lower-case letter, and one number.
|
12
|
+
|
13
|
+
## We Interrupt This README.md
|
14
|
+
|
15
|
+
pwm is a stable, mature piece of code. It's one that I haven't modified
|
16
|
+
significantly in years. Recently, I've become interested in JavaScript and am
|
17
|
+
focusing my attention on a JS rewrite called
|
18
|
+
[powm](https://github.com/markcornick/powm). Unless some kind of serious bug
|
19
|
+
gets found in pwm, I'm unlikely to do any further development on it, or to
|
20
|
+
accept pull requests. Please note that pwm is, and has always been, in the
|
21
|
+
public domain, so if it doesn't do something you want it to do, I not only don't
|
22
|
+
mind if you fork it and make it your own, I urge you to.
|
23
|
+
|
24
|
+
In short, I'm closing the book on pwm as far as I'm concerned, but if you want
|
25
|
+
to write the next chapter, fork away and do great things with my compliments.
|
26
|
+
|
27
|
+
_We now return you to README.md already in progress._
|
28
|
+
|
29
|
+
## Installation
|
30
|
+
|
31
|
+
Add this line to your application's Gemfile:
|
32
|
+
|
33
|
+
```ruby
|
34
|
+
gem 'pwm'
|
35
|
+
```
|
36
|
+
|
37
|
+
And then execute:
|
38
|
+
|
39
|
+
```bash
|
40
|
+
bundle
|
41
|
+
```
|
42
|
+
|
43
|
+
Or install it yourself as:
|
44
|
+
|
45
|
+
```bash
|
46
|
+
gem install pwm
|
47
|
+
```
|
13
48
|
|
14
49
|
## Usage
|
15
50
|
|
@@ -38,18 +73,31 @@ $ echo $?
|
|
38
73
|
1
|
39
74
|
```
|
40
75
|
|
76
|
+
## Development
|
77
|
+
|
78
|
+
After checking out the repo, run `bin/setup` to install dependencies. Then, run
|
79
|
+
`rake spec` to run the tests or `rake spec` to run the Cucumber features. You
|
80
|
+
can also run `bin/console` for an interactive prompt that will allow you to
|
81
|
+
experiment.
|
82
|
+
|
83
|
+
To install this gem onto your local machine, run `bundle exec rake install`. To
|
84
|
+
release a new version, update the version number in `version.rb`, and then run
|
85
|
+
`bundle exec rake release`, which will create a git tag for the version, push
|
86
|
+
git commits and tags, and push the `.gem` file to
|
87
|
+
[rubygems.org](https://rubygems.org).
|
88
|
+
|
89
|
+
## Contributing
|
90
|
+
|
91
|
+
Bug reports and pull requests are welcome on GitHub at
|
92
|
+
<https://github.com/markcornick/pwm>. This project is intended to be a safe,
|
93
|
+
welcoming space for collaboration, and contributors are expected to adhere to
|
94
|
+
the [Contributor Covenant](contributor-covenant.org) code of conduct.
|
95
|
+
|
41
96
|
## Author
|
42
97
|
|
43
|
-
Mark Cornick <
|
98
|
+
Mark Cornick <https://github.com/markcornick>
|
44
99
|
|
45
100
|
## (Lack of) Copyright
|
46
101
|
|
47
102
|
To the extent possible under law, Mark Cornick has waived all copyright
|
48
103
|
and related or neighboring rights to pwm.
|
49
|
-
|
50
|
-
## Flair
|
51
|
-
|
52
|
-
[![Build Status][travis-image]][travis-link]
|
53
|
-
|
54
|
-
[travis-image]: https://secure.travis-ci.org/markcornick/pwm.png?branch=master
|
55
|
-
[travis-link]: http://travis-ci.org/markcornick/pwm
|
data/Rakefile
CHANGED
data/bin/console
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require 'bundler/setup'
|
4
|
+
require 'pwm'
|
5
|
+
|
6
|
+
# You can add fixtures and/or initialization code here to make experimenting
|
7
|
+
# with your gem easier. You can also use a different console, if you like.
|
8
|
+
|
9
|
+
# (If you use this, don't forget to add pry to your Gemfile!)
|
10
|
+
# require "pry"
|
11
|
+
# Pry.start
|
12
|
+
|
13
|
+
require 'irb'
|
14
|
+
IRB.start
|
data/bin/cucumber
ADDED
@@ -0,0 +1,16 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
#
|
3
|
+
# This file was generated by Bundler.
|
4
|
+
#
|
5
|
+
# The application 'cucumber' is installed as part of a gem, and
|
6
|
+
# this file is here to facilitate running it.
|
7
|
+
#
|
8
|
+
|
9
|
+
require 'pathname'
|
10
|
+
ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile',
|
11
|
+
Pathname.new(__FILE__).realpath)
|
12
|
+
|
13
|
+
require 'rubygems'
|
14
|
+
require 'bundler/setup'
|
15
|
+
|
16
|
+
load Gem.bin_path('cucumber', 'cucumber')
|
data/bin/guard
ADDED
@@ -0,0 +1,16 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
#
|
3
|
+
# This file was generated by Bundler.
|
4
|
+
#
|
5
|
+
# The application 'guard' is installed as part of a gem, and
|
6
|
+
# this file is here to facilitate running it.
|
7
|
+
#
|
8
|
+
|
9
|
+
require 'pathname'
|
10
|
+
ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile',
|
11
|
+
Pathname.new(__FILE__).realpath)
|
12
|
+
|
13
|
+
require 'rubygems'
|
14
|
+
require 'bundler/setup'
|
15
|
+
|
16
|
+
load Gem.bin_path('guard', 'guard')
|
data/bin/rake
ADDED
@@ -0,0 +1,16 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
#
|
3
|
+
# This file was generated by Bundler.
|
4
|
+
#
|
5
|
+
# The application 'rake' is installed as part of a gem, and
|
6
|
+
# this file is here to facilitate running it.
|
7
|
+
#
|
8
|
+
|
9
|
+
require 'pathname'
|
10
|
+
ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile',
|
11
|
+
Pathname.new(__FILE__).realpath)
|
12
|
+
|
13
|
+
require 'rubygems'
|
14
|
+
require 'bundler/setup'
|
15
|
+
|
16
|
+
load Gem.bin_path('rake', 'rake')
|
data/bin/rspec
ADDED
@@ -0,0 +1,16 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
#
|
3
|
+
# This file was generated by Bundler.
|
4
|
+
#
|
5
|
+
# The application 'rspec' is installed as part of a gem, and
|
6
|
+
# this file is here to facilitate running it.
|
7
|
+
#
|
8
|
+
|
9
|
+
require 'pathname'
|
10
|
+
ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile',
|
11
|
+
Pathname.new(__FILE__).realpath)
|
12
|
+
|
13
|
+
require 'rubygems'
|
14
|
+
require 'bundler/setup'
|
15
|
+
|
16
|
+
load Gem.bin_path('rspec-core', 'rspec')
|
data/bin/rubocop
ADDED
@@ -0,0 +1,16 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
#
|
3
|
+
# This file was generated by Bundler.
|
4
|
+
#
|
5
|
+
# The application 'rubocop' is installed as part of a gem, and
|
6
|
+
# this file is here to facilitate running it.
|
7
|
+
#
|
8
|
+
|
9
|
+
require 'pathname'
|
10
|
+
ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile',
|
11
|
+
Pathname.new(__FILE__).realpath)
|
12
|
+
|
13
|
+
require 'rubygems'
|
14
|
+
require 'bundler/setup'
|
15
|
+
|
16
|
+
load Gem.bin_path('rubocop', 'rubocop')
|
data/bin/setup
ADDED
data/{bin → exe}/pwm
RENAMED
File without changes
|
data/lib/pwm.rb
CHANGED
@@ -1,19 +1,23 @@
|
|
1
1
|
require 'pwm/version'
|
2
2
|
|
3
|
+
##
|
4
|
+
# This module is the heart of pwm.
|
3
5
|
module Pwm
|
4
|
-
|
5
|
-
# too short.
|
6
|
+
##
|
7
|
+
# The exception raised when a requested password length is too short.
|
6
8
|
class TooShortException < Exception; end
|
7
9
|
|
8
|
-
|
10
|
+
##
|
11
|
+
# The set of characters from which passwords will be assembled.
|
9
12
|
# This could be overridden if you don't like the default.
|
10
13
|
#
|
11
14
|
# Returns the set of characters as an Array.
|
12
15
|
def self.characters
|
13
|
-
(('A'..'Z').to_a
|
16
|
+
(('A'..'Z').to_a + ('a'..'z').to_a + ('2'..'9').to_a) - %w(I O l)
|
14
17
|
end
|
15
18
|
|
16
|
-
|
19
|
+
##
|
20
|
+
# Generate a password.
|
17
21
|
#
|
18
22
|
# length - The length of the password. Minimum is 8. Default is 16.
|
19
23
|
#
|
@@ -31,7 +35,7 @@ module Pwm
|
|
31
35
|
fail Pwm::TooShortException, "#{length} is too short." if length < 8
|
32
36
|
password = ''
|
33
37
|
until acceptable?(password)
|
34
|
-
password = (0..length - 1).reduce('') do |pw,
|
38
|
+
password = (0..length - 1).reduce('') do |pw, _n|
|
35
39
|
pw + characters[rand(characters.length)]
|
36
40
|
end
|
37
41
|
end
|
@@ -40,7 +44,8 @@ module Pwm
|
|
40
44
|
|
41
45
|
private
|
42
46
|
|
43
|
-
|
47
|
+
##
|
48
|
+
# Checks if a password is acceptable.
|
44
49
|
#
|
45
50
|
# password - the password to check
|
46
51
|
#
|
@@ -55,8 +60,6 @@ module Pwm
|
|
55
60
|
# Returns true if password has at least one of each required character
|
56
61
|
# class, or false if not.
|
57
62
|
def self.acceptable?(password)
|
58
|
-
password.match(/[A-Z]/) &&
|
59
|
-
password.match(/[a-z]/) &&
|
60
|
-
password.match(/[0-9]/)
|
63
|
+
password.match(/[A-Z]/) && password.match(/[a-z]/) && password.match(/[0-9]/)
|
61
64
|
end
|
62
65
|
end
|
data/lib/pwm/version.rb
CHANGED
data/pwm.gemspec
CHANGED
@@ -1,25 +1,31 @@
|
|
1
|
-
#
|
2
|
-
|
3
|
-
|
1
|
+
# coding: utf-8
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require 'pwm/version'
|
4
5
|
|
5
|
-
Gem::Specification.new do |
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
s.homepage = "https://bitbucket.org/markcornick/pwm"
|
11
|
-
s.summary = %q{A reasonably secure password maker}
|
12
|
-
s.description = %q{A tiny class and command-line tool to generate reasonably secure passwords.}
|
6
|
+
Gem::Specification.new do |spec|
|
7
|
+
spec.name = 'pwm'
|
8
|
+
spec.version = Pwm::VERSION
|
9
|
+
spec.authors = ['Mark Cornick']
|
10
|
+
spec.email = ['mark@markcornick.com']
|
13
11
|
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
12
|
+
spec.summary = 'A reasonably secure password maker'
|
13
|
+
spec.description = 'A tiny class and command-line tool to generate reasonably secure passwords.'
|
14
|
+
spec.homepage = 'https://github.com/markcornick/pwm'
|
15
|
+
spec.license = 'Public domain'
|
18
16
|
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
17
|
+
spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
18
|
+
spec.bindir = 'exe'
|
19
|
+
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
20
|
+
spec.require_paths = ['lib']
|
21
|
+
|
22
|
+
spec.add_development_dependency 'aruba', '~> 0.9.0'
|
23
|
+
spec.add_development_dependency 'bundler'
|
24
|
+
spec.add_development_dependency 'guard-cucumber'
|
25
|
+
spec.add_development_dependency 'guard-rspec'
|
26
|
+
spec.add_development_dependency 'guard-rubocop'
|
27
|
+
spec.add_development_dependency 'rake'
|
28
|
+
spec.add_development_dependency 'rspec'
|
29
|
+
spec.add_development_dependency 'rubocop'
|
30
|
+
spec.add_development_dependency 'simplecov'
|
25
31
|
end
|
metadata
CHANGED
@@ -1,17 +1,73 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pwm
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.2.
|
4
|
+
version: 1.2.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mark Cornick
|
8
8
|
autorequire:
|
9
|
-
bindir:
|
9
|
+
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2015-10-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: aruba
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: 0.9.0
|
20
|
+
type: :development
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: 0.9.0
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: bundler
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ">="
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '0'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ">="
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: guard-cucumber
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - ">="
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '0'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - ">="
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: guard-rspec
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - ">="
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - ">="
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '0'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: guard-rubocop
|
15
71
|
requirement: !ruby/object:Gem::Requirement
|
16
72
|
requirements:
|
17
73
|
- - ">="
|
@@ -42,16 +98,16 @@ dependencies:
|
|
42
98
|
name: rspec
|
43
99
|
requirement: !ruby/object:Gem::Requirement
|
44
100
|
requirements:
|
45
|
-
- - "
|
101
|
+
- - ">="
|
46
102
|
- !ruby/object:Gem::Version
|
47
|
-
version:
|
103
|
+
version: '0'
|
48
104
|
type: :development
|
49
105
|
prerelease: false
|
50
106
|
version_requirements: !ruby/object:Gem::Requirement
|
51
107
|
requirements:
|
52
|
-
- - "
|
108
|
+
- - ">="
|
53
109
|
- !ruby/object:Gem::Version
|
54
|
-
version:
|
110
|
+
version: '0'
|
55
111
|
- !ruby/object:Gem::Dependency
|
56
112
|
name: rubocop
|
57
113
|
requirement: !ruby/object:Gem::Requirement
|
@@ -82,31 +138,34 @@ dependencies:
|
|
82
138
|
version: '0'
|
83
139
|
description: A tiny class and command-line tool to generate reasonably secure passwords.
|
84
140
|
email:
|
85
|
-
- mark@
|
141
|
+
- mark@markcornick.com
|
86
142
|
executables:
|
87
143
|
- pwm
|
88
144
|
extensions: []
|
89
145
|
extra_rdoc_files: []
|
90
146
|
files:
|
91
|
-
- ".gemtest"
|
92
147
|
- ".gitignore"
|
93
148
|
- ".rspec"
|
94
149
|
- ".rubocop.yml"
|
95
|
-
-
|
96
|
-
- CONTRIBUTING.md
|
150
|
+
- CODE_OF_CONDUCT.md
|
97
151
|
- Gemfile
|
152
|
+
- Guardfile
|
98
153
|
- README.md
|
99
154
|
- Rakefile
|
100
|
-
- bin/
|
101
|
-
-
|
102
|
-
-
|
103
|
-
-
|
155
|
+
- bin/console
|
156
|
+
- bin/cucumber
|
157
|
+
- bin/guard
|
158
|
+
- bin/rake
|
159
|
+
- bin/rspec
|
160
|
+
- bin/rubocop
|
161
|
+
- bin/setup
|
162
|
+
- exe/pwm
|
104
163
|
- lib/pwm.rb
|
105
164
|
- lib/pwm/version.rb
|
106
165
|
- pwm.gemspec
|
107
|
-
|
108
|
-
|
109
|
-
|
166
|
+
homepage: https://github.com/markcornick/pwm
|
167
|
+
licenses:
|
168
|
+
- Public domain
|
110
169
|
metadata: {}
|
111
170
|
post_install_message:
|
112
171
|
rdoc_options: []
|
@@ -124,12 +183,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
124
183
|
version: '0'
|
125
184
|
requirements: []
|
126
185
|
rubyforge_project:
|
127
|
-
rubygems_version: 2.
|
186
|
+
rubygems_version: 2.4.5.1
|
128
187
|
signing_key:
|
129
188
|
specification_version: 4
|
130
189
|
summary: A reasonably secure password maker
|
131
|
-
test_files:
|
132
|
-
- features/pwm.feature
|
133
|
-
- features/step_definitions/pwm.rb
|
134
|
-
- features/support/env.rb
|
135
|
-
- spec/pwm_spec.rb
|
190
|
+
test_files: []
|
data/.gemtest
DELETED
File without changes
|
data/.travis.yml
DELETED
data/CONTRIBUTING.md
DELETED
@@ -1,12 +0,0 @@
|
|
1
|
-
# Contribution guidelines for pwm
|
2
|
-
|
3
|
-
pwm is intended to be small, simple, fast, and easy to understand. All
|
4
|
-
contributions must maintain these four qualities. If your pull request
|
5
|
-
is large, complicated, makes pwm slow, or is impossible to understand, I
|
6
|
-
will reject it.
|
7
|
-
|
8
|
-
pwm is in the public domain. All contributions must therefore also be in
|
9
|
-
the public domain. Pull requests containing copyright or license notices
|
10
|
-
will be rejected. Because pwm is in the public domain, you can fork it
|
11
|
-
and put whatever license you like on it; however, the canonical pwm code
|
12
|
-
base is in the public domain and will remain so.
|
data/features/pwm.feature
DELETED
@@ -1,20 +0,0 @@
|
|
1
|
-
Feature: Pwm
|
2
|
-
|
3
|
-
In order to generate random passwords
|
4
|
-
As a person needing random passwords
|
5
|
-
I want to use the pwm command-line tool
|
6
|
-
|
7
|
-
Scenario: Generating a password of no specific length
|
8
|
-
When I run `pwm`
|
9
|
-
Then the password should be 16 characters long
|
10
|
-
And the exit status should be 0
|
11
|
-
|
12
|
-
Scenario: Generating a password of a valid specific length
|
13
|
-
When I run `pwm 8`
|
14
|
-
Then the password should be 8 characters long
|
15
|
-
And the exit status should be 0
|
16
|
-
|
17
|
-
Scenario: Generating a password of an invalid specific length
|
18
|
-
When I run `pwm 4`
|
19
|
-
Then the output should contain "length must be >= 8"
|
20
|
-
And the exit status should be 1
|
data/features/support/env.rb
DELETED
data/spec/pwm_spec.rb
DELETED
@@ -1,64 +0,0 @@
|
|
1
|
-
require 'simplecov'
|
2
|
-
SimpleCov.start do
|
3
|
-
add_filter '/vendor/'
|
4
|
-
end
|
5
|
-
require 'pwm'
|
6
|
-
|
7
|
-
describe Pwm do
|
8
|
-
describe 'The default set of characters' do
|
9
|
-
(('A'..'Z').to_a - %w(I O)).each do |character|
|
10
|
-
it "includes #{character}" do
|
11
|
-
expect(Pwm.characters).to include(character)
|
12
|
-
end
|
13
|
-
end
|
14
|
-
(('a'..'z').to_a - ['l']).each do |character|
|
15
|
-
it "includes #{character}" do
|
16
|
-
expect(Pwm.characters).to include(character)
|
17
|
-
end
|
18
|
-
end
|
19
|
-
('2'..'9').each do |character|
|
20
|
-
it "includes #{character}" do
|
21
|
-
expect(Pwm.characters).to include(character)
|
22
|
-
end
|
23
|
-
end
|
24
|
-
%w(I O l 0 1).each do |character|
|
25
|
-
it "does not include #{character}" do
|
26
|
-
expect(Pwm.characters).not_to include(character)
|
27
|
-
end
|
28
|
-
end
|
29
|
-
end
|
30
|
-
|
31
|
-
describe 'The password method' do
|
32
|
-
context 'when given a length' do
|
33
|
-
context 'equal to 8' do
|
34
|
-
it 'generates a password of that length' do
|
35
|
-
expect(Pwm.password(8).length).to eq(8)
|
36
|
-
end
|
37
|
-
end
|
38
|
-
context 'greater than 8' do
|
39
|
-
it 'generates a password of that length' do
|
40
|
-
expect(Pwm.password(9).length).to eq(9)
|
41
|
-
end
|
42
|
-
end
|
43
|
-
context 'less than 8' do
|
44
|
-
it 'raises Pwm::TooShortException' do
|
45
|
-
expect { Pwm.password(7) }.to raise_error(Pwm::TooShortException)
|
46
|
-
end
|
47
|
-
end
|
48
|
-
end
|
49
|
-
context 'when not given a length' do
|
50
|
-
it 'generates a 16-character password' do
|
51
|
-
expect(Pwm.password.length).to eq(16)
|
52
|
-
end
|
53
|
-
end
|
54
|
-
it 'generates passwords containing at least one upper-case letter' do
|
55
|
-
expect(Pwm.password).to match(/[A-Z]/)
|
56
|
-
end
|
57
|
-
it 'generates passwords containing at least one lower-case letter' do
|
58
|
-
expect(Pwm.password).to match(/[a-z]/)
|
59
|
-
end
|
60
|
-
it 'generates passwords containing at least one number' do
|
61
|
-
expect(Pwm.password).to match(/[2-9]/)
|
62
|
-
end
|
63
|
-
end
|
64
|
-
end
|