password_list_generator 0.4.3 → 0.4.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ffa7d8b1774dc8a2decdd5a5cbc14a2057ca3fa2
4
- data.tar.gz: 27bf52442f7b5a4680e6acb097af876537f50247
3
+ metadata.gz: 14ec229ec1b4d16718129820ccfb099e31f902f4
4
+ data.tar.gz: fa5fe3f5e8b9be74f2c6fbc0518e043daf6f2dcd
5
5
  SHA512:
6
- metadata.gz: a35ac7dd8d4346019affee973f73c2291f0060c37960a73436c148354b39390e257a3ee38d9736b322824888296e24506061c29f20c4a1b49270ef718d1e3c1a
7
- data.tar.gz: e30c83ccd7e6836116599d954abbd75bceed545c69bd70977d8aa7a6432089a6ec718cc4c4748d9cf2617053d23f4f363b459344e4a14c7759c184c72a0ad4b7
6
+ metadata.gz: b6341b42a9d6e4cd2e23444265e2e2bfac502e065f4171bf4decf154c2bdfa7fcaaf9539d17d7aa57295c84af6e464914f0874b3d761c8029b0e786bebe2bdca
7
+ data.tar.gz: ac0133d4ad4b8007336ba30f7d427f0c879460aeb3a07c2c08143fea72fde33ba6b95a774c4dd49eb1a725780dfec60a9a8d771ff66c21eb5bccb787e8c3e9c4
checksums.yaml.gz.sig ADDED
Binary file
data/.travis.yml ADDED
@@ -0,0 +1,4 @@
1
+ language: ruby
2
+ rvm:
3
+ - 1.9.3
4
+ - 2.0.0
data/Gemfile CHANGED
@@ -1,6 +1,5 @@
1
1
  source "https://rubygems.org/"
2
2
 
3
-
4
3
  group :test do
5
4
  gem 'rake'
6
5
  gem 'minitest'
