to_pass 0.5.0 → 0.5.2
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile +2 -0
- data/Rakefile +0 -20
- data/TODO +30 -23
- data/VERSION +1 -1
- data/lib/to_pass/converters/expand_below.rb +4 -1
- data/lib/to_pass/version.rb +14 -0
- data/lib/to_pass.rb +3 -5
- data/test/test_algorithms.rb +2 -2
- data/test/test_base.rb +10 -0
- data/test/test_converters.rb +2 -3
- metadata +26 -12
- data/.gitignore +0 -5
data/Gemfile
ADDED
data/Rakefile
CHANGED
@@ -4,26 +4,6 @@
|
|
4
4
|
# # enable trace to get better error output
|
5
5
|
# Rake.application.options.trace = true
|
6
6
|
|
7
|
-
# jeweler task
|
8
|
-
begin
|
9
|
-
require 'jeweler'
|
10
|
-
Jeweler::Tasks.new do |gem|
|
11
|
-
gem.name = "to_pass"
|
12
|
-
gem.summary = "generate password from words or sentences"
|
13
|
-
gem.description = %Q{Passwords should be easy to remember and hard to guess.
|
14
|
-
One technique is to have a sentence which can be easily remembered transformed to a password.}
|
15
|
-
gem.email = "kronn@kronn.de"
|
16
|
-
gem.homepage = "http://github.com/kronn/to_pass"
|
17
|
-
gem.authors = ["Matthias Viehweger"]
|
18
|
-
|
19
|
-
gem.add_development_dependency 'mocha'
|
20
|
-
gem.add_development_dependency 'sdoc'
|
21
|
-
end
|
22
|
-
Jeweler::GemcutterTasks.new
|
23
|
-
rescue LoadError
|
24
|
-
puts "Jeweler (or a dependency) not available. Install it with: gem install jeweler"
|
25
|
-
end
|
26
|
-
|
27
7
|
# documentation tasks
|
28
8
|
begin
|
29
9
|
%w[ rake/rdoctask sdoc ].each { |lib| require lib }
|
data/TODO
CHANGED
@@ -1,34 +1,41 @@
|
|
1
|
-
|
1
|
+
CURRENT
|
2
2
|
============================================================================
|
3
3
|
- make it debian compatible (most of which is common sense anyway)
|
4
4
|
http://pkg-ruby-extras.alioth.debian.org/upstream-devs.html
|
5
|
-
|
5
|
+
✓ Distribute your software as a source code archive
|
6
|
+
github allows that
|
7
|
+
|
6
8
|
- Use setup.rb
|
7
|
-
|
8
|
-
|
9
|
+
http://github.com/proutils/setup
|
10
|
+
|
11
|
+
✓ Remove all references to rubygems in the software you ship
|
12
|
+
✓ Don’t make your Rakefile depend on RubyGems
|
13
|
+
|
9
14
|
- Make your tests and examples usable outside of your directory tree
|
10
|
-
|
11
|
-
|
12
|
-
|
15
|
+
this might be achieved by using setup.rb anyway...
|
16
|
+
|
17
|
+
✓ Use a shebang that works everywhere
|
18
|
+
✓ Provide man pages for your binaries
|
19
|
+
✓ If possible, maintain a backward-compatible API
|
13
20
|
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
21
|
+
|
22
|
+
UP NEXT
|
23
|
+
============================================================================
|
24
|
+
- Improve CLI-Code
|
25
|
+
- rescue OptionParser::InvalidOption with help screen
|
26
|
+
- add option '-c, --config PATH - Configuration Path (default is ~/.to_pass)'
|
27
|
+
- add ability to execute commands
|
28
|
+
- add command to generate configuration path
|
29
|
+
- add command to output available converters
|
30
|
+
- add command to output available algorithms
|
31
|
+
- handle CLI with Thor
|
32
|
+
- have some RELEASE-NOTES or CHANGELOG
|
33
|
+
- GemSpec#post_install_message = filename
|
23
34
|
|
24
35
|
|
25
36
|
SOMEDAY
|
26
37
|
============================================================================
|
27
|
-
- move decision wether a string is a word or not into algorithm definition.
|
28
38
|
- test on windows
|
29
|
-
-
|
30
|
-
- add
|
31
|
-
-
|
32
|
-
- add command to generate configuration path
|
33
|
-
- add command to output available converters
|
34
|
-
- add command to output available algorithms
|
39
|
+
- move decision wether a string is a word or not into algorithm definition.
|
40
|
+
- add task to validate user supplied algorithms and converters
|
41
|
+
- ?? replace Rake with Thor
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.5.
|
1
|
+
0.5.2
|
@@ -0,0 +1,14 @@
|
|
1
|
+
# -*- coding: utf-8 -*-
|
2
|
+
# vim:ft=ruby:enc=utf-8
|
3
|
+
|
4
|
+
# Library to convert a String into a Password
|
5
|
+
module ToPass
|
6
|
+
# version of gem, read directly from the VERSION-File
|
7
|
+
VERSION = File.read(File.join(File.dirname(__FILE__), '../../VERSION')).strip
|
8
|
+
|
9
|
+
# name of gem
|
10
|
+
APP_NAME = 'to_pass'
|
11
|
+
|
12
|
+
# date of last modification of the version
|
13
|
+
DATE = File.mtime(File.join(File.dirname(__FILE__), '../../VERSION'))
|
14
|
+
end
|
data/lib/to_pass.rb
CHANGED
@@ -3,11 +3,9 @@
|
|
3
3
|
|
4
4
|
# Library to convert a String into a Password
|
5
5
|
module ToPass
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
# name of gem
|
10
|
-
APP_NAME = 'to_pass'
|
6
|
+
autoload :VERSION, 'lib/to_pass/version'
|
7
|
+
autoload :DATE, 'lib/to_pass/version'
|
8
|
+
autoload :APP_NAME, 'lib/to_pass/version'
|
11
9
|
|
12
10
|
autoload :AlgorithmReader, 'lib/to_pass/algorithm_reader'
|
13
11
|
autoload :Base, 'lib/to_pass/base'
|
data/test/test_algorithms.rb
CHANGED
@@ -15,8 +15,8 @@ class TestAlgorithms < Test::Unit::TestCase
|
|
15
15
|
end
|
16
16
|
|
17
17
|
def test_secure
|
18
|
-
assert_algorithm '$
|
19
|
-
assert_algorithm '
|
18
|
+
assert_algorithm '$78bRkT5eT0n5Fk', 'test', :secure
|
19
|
+
assert_algorithm '5P2fWb2Cm0Wf%$5', 'my cat is cute', :secure
|
20
20
|
end
|
21
21
|
|
22
22
|
protected
|
data/test/test_base.rb
CHANGED
@@ -17,7 +17,17 @@ class TestBase < Test::Unit::TestCase
|
|
17
17
|
assert_equal Pathname.new("#{File.dirname(__FILE__)}/../VERSION").expand_path.read.chomp, ToPass::VERSION
|
18
18
|
end
|
19
19
|
|
20
|
+
def test_date
|
21
|
+
assert_equal Pathname.new("#{File.dirname(__FILE__)}/../VERSION").expand_path.mtime, ToPass::DATE
|
22
|
+
end
|
23
|
+
|
20
24
|
def test_appname
|
21
25
|
assert_equal "to_pass", ToPass::APP_NAME
|
22
26
|
end
|
27
|
+
|
28
|
+
def test_gemspec_is_valid
|
29
|
+
assert_nothing_raised do
|
30
|
+
assert eval(Pathname.new("#{File.dirname(__FILE__)}/../to_pass.gemspec").expand_path.read).validate
|
31
|
+
end
|
32
|
+
end
|
23
33
|
end
|
data/test/test_converters.rb
CHANGED
@@ -19,10 +19,9 @@ class TestConverters < Test::Unit::TestCase
|
|
19
19
|
end
|
20
20
|
|
21
21
|
def test_expand_below
|
22
|
-
|
23
|
-
# 1.upto(digest.length / 2).map { |nr| digest[(nr*2-2),2] }.map { |pair| pair.to_i(16).chr }.map { |char| char if char =~ /\w/i }.compact.join
|
24
|
-
assert_converter 'testkFsNoKrb87d', { 'expand_below' => 5 }, 'test'
|
22
|
+
assert_converter 'kFsNotestKrb87d', { 'expand_below' => 5 }, 'test'
|
25
23
|
assert_converter 'testtest', { 'expand_below' => 5 }, 'testtest'
|
24
|
+
|
26
25
|
end
|
27
26
|
|
28
27
|
def test_reverse
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: to_pass
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 15
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 5
|
9
|
-
-
|
10
|
-
version: 0.5.
|
9
|
+
- 2
|
10
|
+
version: 0.5.2
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Matthias Viehweger
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2010-
|
18
|
+
date: 2010-08-10 00:00:00 +02:00
|
19
19
|
default_executable:
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|
@@ -46,9 +46,21 @@ dependencies:
|
|
46
46
|
version: "0"
|
47
47
|
type: :development
|
48
48
|
version_requirements: *id002
|
49
|
-
|
50
|
-
|
51
|
-
|
49
|
+
- !ruby/object:Gem::Dependency
|
50
|
+
name: gem-release
|
51
|
+
prerelease: false
|
52
|
+
requirement: &id003 !ruby/object:Gem::Requirement
|
53
|
+
none: false
|
54
|
+
requirements:
|
55
|
+
- - ">="
|
56
|
+
- !ruby/object:Gem::Version
|
57
|
+
hash: 3
|
58
|
+
segments:
|
59
|
+
- 0
|
60
|
+
version: "0"
|
61
|
+
type: :development
|
62
|
+
version_requirements: *id003
|
63
|
+
description: " Passwords should be easy to remember and hard to guess.\n One technique is to have a sentence which can be easily remembered transformed to a password.\n\n Pluggable algorithms and converters allow customization of the transformation process.\n"
|
52
64
|
email: kronn@kronn.de
|
53
65
|
executables:
|
54
66
|
- password_of
|
@@ -60,15 +72,14 @@ extra_rdoc_files:
|
|
60
72
|
- README.rdoc
|
61
73
|
- TODO
|
62
74
|
files:
|
63
|
-
- .gitignore
|
64
75
|
- LICENSE
|
65
76
|
- README.rdoc
|
66
|
-
- Rakefile
|
67
77
|
- TODO
|
68
78
|
- VERSION
|
79
|
+
- Rakefile
|
80
|
+
- Gemfile
|
69
81
|
- bin/password_of
|
70
82
|
- bin/to_pass
|
71
|
-
- lib/to_pass.rb
|
72
83
|
- lib/to_pass/algorithm_reader.rb
|
73
84
|
- lib/to_pass/algorithms/basic_de.yml
|
74
85
|
- lib/to_pass/algorithms/basic_en.yml
|
@@ -77,7 +88,6 @@ files:
|
|
77
88
|
- lib/to_pass/cli.rb
|
78
89
|
- lib/to_pass/converter.rb
|
79
90
|
- lib/to_pass/converter_reader.rb
|
80
|
-
- lib/to_pass/converters.rb
|
81
91
|
- lib/to_pass/converters/collapse_chars.rb
|
82
92
|
- lib/to_pass/converters/downcase.rb
|
83
93
|
- lib/to_pass/converters/expand_below.rb
|
@@ -86,7 +96,10 @@ files:
|
|
86
96
|
- lib/to_pass/converters/replace.rb
|
87
97
|
- lib/to_pass/converters/reverse.rb
|
88
98
|
- lib/to_pass/converters/swapcase.rb
|
99
|
+
- lib/to_pass/converters.rb
|
89
100
|
- lib/to_pass/integration.rb
|
101
|
+
- lib/to_pass/version.rb
|
102
|
+
- lib/to_pass.rb
|
90
103
|
- man/index.txt
|
91
104
|
- man/to_pass-algorithm.5
|
92
105
|
- man/to_pass-algorithm.5.html
|
@@ -137,12 +150,13 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
137
150
|
version: "0"
|
138
151
|
requirements: []
|
139
152
|
|
140
|
-
rubyforge_project:
|
153
|
+
rubyforge_project: "[none]"
|
141
154
|
rubygems_version: 1.3.7
|
142
155
|
signing_key:
|
143
156
|
specification_version: 3
|
144
157
|
summary: generate password from words or sentences
|
145
158
|
test_files:
|
159
|
+
- test/fixtures/user_alg.yml
|
146
160
|
- test/fixtures/user_converter.rb
|
147
161
|
- test/helper.rb
|
148
162
|
- test/test_algorithm_reader.rb
|