pwm 1.0.0 → 1.0.1

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.
data/README.md ADDED
@@ -0,0 +1,25 @@
1
+ # pwm
2
+
3
+ pwm very simply generates reasonably secure passwords. That's it; that's all it does.
4
+
5
+ Passwords are chosen from the set of all upper-case and lower-case letters, plus the digits 2 through 9. 0 and 1 are not used to avoid confusion with O and I.
6
+
7
+ ## Usage
8
+
9
+ require 'pwm'
10
+ Pwm.password(length)
11
+
12
+ The default length is 16.
13
+
14
+ You can also call pwm from the command line:
15
+
16
+ $ pwm # default 16 character password
17
+ $ pwm 12 # some other length
18
+
19
+ ## Author
20
+
21
+ Mark Cornick <mark@markcornick.com>
22
+
23
+ ## (Lack of) Copyright
24
+
25
+ To the extent possible under law, Mark Cornick has waived all copyright and related or neighboring rights to pwm.
data/lib/pwm.rb CHANGED
@@ -2,7 +2,7 @@ require "pwm/version"
2
2
 
3
3
  module Pwm
4
4
  def self.characters
5
- [('A'..'Z'),('a'..'z'),('2'..'9')].collect{|r| r.collect{|c| c}}.flatten
5
+ (('A'..'Z').to_a + ('a'..'z').to_a + ('2'..'9').to_a) - ['I', 'l']
6
6
  end
7
7
 
8
8
  def self.password(length=16)
data/lib/pwm/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Pwm
2
- VERSION = "1.0.0"
2
+ VERSION = "1.0.1"
3
3
  end
data/spec/pwm_spec.rb CHANGED
@@ -2,17 +2,17 @@ require 'pwm'
2
2
 
3
3
  describe Pwm do
4
4
  context 'The default set of characters' do
5
- it 'should include all upper-case letters' do
6
- ('A'..'Z').each do |letter|
5
+ it 'includes all upper-case letters except I' do
6
+ (('A'..'Z').to_a - ['I']).each do |letter|
7
7
  Pwm.characters.should include(letter)
8
8
  end
9
9
  end
10
- it 'should include all lower-case letters' do
11
- ('a'..'z').each do |letter|
10
+ it 'includes all lower-case letters except l' do
11
+ (('a'..'z').to_a - ['l']).each do |letter|
12
12
  Pwm.characters.should include(letter)
13
13
  end
14
14
  end
15
- it 'should include all digits 2 through 9' do
15
+ it 'includes all digits 2 through 9' do
16
16
  ('2'..'9').each do |letter|
17
17
  Pwm.characters.should include(letter)
18
18
  end
@@ -21,12 +21,12 @@ describe Pwm do
21
21
 
22
22
  context 'The password method' do
23
23
  context 'when given a length' do
24
- it 'should generate a password of that length' do
24
+ it 'generates a password of that length' do
25
25
  Pwm.password(8).length.should == 8
26
26
  end
27
27
  end
28
28
  context 'when not given a length' do
29
- it 'should generate a 16-character password' do
29
+ it 'generates a 16-character password' do
30
30
  Pwm.password.length.should == 16
31
31
  end
32
32
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pwm
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-03-03 00:00:00.000000000Z
12
+ date: 2012-03-05 00:00:00.000000000Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rspec
16
- requirement: &70348764844280 !ruby/object:Gem::Requirement
16
+ requirement: &70330054342640 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,7 +21,7 @@ dependencies:
21
21
  version: '0'
22
22
  type: :development
23
23
  prerelease: false
24
- version_requirements: *70348764844280
24
+ version_requirements: *70330054342640
25
25
  description: A tiny class and command-line tool to generate reasonably secure passwords.
26
26
  email:
27
27
  - mark@markcornick.com
@@ -32,6 +32,7 @@ extra_rdoc_files: []
32
32
  files:
33
33
  - .gitignore
34
34
  - Gemfile
35
+ - README.md
35
36
  - Rakefile
36
37
  - bin/pwm
37
38
  - lib/pwm.rb