password_list_generator 0.4 → 0.4.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,7 @@
1
1
  ---
2
- !binary "U0hBMQ==":
3
- metadata.gz: !binary |-
4
- Y2JkZjA5ZDg0NmExN2M3MDM5YmRiNzMxNDgwYWM5NTVlYmJlZjU3OA==
5
- data.tar.gz: !binary |-
6
- ZmY5ZmE0ODgyNzUyZjhiYTYxZjA5M2RlZTdlZTg0MjY4ODcwOWYzMQ==
7
- !binary "U0hBNTEy":
8
- metadata.gz: !binary |-
9
- OGJlMDY5ZGE1MjQ1NTJkYTBiM2Y0YmFjNGY4YTM1YmRmOTE0MTk5MTUwMjU2
10
- NmNjMzVmOGNkNWY3NGFmN2NhMjkyZjhlMzE3MDIxMGJjYzk5MGI1OGZkZGQ5
11
- M2UxOWNiMjZjYTc3OTg5MzZhODQwOGY3ZTIzNTFmMjliMWMxNjE=
12
- data.tar.gz: !binary |-
13
- MTMyYjhlZTA5ZjlhNDhkMjk2OTZmMzQ1ZmRhYzk1YmFiM2MwNGViZDFjNTRm
14
- YzVmZjgxOTliMjU0OGVmMTczNjdiZWM0Nzg5YzZjNTQ3YjIyNzRlMDIwOTA4
15
- NGYwZDAyYTE3ZTIxODVhODQ5ZTkzMDAwNjFiMDY2ZDJkMjkxNjA=
2
+ SHA1:
3
+ metadata.gz: 26c2aef718fc3bb9a9246052eb0804fceb634ef1
4
+ data.tar.gz: 6cec99c4cf64f64204ea90302221bf8f814133df
5
+ SHA512:
6
+ metadata.gz: 621b7a3dfb3d4f3fa0a943c44014f22f4f7ccaff53e604f137d43ce8290cffd49de36c72191a5bf3a5a3479f1d5fadd14a0c9e9a3b4187af6b42bcc5d39e3df4
7
+ data.tar.gz: 237d9eefb9756789f4aa72bac45864e0e1eb1e0754a70179f3d36d44553fa579aec9f36f9572384a17cc8f8d25937866ab595de6089209b47e2f77b88d19631a
data/.gitignore ADDED
@@ -0,0 +1,3 @@
1
+ /password_list_generator*.gem
2
+ /password.txt
3
+ /coverage/
data/.ruby-gemset ADDED
@@ -0,0 +1 @@
1
+ password_generator
data/.ruby-version ADDED
@@ -0,0 +1 @@
1
+ ruby-2.0.0-p247
data/Gemfile ADDED
@@ -0,0 +1,14 @@
1
+ source "https://rubygems.org/"
2
+
3
+
4
+ group :test do
5
+ gem 'rake'
6
+ gem 'minitest'
7
+ gem 'guard-minitest'
8
+ gem 'minitest-matchers'
9
+ gem 'rb-fsevent'
10
+ gem 'terminal-notifier-guard'
11
+ gem 'simplecov', require: false
12
+ gem 'coveralls', require: false
13
+ end
14
+
data/Gemfile.lock ADDED
@@ -0,0 +1,68 @@
1
+ GEM
2
+ remote: https://rubygems.org/
3
+ specs:
4
+ celluloid (0.15.2)
5
+ timers (~> 1.1.0)
6
+ coderay (1.0.9)
7
+ coveralls (0.7.0)
8
+ multi_json (~> 1.3)
9
+ rest-client
10
+ simplecov (>= 0.7)
11
+ term-ansicolor
12
+ thor
13
+ ffi (1.9.3)
14
+ formatador (0.2.4)
15
+ guard (2.2.2)
16
+ formatador (>= 0.2.4)
17
+ listen (~> 2.1)
18
+ lumberjack (~> 1.0)
19
+ pry (>= 0.9.12)
20
+ thor (>= 0.18.1)
21
+ guard-minitest (2.0.0)
22
+ guard (~> 2.0)
23
+ minitest (>= 3.0)
24
+ listen (2.2.0)
25
+ celluloid (>= 0.15.2)
26
+ rb-fsevent (>= 0.9.3)
27
+ rb-inotify (>= 0.9)
28
+ lumberjack (1.0.4)
29
+ method_source (0.8.2)
30
+ mime-types (2.0)
31
+ minitest (5.0.8)
32
+ minitest-matchers (1.4.1)
33
+ minitest (~> 5.0)
34
+ multi_json (1.8.2)
35
+ pry (0.9.12.2)
36
+ coderay (~> 1.0.5)
37
+ method_source (~> 0.8)
38
+ slop (~> 3.4)
39
+ rake (10.1.0)
40
+ rb-fsevent (0.9.3)
41
+ rb-inotify (0.9.2)
42
+ ffi (>= 0.5.0)
43
+ rest-client (1.6.7)
44
+ mime-types (>= 1.16)
45
+ simplecov (0.7.1)
46
+ multi_json (~> 1.0)
47
+ simplecov-html (~> 0.7.1)
48
+ simplecov-html (0.7.1)
49
+ slop (3.4.6)
50
+ term-ansicolor (1.2.2)
51
+ tins (~> 0.8)
52
+ terminal-notifier-guard (1.5.3)
53
+ thor (0.18.1)
54
+ timers (1.1.0)
55
+ tins (0.12.0)
56
+
57
+ PLATFORMS
58
+ ruby
59
+
60
+ DEPENDENCIES
61
+ coveralls
62
+ guard-minitest
63
+ minitest
64
+ minitest-matchers
65
+ rake
66
+ rb-fsevent
67
+ simplecov
68
+ terminal-notifier-guard
data/Guardfile ADDED
@@ -0,0 +1,16 @@
1
+ # A sample Guardfile
2
+ # More info at https://github.com/guard/guard#readme
3
+
4
+ guard :minitest do
5
+ # with Minitest::Unit
6
+ # watch(%r{^test/(.*)\/?test_(.*)\.rb})
7
+ # watch(%r{^lib/(.*/)?([^/]+)\.rb}) { |m| "test/#{m[1]}test_#{m[2]}.rb" }
8
+ # watch(%r{^test/test_helper\.rb}) { 'test' }
9
+
10
+ # with Minitest::Spec
11
+ watch(%r{^spec/(.*)_spec\.rb})
12
+ watch(%r{^lib/(.+)\.rb}) { |m| "spec/#{m[1]}_spec.rb" }
13
+ watch(%r{^lib/password_generator/(.+)\.rb}) { |m| "spec/#{m[1]}_spec.rb" }
14
+ watch(%r{^bin/pwgen}) { |m| "spec/lib/pwgen_spec.rb" }
15
+ watch(%r{^spec/spec_helper\.rb}) { 'spec' }
16
+ end
data/README.md ADDED
File without changes
data/Rakefile ADDED
@@ -0,0 +1,9 @@
1
+ require 'rake/testtask'
2
+
3
+ Rake::TestTask.new do |t|
4
+ t.libs << 'spec'
5
+ t.test_files = FileList['spec/**/*_spec.rb']
6
+ end
7
+
8
+ desc "Run specs"
9
+ task default: :test
@@ -1,2 +1,3 @@
1
- require_relative 'password_list_generator/password'
2
- require_relative 'password_list_generator/generator'
1
+ require 'securerandom'
2
+ require_relative 'password_list_generator/password'
3
+ require_relative 'password_list_generator/generator'
@@ -1,5 +1,3 @@
1
- require 'securerandom'
2
-
3
1
  module PasswordListGenerator