data/README.md CHANGED
@@ -0,0 +1,44 @@
1
+ PasswordListGenerator
2
+ =====================
3
+
4
+ [![Gem Version][GV img]][Gem Version]
5
+ [![Build Status][BS img]][Build Status]
6
+ [![Dependency Status][DS img]][Dependency Status]
7
+ [![Code Climate][CC img]][Code Climate]
8
+ [![Coverage Status][CS img]][Coverage Status]
9
+
10
+ ## Description
11
+
12
+ Generate a list of passwords from the command line
13
+
14
+ ## Installation
15
+
16
+ gem install password_list_generator
17
+
18
+ ## Usage
19
+
20
+ > pwgen
21
+ > pwgen -h --> see more options
22
+
23
+ ## Contributing
24
+
25
+ 1. Fork it
26
+ 2. Create your feature branch (`git checkout -b my-awesomie-feature`)
27
+ 3. Commit your changes (`git commit -am 'Add some awesome feature'`)
28
+ 4. Push to branch (`git push origin my-awesome-feature`)
29
+ 5. Create a new Pull Request
30
+
31
+ [Gem Version]: https://rubygems.org/gems/password_list_generator
32
+ [Build Status]: https://travis-ci.org/stephaneliu/password_generator
33
+ [travis pull requests]: https://travis-ci.org/stephaneliu/password_generator/pull_requests
34
+ [Dependency Status]: https://gemnasium.com/stephaneliu/password_generator
35
+ [Code Climate]: https://codeclimate.com/github/stephaneliu/password_generator
36
+ [Coverage Status]: https://coveralls.io/r/stephaneliu/password_generator
37
+
38
+ [GV img]: https://badge.fury.io/rb/password_list_generator.png
39
+ [BS img]: https://travis-ci.org/stephaneliu/password_generator.png
40
+ [DS img]: https://gemnasium.com/stephaneliu/password_generator.png
41
+ [CC img]: https://codeclimate.com/github/stephaneliu/password_generator.png
42
+ [CS img]: https://coveralls.io/repos/stephaneliu/password_generator/badge.png?branch=master
43
+
44
+
@@ -0,0 +1,21 @@
1
+ -----BEGIN CERTIFICATE-----
2
+ MIIDYDCCAkigAwIBAgIBATANBgkqhkiG9w0BAQUFADA7MQ0wCwYDVQQDDARzbGl1
3
+ MRUwEwYKCZImiZPyLGQBGRYFc2psaXUxEzARBgoJkiaJk/IsZAEZFgNjb20wHhcN
4
+ MTMxMTIxMDgyMjMwWhcNMTQxMTIxMDgyMjMwWjA7MQ0wCwYDVQQDDARzbGl1MRUw
5
+ EwYKCZImiZPyLGQBGRYFc2psaXUxEzARBgoJkiaJk/IsZAEZFgNjb20wggEiMA0G
6
+ CSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQC1PHip2Oa8Pf42ovmPUgAZ2Gv1hTOi
7
+ 4ZJBdq/6PUNBAmFTHhBvToRW++y5fvBzOTg1YkDHF51l7vcGbqpuKDBleY7COiPD
8
+ nR+KUQQ+rRD26XRdtlOacGo3ZjRBJ0aDBV6PITMRda7HQijXZ3rVS2j7gb+YoQDw
9
+ 5I68sZEsjX9/a6C3Ac0Ax4MBZL172KSLzaKCTjdvrftdQm4lWQ1hpouKYjXNtNIO
10
+ +JSVMszCbZFXVq9O21cer/AHaB49eCQ0Pyd10vhGRs70I0usdrPtN4XbIeOK1lgi
11
+ JIjQ/4nHXjo2KCwW0+dt1YwJUI/7AT75v94O5aCbb24ENZPko/gn7PbLAgMBAAGj
12
+ bzBtMAkGA1UdEwQCMAAwCwYDVR0PBAQDAgSwMB0GA1UdDgQWBBT/tqKs2lU2i9D1
13
+ RjjQsbYTk0DAmjAZBgNVHREEEjAQgQ5zbGl1QHNqbGl1LmNvbTAZBgNVHRIEEjAQ
14
+ gQ5zbGl1QHNqbGl1LmNvbTANBgkqhkiG9w0BAQUFAAOCAQEALD94EwV7vOWz3tq0
15
+ KITiDYO/0U7e9MW80gR7QBH+20sBmY4ONEmk1IuY490LePQAneHuvMyQRxK4i81b
16
+ +v0HUVLvCxtyZIUeluQaSPt76USpyQzrxV+WCisT4Ckw0yi/04h+UKDyc7Zf4mok
17
+ 0tmihH5qdrq9+tHI/QC981zw2cZeWfr74Wek3mUzHZm9Z+Jou38kyd/hDSUaRJpn
18
+ aC0qBC/AkPKtDcdl1OF4l5sjq5/aTCRVW7uXJ2G7YRWrGdqgiKEC5YmEFuxT/wVK
19
+ u4D3Um/AnYRhXT9ydJk2pcbzNsb30/ojfrqf3rTrJRfXv1/JYpDOfqFBOrMYkuw1
20
+ nE3D5g==
21
+ -----END CERTIFICATE-----
@@ -11,13 +11,11 @@ module PasswordListGenerator
11
11
  passwords = []
12
12
 
13
13
  1.upto(config.count) do
14
- valid = false
15
- random = ''
14
+ valid = false
16
15
 
17
16
  until valid
18
17
  random_size = (config.min..config.max).to_a.shuffle.first
19
- random = (1..random_size).map {|a| characters_set[SecureRandom.random_number(characters_set.size)]}.join
20
- password = Password.new(random, config)
18
+ password = Password.new(random_string, config)
21
19
 
22
20
  if password.valid?
23
21
  passwords << password
@@ -31,6 +29,14 @@ module PasswordListGenerator
31
29
 
32
30
  private
33
31
 
32
+ def random_string
33
+ (1..random_size).map {characters_set[random_number]}.join
34
+ end
35
+
36
+ def random_number
37
+ SecureRandom.random_number(characters_set.size)
38
+ end
39
+
34
40
  def build_characters_set
35
41
  @characters_set = ('a'..'z').to_a
36
42
  @characters_set += ('A'..'Z').to_a if config.uppercase
@@ -1,3 +1,3 @@
1
1
  module PasswordListGenerator
2
- VERSION="0.4.3"
2
+ VERSION="0.4.4"
3
3
  end
@@ -3,22 +3,24 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
3
3
  require 'password_list_generator/version'
4
4
 
5
5
  Gem::Specification.new do |gem|
