personal_wordlist 0.1.0 → 0.1.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ad270b79c7b8358f7bce982d8e5defc4136b8c5a
4
- data.tar.gz: 309ec84e26bbb248e99635c8aaa6acab12cd9776
3
+ metadata.gz: bde638fa1dc5ac1508b8ffa60eb9334353af3f81
4
+ data.tar.gz: e8ccd596cf159db7c6bac6a7102a034ae9b59152
5
5
  SHA512:
6
- metadata.gz: e41cc60360bf704cf4d540b23aac241e870f2502e9ef97a8e90f2ab755a4530574eb2213b56fdcf3c4c93f89b1f7e10f342648271bf0d82b5d120fb2bfa97d16
7
- data.tar.gz: 64f036b8201f234344bbaa6d03ef0ffce62d117312bf05491e309aafad01c4a5a860281d263d222777bb569a288d60b69b9d25e960a9341997a01a8866ceb5cb
6
+ metadata.gz: 9755b2c15312a1b5b94ecd0fca3ec81112c2efa57651f2387c3d62ee3d77dd6d21e2e69a628c5d9460ad8b29372cca7c23f1f6fec5bff438950b29d8e759f600
7
+ data.tar.gz: 5f71194e61c9092fa50d18cbac0e03f695ae825718b7bf7f9bbc908545d31342084f842f287fc51957792d11df69c9e17888ded6e26cadaa201df2dec3fc01df
data/.travis.yml ADDED
@@ -0,0 +1,9 @@
1
+ language: ruby
2
+ rvm:
3
+ - 1.9.3
4
+ - 2.0.0
5
+ - 2.1.3
6
+ - 2.2.0
7
+ - ruby-head
8
+ - jruby-19mode
9
+ - rbx-2
data/Gemfile ADDED
@@ -0,0 +1,6 @@
1
+ source 'https://rubygems.org'
2
+
3
+ group :test do
4
+ gem 'rake'
5
+ gem 'rspec'
6
+ end
data/Gemfile.lock ADDED
@@ -0,0 +1,24 @@
1
+ GEM
2
+ remote: https://rubygems.org/
3
+ specs:
4
+ diff-lcs (1.2.5)
5
+ rake (10.4.2)
6
+ rspec (3.1.0)
7
+ rspec-core (~> 3.1.0)
8
+ rspec-expectations (~> 3.1.0)
9
+ rspec-mocks (~> 3.1.0)
10
+ rspec-core (3.1.7)
11
+ rspec-support (~> 3.1.0)
12
+ rspec-expectations (3.1.2)
13
+ diff-lcs (>= 1.2.0, < 2.0)
14
+ rspec-support (~> 3.1.0)
15
+ rspec-mocks (3.1.3)
16
+ rspec-support (~> 3.1.0)
17
+ rspec-support (3.1.2)
18
+
19
+ PLATFORMS
20
+ ruby
21
+
22
+ DEPENDENCIES
23
+ rake
24
+ rspec
data/HISTORY.md ADDED
@@ -0,0 +1,11 @@
1
+ # personal_wordlist Change History
2
+
3
+
4
+ ## 0.1.0
5
+
6
+ Initial release with minimum requirements
7
+
8
+ ### 0.1.1
9
+
10
+ - String parameter support added for partials. partials can be called like
11
+ ```partial 'test'``` instead of ```partial { 'test' }``` for basic patterns.
data/README.md CHANGED
@@ -1,3 +1,5 @@
1
+ [![Build Status](https://secure.travis-ci.org/turhn/personal_wordlist.png)](http://travis-ci.org/turhn/personal_wordlist)
2
+
1
3
  # personal_wordlist
2
4
 
3
5
  **personal_wordlist** is a wordlist generator backend to create wordlists from the given personal data. It is originally designed for security purposes.
@@ -33,7 +35,7 @@ end
33
35
 
34
36
  ```partial``` is a string pattern and can be used to combine more complex strings.
35
37
 
36
- ```
38
+ ```ruby
37
39
  partial { first_name[0..1] }
38
40
  partial { '123' }
39
41
  partial { last_name[0].downcase }
@@ -44,7 +46,7 @@ Consider the data is ```{ first_name: 'John', last_name: 'Doe' }``` and the resu
44
46
 
45
47
  ```sequence```s are like loops in programming languages. sequence method requires a ```Range``` variable and a block.
46
48
 
47
- ```
49
+ ```ruby
48
50
  sequence(1998..2011) do |n|
49
51
  # string manupulation here
50
52
  end
@@ -52,7 +54,7 @@ end
52
54
 
53
55
  You can insert partials into sequences.
54
56
 
55
- ```
57
+ ```ruby
56
58
  sequence(1998..2011) do |n|
57
59
  partial { first_name.downcase }
58
60
  partial { n.to_s }
@@ -63,7 +65,7 @@ And result becomes: _['john1998', 'john1999', 'john2000', ... 'john2011']_
63
65
  When sequence is done iterating, the result is added to the returning array of strings. If you have multiple sequences, the results from each sequence will be concatenated.
64
66
 
65
67
  ### Example
66
- ```
68
+ ```ruby
67
69
  personal_data = {
68
70
  first_name: 'John', last_name: 'Doe',
69
71
  date_of_birth: '1980-01-01', favorite_team: 'Galatasaray'
@@ -86,13 +88,34 @@ end
86
88
  ## Future Plans
87
89
 
88
90
  - CLI, I see that as a must.
89
- - Input Data Adaptors, I am planning to create adaptors such as parsing yaml, xml, csv file to input hash format.
91
+ - Input Data Adaptors, I am planning to create adaptors such as parsing yaml, xml, csv files into input hash parameter format.
90
92
 
91
93
  ## Contribution
92
94
 
93
- Contributing to factory_girl:
95
+ Contributing to personal_wordlist:
96
+
97
+ - Fork the official repository.
98
+ - Make your changes in a topic branch.
99
+ - Send a pull request.
100
+
101
+ ## Licence
102
+
103
+ Copyright (c) 2015 Turhan Coskun
104
+
105
+ Permission is hereby granted, free of charge, to any person obtaining a copy
106
+ of this software and associated documentation files (the "Software"), to deal
107
+ in the Software without restriction, including without limitation the rights
108
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
109
+ copies of the Software, and to permit persons to whom the Software is
110
+ furnished to do so, subject to the following conditions:
111
+
112
+ The above copyright notice and this permission notice shall be included in
113
+ all copies or substantial portions of the Software.
94
114
 
95
- Fork the official repository.
96
- Make your changes in a topic branch.
97
- Send a pull request.
98
- ## Licence
115
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
116
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
117
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
118
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
119
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
120
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
121
+ THE SOFTWARE.
data/Rakefile ADDED
@@ -0,0 +1,10 @@
1
+ require 'bundler'
2
+ require 'rspec/core/rake_task'
3
+
4
+ Bundler::GemHelper.install_tasks
5
+
6
+ RSpec::Core::RakeTask.new do |t|
7
+ t.rspec_opts = %w(--format documentation --colour)
8
+ end
9
+
10
+ task default: 'spec'
@@ -4,9 +4,10 @@ require 'personal_wordlist/dsl/sequence'
4
4
  module PersonalWordlist
5
5
  # DSL Syntax Methods
6
6
  module DSL
7
- def partial(&block)
8
- fail ArgumentError unless block_given?
9
- @current_password += Partial.new(@personal_data, block).run!
7
+ def partial(arg = nil, &block)
8
+ # Either string or block must exist
9
+ fail ArgumentError unless !arg.nil? ^ block_given?
10
+ @current_password += Partial.new(@personal_data, block, arg).run!
10
11
  end
11
12
 
12
13
  def sequence(range, &block)
@@ -2,12 +2,15 @@ module PersonalWordlist
2
2
  module DSL
3
3
  # Evaluate of methods in `partial` blocks
4
4
  class Partial
5
- def initialize(personal_data, block)
5
+ def initialize(personal_data, block, arg)
6
+ fail ArgumentError if arg && block
6
7
  @block = block
7
8
  @personal_data = personal_data
9
+ @arg = arg
8
10
  end
9
11
 
10
12
  def run!
13
+ @block = proc { @arg } if @arg # For string args
11
14
  instance_eval(&@block)
12
15
  end
13
16
 
@@ -1,3 +1,3 @@
1
1
  module PersonalWordlist
2
- VERSION = '0.1.0'
2
+ VERSION = '0.1.1'
3
3
  end
@@ -4,10 +4,12 @@ require 'personal_wordlist/version'
4
4
  Gem::Specification.new do |s|
5
5
  s.name = 'personal_wordlist'
6
6
  s.version = PersonalWordlist::VERSION
7
- s.date = '2015-01-18'
8
7
  s.summary = 'Create wordlists from personal data.'
8
+ s.description = 'personal_wordlist a wordlist generator which creates an
9
+ array of possible passwords within a custom DSL'
10
+ s.homepage = 'https://github.com/turhn/personal_wordlist'
9
11
 
10
- s.authors = ['Turhan Coskun']
12
+ s.author = 'Turhan Coskun'
11
13
  s.email = 'turhancoskun@gmail.com'
12
14
 
13
15
  s.files = `git ls-files`.split("\n").reject { |path| path =~ /\.gitignore$/ }
@@ -16,7 +18,6 @@ Gem::Specification.new do |s|
16
18
 
17
19
  s.require_paths = ['lib']
18
20
  s.required_ruby_version = Gem::Requirement.new('>= 1.9.2')
19
- s.add_development_dependency('rspec')
20
-
21
+ s.add_development_dependency 'rspec', '~> 3.1', '>= 3.1.7'
21
22
  s.license = 'MIT'
22
23
  end
data/spec/dsl_spec.rb CHANGED
@@ -16,7 +16,7 @@ end
16
16
  describe 'SocialWordlist::DSL' do
17
17
  subject { TestClass.new(john_doe) }
18
18
  describe '#partial' do
19
- it 'should fail if block is not given' do
19
+ it 'should fail if block or string arg is not given' do
20
20
  expect { subject.partial }.to raise_error ArgumentError
21
21
  end
22
22
  it 'should access class variables' do
@@ -32,6 +32,14 @@ describe 'SocialWordlist::DSL' do
32
32
  end
33
33
  end.to change { subject.current_password }.from('').to('J123Dxyz')
34
34
  end
35
+ it 'should accept string arguments' do
36
+ expect do
37
+ subject.partial('test') { 'other text' }
38
+ end.to raise_error ArgumentError
39
+ expect do
40
+ subject.partial 'test'
41
+ end.to change { subject.current_password }.from('').to('test')
42
+ end
35
43
  end
36
44
 
37
45
  describe '#sequence' do
metadata CHANGED
@@ -1,36 +1,49 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: personal_wordlist
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Turhan Coskun
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-01-18 00:00:00.000000000 Z
11
+ date: 2015-01-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rspec
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '3.1'
17
20
  - - ">="
18
21
  - !ruby/object:Gem::Version
19
- version: '0'
22
+ version: 3.1.7
20
23
  type: :development
21
24
  prerelease: false
22
25
  version_requirements: !ruby/object:Gem::Requirement
23
26
  requirements:
27
+ - - "~>"
28
+ - !ruby/object:Gem::Version
29
+ version: '3.1'
24
30
  - - ">="
25
31
  - !ruby/object:Gem::Version
26
- version: '0'
27
- description:
32
+ version: 3.1.7
33
+ description: |-
34
+ personal_wordlist a wordlist generator which creates an
35
+ array of possible passwords within a custom DSL
28
36
  email: turhancoskun@gmail.com
29
37
  executables: []
30
38
  extensions: []
31
39
  extra_rdoc_files: []
32
40
  files:
41
+ - ".travis.yml"
42
+ - Gemfile
43
+ - Gemfile.lock
44
+ - HISTORY.md
33
45
  - README.md
46
+ - Rakefile
34
47
  - lib/personal_wordlist.rb
35
48
  - lib/personal_wordlist/dsl.rb
36
49
  - lib/personal_wordlist/dsl/partial.rb
@@ -42,7 +55,7 @@ files:
42
55
  - spec/personal_wordlist_spec.rb
43
56
  - spec/spec_helper.rb
44
57
  - spec/support/people_helper.rb
45
- homepage:
58
+ homepage: https://github.com/turhn/personal_wordlist
46
59
  licenses:
47
60
  - MIT
48
61
  metadata: {}