4
2
  class Generator
5
3
  attr_accessor :characters_set, :config
@@ -0,0 +1,3 @@
1
+ module PasswordListGenerator
2
+ VERSION="0.4.1"
3
+ end
@@ -0,0 +1,24 @@
1
+ lib = File.expand_path('../lib', __FILE__)
2
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
3
+ require 'password_list_generator/version'
4
+
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($/)
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']
19
+
20
+ gem.add_development_dependency 'simplecov', '>= 0.7'
21
+ gem.add_development_dependency 'coveralls', '>= 0.7.0'
22
+
23
+ gem.license = 'MIT'
24
+ end
@@ -0,0 +1,115 @@
1
+ require_relative 'spec_helper'
2
+ require 'ostruct'
3
+
4
+ describe PasswordListGenerator::Password do
5
+
6
+ before do
7
+ @config = OpenStruct.new
8
+ @config.min = 2
9
+ @config.max = 8
10
+ end
11
+
12
+ describe '.to_s' do
13
+ it 'should return password value' do
14
+ text = 'hello'
15
+ password = PasswordListGenerator::Password.new(text, @config)
16
+ password.to_s.must_equal text
17
+ end
18
+ end
19
+
20
+ describe '.valid?' do
21
+ it "should evaluate symbols" do
22
+ text_without = 'hello'
23
+ text_with = 'he###llo'
24
+
25
+ @config.symbol = true
26
+ password = PasswordListGenerator::Password.new(text_with, @config)
27
+ password.valid?.must_equal true
28
+ password = PasswordListGenerator::Password.new(text_without, @config)
29
+ password.valid?.must_equal false
30
+
31
+ @config.symbol = false
32
+ password = PasswordListGenerator::Password.new(text_with, @config)
33
+ password.valid?.must_equal true
34
+ password = PasswordListGenerator::Password.new(text_without, @config)
35
+ password.valid?.must_equal true
36
+ end
37
+
38
+ it "should evaluate numerics" do
39
+ text_with = 'he8llo'
40
+ text_without = 'hello'
41
+
42
+ @config.numeric = true
43
+ password = PasswordListGenerator::Password.new(text_with, @config)
44
+ password.valid?.must_equal true
45
+ password = PasswordListGenerator::Password.new(text_without, @config)
46
+ password.valid?.must_equal false
47
+
48
+ @config.numeric = false
49
+ password = PasswordListGenerator::Password.new(text_with, @config)
50
+ password.valid?.must_equal true
51
+ password = PasswordListGenerator::Password.new(text_without, @config)
52
+ password.valid?.must_equal true
53
+ end
54
+
55
+ it "should evaluate lowercase" do
56
+ text_with = 'hello'
57
+ text_without = 'HELLO'
58
+
59
+ password = PasswordListGenerator::Password.new(text_with, @config)
60
+ password.valid?.must_equal true
61
+ password = PasswordListGenerator::Password.new(text_without, @config)
62
+ password.valid?.must_equal false
63
+ end
64
+
65
+ it "should evaluate uppercase" do
66
+ text_with = 'HEllo'
67
+ text_without = 'hello'
68
+
69
+ @config.uppercase = true
70
+ password = PasswordListGenerator::Password.new(text_with, @config)
71
+ password.valid?.must_equal true
72
+ password = PasswordListGenerator::Password.new(text_without, @config)
73
+ password.valid?.must_equal false
74
+
75
+ @config.uppercase = false
76
+ password = PasswordListGenerator::Password.new(text_with, @config)
77
+ password.valid?.must_equal true
78
+ password = PasswordListGenerator::Password.new(text_without, @config)
79
+ password.valid?.must_equal true
80
+ end
81
+
82
+ it "should evaluate minimum length" do
83
+ @config.min = 5
84
+ below_min = 'helo'
85
+ equals_min = "hello"
86
+ exceeds_min = 'hellooo'
87
+
88
+ password = PasswordListGenerator::Password.new(below_min, @config)
89
+ password.valid?.must_equal false
90
+
91
+ password = PasswordListGenerator::Password.new(equals_min, @config)
92
+ password.valid?.must_equal true
93
+
94
+ password = PasswordListGenerator::Password.new(exceeds_min, @config)
95
+ password.valid?.must_equal true
96
+ end
97
+
98
+ it "should evaluate maximum length" do
99
+ @config.max = 5
100
+ below_max = 'helo'
101
+ equals_max = "hello"
102
+ exceeds_max = 'hellooo'
103
+
104
+ password = PasswordListGenerator::Password.new(below_max , @config)
105
+ password.valid?.must_equal true
106
+
107
+ password = PasswordListGenerator::Password.new(equals_max , @config)
108
+ password.valid?.must_equal true
109
+
110
+ password = PasswordListGenerator::Password.new(exceeds_max , @config)
111
+ password.valid?.must_equal false
112
+ end
113
+ end
114
+
115
+ end
@@ -0,0 +1,14 @@
1
+ require 'simplecov'
2
+ require 'coveralls'
3
+
4
+ SimpleCov.formatter = SimpleCov::Formatter::MultiFormatter[
5
+ SimpleCov::Formatter::HTMLFormatter,
6
+ Coveralls::SimpleCov::Formatter
7
+ ]
8
+ #SimpleCov.command_name 'guard'
9
+ SimpleCov.start
10
+
11
+ require File.join(File.dirname(__FILE__), "..", "lib", "password_list_generator")
12
+ require 'minitest/autorun'
13
+ require 'minitest/spec'
14
+ require 'minitest/pride' # fantabulous
metadata CHANGED
@@ -1,15 +1,43 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: password_list_generator
3
3
  version: !ruby/object:Gem::Version
