pwm 1.2.2 → 1.2.3

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
  SHA1:
3
- metadata.gz: 189dbb4eaa91cc5fb097644d22f10ee25d20ad9d
4
- data.tar.gz: 36bc9792cdc0b9015616475726ffd2f6e077a9bf
3
+ metadata.gz: 0516128f2c7326827ece168be83d0150566ad4ab
4
+ data.tar.gz: a177d696b45ffaf3150dd37ed6c92dcd19cbd143
5
5
  SHA512:
6
- metadata.gz: 260b7f490b18c101b0a5d04b8757a17df69df963cadb125c6e89bf2adeb08de8e0737bc38472752a76ae67384047b4accf243597fdd2dfd3fc01e22d9bc497db
7
- data.tar.gz: 2f82eeadb7224e6c4b9107b88e6137df44de0a41e09d7a889bb319be6406f560ad5f84ad7cf26f047f699c0bdc6d4cfdefd02a8675d2cd87af52d02dbb9c0ada
6
+ metadata.gz: 14a6e31cf9d26a9e8476706f0de518863f766c3eccd66132c90e15b83c10b445e79e18506328ac3a351f2c0282d5d48fcc1f0e09f2ae7bccab7c954efac2ef95
7
+ data.tar.gz: ef66a41a1138980c4b4f579c21314993972244a637fafae3d346ce3958d51715efee76d54b8ee1bcae049ce38d722d5703141bf17e3df136eabbdea616c3265e
data/.gitignore CHANGED
@@ -1,7 +1,10 @@
1
- *.gem
2
- .bundle
3
- Gemfile.lock
4
- pkg/*
5
- .ruby-version
6
- vendor
7
- coverage
1
+ /.bundle/
2
+ /.yardoc
3
+ /Gemfile.lock
4
+ /_yardoc/
5
+ /coverage/
6
+ /doc/
7
+ /pkg/
8
+ /spec/reports/
9
+ /tmp/
10
+ /vendor/
data/.rspec CHANGED
@@ -1 +1,2 @@
1
- --colour --format documentation
1
+ --format documentation
2
+ --color
@@ -1,7 +1,5 @@
1
1
  AllCops:
2
- Excludes:
3
- - vendor/**
4
- Documentation:
5
- Enabled: false
6
- Encoding:
7
- Enabled: false
2
+ Exclude:
3
+ - vendor/**/*
4
+ LineLength:
5
+ Max: 104
@@ -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
@@ -1,4 +1,4 @@
1
- source "http://rubygems.org"
1
+ source 'https://rubygems.org'
2
2
 
3
3
  # Specify your gem's dependencies in pwm.gemspec
4
4
  gemspec
@@ -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
- all it does.
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
- O, all lower-case letters except l, and the digits 2 through 9. 0 and O
8
- are not used to avoid confusion with each other. I, l, and 1 are not
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
- least one upper-case letter, one lower-case letter, and one number.
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 <mark@cornick.io>
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
@@ -6,6 +6,6 @@ require 'rubocop/rake_task'
6
6
 
7
7
  Cucumber::Rake::Task.new(:features)
8
8
  RSpec::Core::RakeTask.new(:spec)
9
- Rubocop::RakeTask.new
9
+ RuboCop::RakeTask.new
10
10
 
11
- task :default => [:rubocop, :spec, :features]
11
+ task default: [:spec, :features, :rubocop]
@@ -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
@@ -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')
@@ -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')
@@ -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')
@@ -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')
@@ -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')
@@ -0,0 +1,7 @@
1
+ #!/bin/bash
2
+ set -euo pipefail
3
+ IFS=$'\n\t'
4
+
5
+ bundle install
6
+
7
+ # Do any other automated setup that you need to do here
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
- # Internal: The exception raised when a requested password length is
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
- # Internal: The set of characters from which passwords will be assembled.
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 + ('a'..'z').to_a + ('2'..'9').to_a) - %w(I O l)
16
+ (('A'..'Z').to_a + ('a'..'z').to_a + ('2'..'9').to_a) - %w(I O l)
14
17
  end
15
18
 
16
- # Public: Generate a password.
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, n|
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
- # Private: Checks if a password is acceptable.
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
@@ -1,3 +1,5 @@
1
+ ##
2
+ # The version of pwm.
1
3
  module Pwm
2
- VERSION = '1.2.2'
4
+ VERSION = '1.2.3'
3
5
  end
@@ -1,25 +1,31 @@
1
- # -*- encoding: utf-8 -*-
2
- $:.push File.expand_path("../lib", __FILE__)
3
- require "pwm/version"
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 |s|
6
- s.name = "pwm"
7
- s.version = Pwm::VERSION
8
- s.authors = ["Mark Cornick"]
9
- s.email = ["mark@cornick.io"]
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
- s.files = `git ls-files`.split("\n")
15
- s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
16
- s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
17
- s.require_paths = ["lib"]
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
- # specify any dependencies here; for example:
20
- s.add_development_dependency "aruba"
21
- s.add_development_dependency "rake"
22
- s.add_development_dependency "rspec", "~> 2.14.0"
23
- s.add_development_dependency "rubocop"
24
- s.add_development_dependency "simplecov"
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.2
4
+ version: 1.2.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mark Cornick
8
8
  autorequire:
9
- bindir: bin
9
+ bindir: exe
10
10
  cert_chain: []
11
- date: 2014-03-16 00:00:00.000000000 Z
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: 2.14.0
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: 2.14.0
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@cornick.io
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
- - ".travis.yml"
96
- - CONTRIBUTING.md
150
+ - CODE_OF_CONDUCT.md
97
151
  - Gemfile
152
+ - Guardfile
98
153
  - README.md
99
154
  - Rakefile
100
- - bin/pwm
101
- - features/pwm.feature
102
- - features/step_definitions/pwm.rb
103
- - features/support/env.rb
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
- - spec/pwm_spec.rb
108
- homepage: https://bitbucket.org/markcornick/pwm
109
- licenses: []
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.2.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
@@ -1,6 +0,0 @@
1
- language: ruby
2
- rvm:
3
- - 1.9.3
4
- - 2.0.0
5
- - 2.1.0
6
- script: bundle exec rake
@@ -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.
@@ -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
@@ -1,3 +0,0 @@
1
- Then(/^the password should be (\d+) characters long$/) do |length|
2
- expect(all_output.strip.length).to eq(length.to_i)
3
- end
@@ -1,4 +0,0 @@
1
- $LOAD_PATH.unshift(File.dirname(__FILE__) + '/../../lib')
2
- require 'aruba/cucumber'
3
- require 'fileutils'
4
- require 'rspec/expectations'
@@ -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