6
- gem.name = 'password_list_generator'
7
- gem.version = PasswordListGenerator::VERSION
8
- gem.authors = ["Stephane Liu"]
9
- gem.email = 'sliu@sjliu.com'
10
- gem.description = 'Generate a list of passwords from command line with options for length and complexity into a file of your choice.'
11
- gem.summary = 'Generate list of passwords easily from command line'
12
- gem.homepage = 'https://github.com/stephaneliu/password_generator'
13
- # gem s.date = '2013-10-24'
14
- gem.files = `git ls-files`.split($/)
6
+ gem.name = 'password_list_generator'
7
+ gem.version = PasswordListGenerator::VERSION
8
+ gem.authors = ["Stephane Liu"]
9
+ gem.email = 'sliu@sjliu.com'
10
+ gem.description = 'Generate a list of passwords from command line with options for length and complexity into a file of your choice.'
11
+ gem.summary = 'Generate list of passwords easily from command line'
12
+ gem.homepage = 'https://github.com/stephaneliu/password_generator'
13
+ # gem s.date = '2013-10-24'
14
+ gem.files = `git ls-files`.split($/)
15
15
  puts "exe: #{gem.files.grep(%r{^bin/}).map {|f| File.basename(f)}}"
16
- gem.executables = gem.files.grep(%r{^bin/}).map {|f| File.basename(f)}
17
- gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
18
- gem.require_paths = ['lib']
16
+ gem.executables = gem.files.grep(%r{^bin/}).map {|f| File.basename(f)}
17
+ gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
18
+ gem.require_paths = ['lib']
19
+ gem.cert_chain = ['certs/stephaneliu.pem']
20
+ gem.signing_key = File.expand_path("~/.ssh/gem-private_key.pem") if $0 =~ /gem\z/
19
21
 
20
22
  gem.add_development_dependency 'simplecov', '>= 0.7'
21
23
  gem.add_development_dependency 'coveralls', '>= 0.7.0'
22
24
 
23
- gem.license = 'MIT'
25
+ gem.license = 'MIT'
24
26
  end
@@ -9,6 +9,16 @@ describe PasswordListGenerator::Password do
9
9
  @config.max = 8
10
10
  end
11
11
 
12
+ describe '.new' do
13
+ it 'should initialize password and config variables' do
14
+ text = "test"
15
+ password = PasswordListGenerator::Password.new(text, @config)
16
+
17
+ password.password.must_equal text
18
+ password.config.must_equal @config
19
+ end
20
+ end
21
+
12
22
  describe '.to_s' do
13
23
  it 'should return password value' do
14
24
  text = 'hello'
data.tar.gz.sig ADDED
@@ -0,0 +1 @@
1
+ <�;��{�f�
metadata CHANGED
@@ -1,14 +1,36 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: password_list_generator
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.3
4
+ version: 0.4.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stephane Liu
8
8
  autorequire:
9
9
  bindir: bin
10
- cert_chain: []
11
- date: 2013-11-08 00:00:00.000000000 Z
10
+ cert_chain:
11
+ - |
12
+ -----BEGIN CERTIFICATE-----
13
+ MIIDYDCCAkigAwIBAgIBATANBgkqhkiG9w0BAQUFADA7MQ0wCwYDVQQDDARzbGl1
14
+ MRUwEwYKCZImiZPyLGQBGRYFc2psaXUxEzARBgoJkiaJk/IsZAEZFgNjb20wHhcN
15
+ MTMxMTIxMDgyMjMwWhcNMTQxMTIxMDgyMjMwWjA7MQ0wCwYDVQQDDARzbGl1M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END CERTIFICATE-----
33
+ date: 2013-11-21 00:00:00.000000000 Z
12
34
  dependencies:
13
35
  - !ruby/object:Gem::Dependency
14
36
  name: simplecov
@@ -49,12 +71,14 @@ files:
49
71
  - .gitignore
50
72
  - .ruby-gemset
51
73
  - .ruby-version
74
+ - .travis.yml
52
75
  - Gemfile
53
76
  - Gemfile.lock
54
77
  - Guardfile
55
78
  - README.md
56
79
  - Rakefile
57
80
  - bin/pwgen
81
+ - certs/stephaneliu.pem
58
82
  - lib/password_list_generator.rb
59
83
  - lib/password_list_generator/generator.rb
60
84
  - lib/password_list_generator/password.rb
@@ -82,7 +106,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
82
106
  version: '0'
83
107
  requirements: []
84
108
  rubyforge_project:
85
- rubygems_version: 2.0.3
109
+ rubygems_version: 2.1.10
86
110
  signing_key:
87
111
  specification_version: 4
88
112
  summary: Generate list of passwords easily from command line
metadata.gz.sig ADDED
Binary file