4
- version: '0.4'
4
+ version: 0.4.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stephane Liu
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-10-24 00:00:00.000000000 Z
12
- dependencies: []
11
+ date: 2013-11-08 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: simplecov
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - '>='
18
+ - !ruby/object:Gem::Version
19
+ version: '0.7'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - '>='
25
+ - !ruby/object:Gem::Version
26
+ version: '0.7'
27
+ - !ruby/object:Gem::Dependency
28
+ name: coveralls
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - '>='
32
+ - !ruby/object:Gem::Version
33
+ version: 0.7.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.7.0
13
41
  description: Generate a list of passwords from command line with options for length
14
42
  and complexity into a file of your choice.
15
43
  email: sliu@sjliu.com
@@ -18,10 +46,22 @@ executables:
18
46
  extensions: []
19
47
  extra_rdoc_files: []
20
48
  files:
49
+ - .gitignore
50
+ - .ruby-gemset
51
+ - .ruby-version
52
+ - Gemfile
53
+ - Gemfile.lock
54
+ - Guardfile
55
+ - README.md
56
+ - Rakefile
57
+ - bin/pwgen
21
58
  - lib/password_list_generator.rb
22
- - lib/password_list_generator/password.rb
23
59
  - lib/password_list_generator/generator.rb
24
- - bin/pwgen
60
+ - lib/password_list_generator/password.rb
61
+ - lib/password_list_generator/version.rb
62
+ - password_list_generator.gemspec
63
+ - spec/password_spec.rb
64
+ - spec/spec_helper.rb
25
65
  homepage: https://github.com/stephaneliu/password_generator
26
66
  licenses:
27
67
  - MIT
@@ -32,12 +72,12 @@ require_paths:
32
72
  - lib
33
73
  required_ruby_version: !ruby/object:Gem::Requirement
34
74
  requirements:
35
- - - ! '>='
75
+ - - '>='
36
76
  - !ruby/object:Gem::Version
37
77
  version: '0'
38
78
  required_rubygems_version: !ruby/object:Gem::Requirement
39
79
  requirements:
40
- - - ! '>='
80
+ - - '>='
41
81
  - !ruby/object:Gem::Version
42
82
  version: '0'
43
83
  requirements: []
@@ -46,5 +86,6 @@ rubygems_version: 2.0.3
46
86
  signing_key:
47
87
  specification_version: 4
48
88
  summary: Generate list of passwords easily from command line
49
- test_files: []
50
- has_rdoc:
89
+ test_files:
90
+ - spec/password_spec.rb
91
+ - spec/spec_helper.rb