to_pass 0.6.0 → 0.7.0
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.rdoc +22 -2
- data/TODO +5 -4
- data/data/to_pass/converters/expand_below.rb +2 -2
- data/doc/CHANGELOG +261 -0
- data/{LICENSE → doc/LICENSE} +0 -0
- data/lib/to_pass.rb +18 -14
- data/lib/to_pass/algorithm_reader.rb +1 -2
- data/lib/to_pass/base.rb +1 -2
- data/lib/to_pass/cli.rb +2 -3
- data/lib/to_pass/converter.rb +6 -3
- data/lib/to_pass/converter_reader.rb +1 -2
- data/lib/to_pass/converters.rb +1 -2
- data/lib/to_pass/directories.rb +2 -3
- data/lib/to_pass/integration.rb +1 -2
- data/lib/to_pass/version.rb +30 -9
- data/man/index.txt +3 -3
- data/man/man1/to_pass.1.html +3 -3
- data/man/man5/to_pass-algorithm.5.html +2 -2
- data/man/man5/to_pass-converter.5.html +2 -2
- data/test/all.rb +3 -0
- data/test/fixtures/user_converter.rb +13 -12
- data/test/helper.rb +18 -8
- data/test/test_algorithm_reader.rb +2 -3
- data/test/test_algorithms.rb +2 -3
- data/test/test_base.rb +14 -5
- data/test/test_cli.rb +2 -3
- data/test/test_converter.rb +2 -3
- data/test/test_converter_reader.rb +2 -3
- data/test/test_converters.rb +2 -4
- data/test/test_integration.rb +2 -3
- metadata +23 -35
- data/Gemfile +0 -2
- data/Rakefile +0 -82
- data/VERSION +0 -1
data/README.rdoc
CHANGED
@@ -19,7 +19,7 @@ to_pass is distributed as rubygem
|
|
19
19
|
If you want to install from source, you can download a tarball or zipfile from
|
20
20
|
github.
|
21
21
|
|
22
|
-
$ curl -L http://github.com/kronn/to_pass/tarball/v0.
|
22
|
+
$ curl -L http://github.com/kronn/to_pass/tarball/v0.7.0 -o to_pass.tar.gz
|
23
23
|
$ tar -xzf to_pass.tar.gz
|
24
24
|
$ cd kronn-to_pass-HASHVALUE
|
25
25
|
$ ./setup.rb install
|
@@ -88,6 +88,26 @@ The usual pattern for github-projects applies:
|
|
88
88
|
I'll take a look at it and try to integrate it. If I cannot apply your changes
|
89
89
|
or don't want to, I'll let you know.
|
90
90
|
|
91
|
+
== Documentation
|
92
|
+
|
93
|
+
Most of the Documentation is contained in the doc-directory.
|
94
|
+
|
95
|
+
* doc/CHANGELOG
|
96
|
+
* doc/LICENSE
|
97
|
+
* doc/RELEASE_NOTES
|
98
|
+
|
99
|
+
There is also RDoc API-Documentation inside doc/rdoc.
|
100
|
+
|
101
|
+
The Manpages are located in man/ to be compatible with setup.rb. Alongside the
|
102
|
+
roff-version (for `man to_pass`) there are HTML-version if you prefer reading
|
103
|
+
docs in the browser.
|
104
|
+
|
105
|
+
* man/man1/to_pass.1.html
|
106
|
+
* man/man5/to_pass-algorithm.5.html
|
107
|
+
* man/man5/to_pass-converter.5.html
|
108
|
+
|
109
|
+
And of course, there is a README, but I think you have found it already...
|
110
|
+
|
91
111
|
== Copyright
|
92
112
|
|
93
|
-
Copyright (c) 2009-2010 Matthias Viehweger. See LICENSE for details.
|
113
|
+
Copyright (c) 2009-2010 Matthias Viehweger. See doc/LICENSE for details.
|
data/TODO
CHANGED
@@ -1,8 +1,9 @@
|
|
1
1
|
CURRENT
|
2
2
|
============================================================================
|
3
|
+
- test on multiple rubies (1.8.7, 1.9.2, Rubinius, REE)
|
3
4
|
- have some RELEASE-NOTES or CHANGELOG
|
4
5
|
- GemSpec#post_install_message = filename
|
5
|
-
|
6
|
+
- maybe http://github.com/proutils/vclog is useful...
|
6
7
|
|
7
8
|
|
8
9
|
UP NEXT
|
@@ -10,16 +11,16 @@ UP NEXT
|
|
10
11
|
- Improve CLI-Code
|
11
12
|
- rescue OptionParser::InvalidOption with help screen
|
12
13
|
- add option '-c, --config PATH - Configuration Path (default is ~/.to_pass)'
|
13
|
-
- add ability to execute commands
|
14
|
+
- add ability to execute commands == handle CLI with Thor ?
|
14
15
|
- add command to generate configuration path
|
15
16
|
- add command to output available converters
|
16
17
|
- add command to output available algorithms
|
17
|
-
|
18
|
+
- make tests faster
|
18
19
|
|
19
20
|
|
20
21
|
SOMEDAY
|
21
22
|
============================================================================
|
22
23
|
- test on windows
|
23
|
-
- move decision wether a string is a word or
|
24
|
+
- move decision wether a string is a word or a sentence into algorithm definition.
|
24
25
|
- add task to validate user supplied algorithms and converters
|
25
26
|
- ?? replace Rake with Thor
|
@@ -1,4 +1,4 @@
|
|
1
|
-
require 'md5'
|
1
|
+
require 'digest/md5'
|
2
2
|
|
3
3
|
module ToPass::Converters
|
4
4
|
class ExpandBelow
|
@@ -9,7 +9,7 @@ module ToPass::Converters
|
|
9
9
|
# before and after the string.
|
10
10
|
def expand_below(string, rules, threshold)
|
11
11
|
if string.length < threshold.to_i
|
12
|
-
digest = "#{MD5.hexdigest(string)}#{MD5.hexdigest(string).reverse}"
|
12
|
+
digest = "#{Digest::MD5.hexdigest(string)}#{Digest::MD5.hexdigest(string).reverse}"
|
13
13
|
extension = 1.upto(digest.length / 2).map do |nr|
|
14
14
|
char = digest[(nr*2-2),2].to_i(16).chr
|
15
15
|
char if char =~ /\w/i
|
data/doc/CHANGELOG
ADDED
@@ -0,0 +1,261 @@
|
|
1
|
+
RELEASE HISTORY
|
2
|
+
|
3
|
+
v0.6.0 / 2010-08-18
|
4
|
+
|
5
|
+
tag v0.6.0 (Matthias Viehweger <kronn@kronn.de>)
|
6
|
+
|
7
|
+
Changes:
|
8
|
+
|
9
|
+
* 16 General Enhancements
|
10
|
+
|
11
|
+
* check off 'use setup.rb' as this part works
|
12
|
+
* added setup.rb-leftovers to .gitignore
|
13
|
+
* updated TODO
|
14
|
+
* ronn is a development dependency
|
15
|
+
* move manpages into the right directory after creation for setup.rb compatibility
|
16
|
+
* fix typo and whitespace in setup.rb
|
17
|
+
* moved algorithms and converters into namespaced data-dirs
|
18
|
+
* added setup.rb
|
19
|
+
* moved converters into the right place
|
20
|
+
* some documentation
|
21
|
+
* refactored reader-classes to use ToPass::DIRECTORIES
|
22
|
+
* rewrote the ToPass::DIRECTORIES-Table into an anonymous Class
|
23
|
+
* prepared central lookup point for directories
|
24
|
+
* moved algorithms into data-dir (think /usr/share/to_pass)
|
25
|
+
* last maintainance steps to go to version 0.5.2 and leave jeweler behind.
|
26
|
+
* removed jeweler-part of Rakefile
|
27
|
+
|
28
|
+
|
29
|
+
v0.5.2 / 2010-08-09
|
30
|
+
|
31
|
+
tag v0.5.2 (Matthias Viehweger <kronn@kronn.de>)
|
32
|
+
|
33
|
+
Changes:
|
34
|
+
|
35
|
+
* 6 General Enhancements
|
36
|
+
|
37
|
+
* moved meta-information into version.rb
|
38
|
+
* rewrote gemspec to not depend on jeweler
|
39
|
+
* added jeweler-generated gemfile
|
40
|
+
* create a Gemfile with definitions from gemspec to install dependencies easier
|
41
|
+
* notes to TODO added
|
42
|
+
* Version bump to 0.5.1
|
43
|
+
|
44
|
+
|
45
|
+
v0.5.1 / 2010-07-26
|
46
|
+
|
47
|
+
Version bump to 0.5.1 (Matthias Viehweger kronn@kronn.de)
|
48
|
+
|
49
|
+
Changes:
|
50
|
+
|
51
|
+
* 3 General Enhancements
|
52
|
+
|
53
|
+
* changed behaviour of expand_below converter
|
54
|
+
* maintained TODO-list
|
55
|
+
* Version bump to 0.5.0
|
56
|
+
|
57
|
+
|
58
|
+
v0.5.0 / 2010-07-26
|
59
|
+
|
60
|
+
Version bump to 0.5.0 (Matthias Viehweger kronn@kronn.de)
|
61
|
+
|
62
|
+
Changes:
|
63
|
+
|
64
|
+
* 24 General Enhancements
|
65
|
+
|
66
|
+
* added tests for the bundled algorithms
|
67
|
+
* added converter "expand_below"
|
68
|
+
* added converter "reverse"
|
69
|
+
* added new converter ideas as empty tests
|
70
|
+
* refactored converters-test
|
71
|
+
* added a 'secure' algorithm which generate fairly secure passwords
|
72
|
+
* added remove_repetition converter
|
73
|
+
* moved downcase-test into converter-testcase
|
74
|
+
* pathnames in exception-messages should be readable
|
75
|
+
* added hint to password_of in manpage.
|
76
|
+
* finished to_pass-algorithm(5)
|
77
|
+
* make a different executable (`password_of`)
|
78
|
+
* make options dependent on the executable
|
79
|
+
* added "commands" to the wishlist...
|
80
|
+
* added draft for to_pass-algorithm(5)
|
81
|
+
* added to_pass-converter(5)
|
82
|
+
* add man index
|
83
|
+
* fix typos in to_pass(1)
|
84
|
+
* added Raketask to generate manpages
|
85
|
+
* added downcase converter
|
86
|
+
* added man page for to_pass(1)
|
87
|
+
* use the right binary name for the help output
|
88
|
+
* added some TODOs
|
89
|
+
* Version bump to 0.4.0
|
90
|
+
|
91
|
+
|
92
|
+
v0.4.0 / 2010-06-29
|
93
|
+
|
94
|
+
Version bump to 0.4.0 (Matthias Viehweger kronn@kronn.de)
|
95
|
+
|
96
|
+
Changes:
|
97
|
+
|
98
|
+
* 3 General Enhancements
|
99
|
+
|
100
|
+
* output available algorithms with `rake algorithms`
|
101
|
+
* output a list of available converter with `rake converters`
|
102
|
+
* Version bump to 0.3.0
|
103
|
+
|
104
|
+
|
105
|
+
v0.3.0 / 2010-06-29
|
106
|
+
|
107
|
+
Version bump to 0.3.0 (Matthias Viehweger kronn@kronn.de)
|
108
|
+
|
109
|
+
Changes:
|
110
|
+
|
111
|
+
* 18 General Enhancements
|
112
|
+
|
113
|
+
* reorganized converter to utilize the ConverterReader to find and load the conversions
|
114
|
+
* rename table to replace in algorithms
|
115
|
+
* rename StringConversions to Converters and moved individual algorithms into single files
|
116
|
+
* fix typo in documentation
|
117
|
+
* Tie ConverterReader into Converter
|
118
|
+
* add ConverterReader-class
|
119
|
+
* disable the inclusion of StringConversion-Module
|
120
|
+
* remove the current task from the "someday"-section
|
121
|
+
* extracted converters info their own classes
|
122
|
+
* improved pipe usage
|
123
|
+
* added manpage-help to TODO
|
124
|
+
* added Debian compatibility as as TODO
|
125
|
+
* move algorithms-directory into the to_pass-dir for portability
|
126
|
+
* extended TODO with some more ideas
|
127
|
+
* fixed the directory-name in the test_helper (thanks, CI)
|
128
|
+
* removed jeweler-specific code
|
129
|
+
* made sdoc optional
|
130
|
+
* Version bump to 0.2.4
|
131
|
+
|
132
|
+
|
133
|
+
v0.2.4 / 2010-06-24
|
134
|
+
|
135
|
+
Version bump to 0.2.4 (Matthias Viehweger kronn@kronn.de)
|
136
|
+
|
137
|
+
Changes:
|
138
|
+
|
139
|
+
* 3 General Enhancements
|
140
|
+
|
141
|
+
* moved CLI-interface into its own class (including some debugging along the way)
|
142
|
+
* added encoding-info to all ruby files
|
143
|
+
* Version bump to 0.2.3
|
144
|
+
|
145
|
+
|
146
|
+
v0.2.3 / 2010-06-14
|
147
|
+
|
148
|
+
Version bump to 0.2.3 (Matthias Viehweger kronn@kronn.de)
|
149
|
+
|
150
|
+
Changes:
|
151
|
+
|
152
|
+
* 2 General Enhancements
|
153
|
+
|
154
|
+
* tested integration with user-dir algorithms
|
155
|
+
* fixed directory lookup of user-dir
|
156
|
+
|
157
|
+
|
158
|
+
v0.2.2 / 2010-06-13
|
159
|
+
|
160
|
+
bumped version because of upcoming release (Matthias Viehweger kronn@kronn.de)
|
161
|
+
|
162
|
+
Changes:
|
163
|
+
|
164
|
+
* 18 General Enhancements
|
165
|
+
|
166
|
+
* renamed the library from to_pwd to to_pass
|
167
|
+
* moved string_conversion-tests into its own testcase.
|
168
|
+
* removed rcov-Tasks as it does not produce useful information
|
169
|
+
* readded TODO and some coded thoughts
|
170
|
+
* activated rcov in the Rakefile
|
171
|
+
* documented the code
|
172
|
+
* added APP_NAME constant
|
173
|
+
* added VERSION-constant
|
174
|
+
* deleted TODO as it's empty at the moment
|
175
|
+
* shortended tests
|
176
|
+
* made AlgorithmReader#load_from_file use the load_path
|
177
|
+
* removed unused tests
|
178
|
+
* added AlgorithmReader#load_path
|
179
|
+
* added an AlgorithmReader
|
180
|
+
* excluded packaged gems and documentation from project
|
181
|
+
* made dependency on sdoc explicit
|
182
|
+
* added documentation (sdoc) task and tweaked README
|
183
|
+
* Version bump to 0.2.1
|
184
|
+
|
185
|
+
|
186
|
+
v0.2.1 / 2010-06-03
|
187
|
+
|
188
|
+
Version bump to 0.2.1 (Matthias Viehweger kronn@kronn.de)
|
189
|
+
|
190
|
+
Changes:
|
191
|
+
|
192
|
+
* 1 Cleanup Enhancements
|
193
|
+
|
194
|
+
* redgreen is only needed and wanted for tests
|
195
|
+
|
196
|
+
* 1 General Enhancements
|
197
|
+
|
198
|
+
* Version bump to 0.2.0
|
199
|
+
|
200
|
+
|
201
|
+
v0.2.0 / 2010-05-30
|
202
|
+
|
203
|
+
Version bump to 0.2.0 (Matthias Viehweger kronn@kronn.de)
|
204
|
+
|
205
|
+
Changes:
|
206
|
+
|
207
|
+
* 2 Cleanup Enhancements
|
208
|
+
|
209
|
+
* deleted outdated version
|
210
|
+
* moved dependency-requirements into man lib-file
|
211
|
+
|
212
|
+
* 29 General Enhancements
|
213
|
+
|
214
|
+
* preparation for creating a gem from this library
|
215
|
+
* added Rakefile to run all tests
|
216
|
+
* added module for direct integration into existing objects.
|
217
|
+
* fixed usage with pipes
|
218
|
+
* some more integration tests and basic_en-algorithm
|
219
|
+
* baseclass and integration-test added
|
220
|
+
* refactoring
|
221
|
+
* testing if multiple rules are applied
|
222
|
+
* test extended to cover alternate scenario of case swapping
|
223
|
+
* comment out old implementation
|
224
|
+
* removed tests of methods which are neither needed nor used externally
|
225
|
+
* case swapping ignores numbers
|
226
|
+
* naming improved
|
227
|
+
* first module-definition added
|
228
|
+
* test and implementation for string converter added
|
229
|
+
* refactored executable towards OptionParser usage
|
230
|
+
* renamed lib-file
|
231
|
+
* added draft for algorithm spec
|
232
|
+
* changed indentation from tabs to spaces
|
233
|
+
* added TODO
|
234
|
+
* basic executable added and gitignore added for algorithms
|
235
|
+
* PasswordString contains a String, its not really a String
|
236
|
+
* Datei in richtiges Verzeichnis geschoben
|
237
|
+
* README updated
|
238
|
+
* Fileformat set to unix
|
239
|
+
* Moved Password in its own class
|
240
|
+
* Zeilenenden korrigiert
|
241
|
+
* README added
|
242
|
+
* Initial commit
|
243
|
+
|
244
|
+
|
245
|
+
HEAD / 2010-09-03
|
246
|
+
|
247
|
+
Version 0.7.0 is mostly a cleanup and compatibility release.
|
248
|
+
|
249
|
+
ToPass now runs seamlessly with Ruby 1.8.7, 1.9.2, REE 2010-02. Rubinius works
|
250
|
+
mostly, but has some issues.
|
251
|
+
|
252
|
+
The Metainformation like version, summary, description and the likes are now
|
253
|
+
all in the version.rb-file. This way, they can be queried easier.
|
254
|
+
|
255
|
+
The test can now be run through the test/all.rb-script. In fact, this is the
|
256
|
+
standard way and internally used by `rake test`. The Manpages are now in the
|
257
|
+
right location for setup.rb and RDocs now include the LICENSE and this
|
258
|
+
CHANGELOG.
|
259
|
+
|
260
|
+
The gemspec has the filelist now directly from git instead from the
|
261
|
+
filesystem.
|
data/{LICENSE → doc/LICENSE}
RENAMED
File without changes
|
data/lib/to_pass.rb
CHANGED
@@ -1,21 +1,25 @@
|
|
1
|
-
#
|
1
|
+
# vim:ft=ruby:fileencoding=utf-8
|
2
|
+
|
3
|
+
# setup the LoadPath
|
4
|
+
lib_path = File.expand_path('../', __FILE__)
|
5
|
+
if File.exist?(lib_path)
|
6
|
+
$LOAD_PATH << lib_path unless $LOAD_PATH.include?(lib_path)
|
7
|
+
end
|
2
8
|
|
3
9
|
# Library to convert a String into a Password
|
4
10
|
#
|
5
11
|
# see README.rdoc for details
|
6
12
|
module ToPass
|
7
|
-
autoload :VERSION, '
|
8
|
-
autoload :DATE, '
|
9
|
-
autoload :APP_NAME, '
|
13
|
+
autoload :VERSION, 'to_pass/version'
|
14
|
+
autoload :DATE, 'to_pass/version'
|
15
|
+
autoload :APP_NAME, 'to_pass/version'
|
10
16
|
|
11
|
-
autoload :AlgorithmReader, '
|
12
|
-
autoload :Base, '
|
13
|
-
autoload :Cli, '
|
14
|
-
autoload :Converter, '
|
15
|
-
autoload :ConverterReader, '
|
16
|
-
autoload :Converters, '
|
17
|
-
autoload :Directories, '
|
18
|
-
autoload :Integration, '
|
17
|
+
autoload :AlgorithmReader, 'to_pass/algorithm_reader'
|
18
|
+
autoload :Base, 'to_pass/base'
|
19
|
+
autoload :Cli, 'to_pass/cli.rb'
|
20
|
+
autoload :Converter, 'to_pass/converter'
|
21
|
+
autoload :ConverterReader, 'to_pass/converter_reader'
|
22
|
+
autoload :Converters, 'to_pass/converters'
|
23
|
+
autoload :Directories, 'to_pass/directories'
|
24
|
+
autoload :Integration, 'to_pass/integration'
|
19
25
|
end
|
20
|
-
|
21
|
-
# vim:ft=ruby:enc=utf-8
|
data/lib/to_pass/base.rb
CHANGED
data/lib/to_pass/cli.rb
CHANGED
@@ -1,5 +1,4 @@
|
|
1
|
-
#
|
2
|
-
# vim:ft=ruby:enc=utf-8
|
1
|
+
# vim:ft=ruby:fileencoding=utf-8
|
3
2
|
|
4
3
|
require 'optparse'
|
5
4
|
|
@@ -46,7 +45,7 @@ module ToPass
|
|
46
45
|
}.merge(options)
|
47
46
|
|
48
47
|
OptionParser.new do |opts|
|
49
|
-
opts.banner = "Usage: #{$0} [options] passphrase"
|
48
|
+
opts.banner = "Usage: #{File.basename($0)} [options] passphrase"
|
50
49
|
opts.separator ""
|
51
50
|
|
52
51
|
opts.on('-a', '--algorithm ALGORITM', "use specified algorithm for transformation") do |value|
|
data/lib/to_pass/converter.rb
CHANGED
@@ -1,5 +1,4 @@
|
|
1
|
-
#
|
2
|
-
# vim:ft=ruby:enc=utf-8
|
1
|
+
# vim:ft=ruby:fileencoding=utf-8
|
3
2
|
|
4
3
|
module ToPass # :nodoc:
|
5
4
|
# converts a given string into a password-like word
|
@@ -70,7 +69,11 @@ module ToPass # :nodoc:
|
|
70
69
|
|
71
70
|
# apply a single rule to the password-to-be
|
72
71
|
def apply_rule(pwd, rule)
|
73
|
-
cmd, args = rule.to_a
|
72
|
+
cmd, args = if rule.respond_to?(:to_a)
|
73
|
+
rule.to_a.flatten
|
74
|
+
else
|
75
|
+
[ rule, nil ]
|
76
|
+
end
|
74
77
|
m = @reader.load(cmd.to_sym).method(cmd.to_sym)
|
75
78
|
|
76
79
|
case m.arity
|
data/lib/to_pass/converters.rb
CHANGED
data/lib/to_pass/directories.rb
CHANGED
@@ -1,5 +1,4 @@
|
|
1
|
-
#
|
2
|
-
# vim:ft=ruby:enc=utf-8
|
1
|
+
# vim:ft=ruby:fileencoding=utf-8
|
3
2
|
|
4
3
|
require 'rbconfig'
|
5
4
|
|
@@ -22,7 +21,7 @@ module ToPass
|
|
22
21
|
|
23
22
|
private
|
24
23
|
|
25
|
-
# list of all
|
24
|
+
# list of all directories used by this project
|
26
25
|
def all
|
27
26
|
{
|
28
27
|
:user => "~/.#{APP_NAME}",
|
data/lib/to_pass/integration.rb
CHANGED
data/lib/to_pass/version.rb
CHANGED
@@ -1,13 +1,34 @@
|
|
1
|
-
#
|
2
|
-
# vim:ft=ruby:enc=utf-8
|
1
|
+
# vim:ft=ruby:fileencoding=utf-8
|
3
2
|
|
4
|
-
|
5
|
-
|
6
|
-
|
3
|
+
unless defined?(ToPass::VERSION)
|
4
|
+
module ToPass
|
5
|
+
# version of gem
|
6
|
+
VERSION = '0.7.0'
|
7
7
|
|
8
|
-
|
9
|
-
|
8
|
+
# name of gem
|
9
|
+
APP_NAME = 'to_pass'
|
10
10
|
|
11
|
-
|
12
|
-
|
11
|
+
# date of last modification of the version
|
12
|
+
DATE = File.mtime(__FILE__)
|
13
|
+
|
14
|
+
# Purpose in one sentence
|
15
|
+
SUMMARY = 'generate password from words or sentences'
|
16
|
+
|
17
|
+
# short description, see README for details
|
18
|
+
DESCRIPTION = <<-EOD
|
19
|
+
Passwords should be easy to remember and hard to guess.
|
20
|
+
One technique is to have a sentence which can be easily remembered transformed to a password.
|
21
|
+
|
22
|
+
Pluggable algorithms and converters allow customization of the transformation process.
|
23
|
+
EOD
|
24
|
+
|
25
|
+
# list of file which should be included in rdoc
|
26
|
+
EXTRA_RDOC_FILES = ['doc/CHANGELOG', 'doc/LICENSE', 'README.rdoc', 'TODO']
|
27
|
+
|
28
|
+
# easy access to the RELEASE_NOTES
|
29
|
+
RELEASE_NOTES = begin
|
30
|
+
fn = File.expand_path('../../../doc/RELEASE_NOTES', __FILE__)
|
31
|
+
File.read(fn) if File.size?(fn)
|
32
|
+
end
|
33
|
+
end
|
13
34
|
end
|
data/man/index.txt
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
# manuals included in this project
|
2
|
-
to_pass(1) to_pass.1.ronn
|
3
|
-
to_pass-converter(5) to_pass-converter.5.ronn
|
4
|
-
to_pass-algorithm(5) to_pass-algorithm.5.ronn
|
2
|
+
to_pass(1) ../man1/to_pass.1.ronn
|
3
|
+
to_pass-converter(5) ../man5/to_pass-converter.5.ronn
|
4
|
+
to_pass-algorithm(5) ../man5/to_pass-algorithm.5.ronn
|
5
5
|
|
6
6
|
# external documentation
|
7
7
|
yaml(3pm) http://man.cx/yaml(3pm)
|
data/man/man1/to_pass.1.html
CHANGED
@@ -98,7 +98,7 @@ a list of conversion steps.</p>
|
|
98
98
|
User supplied Algorithms are searched in <code>~/.to_pass/algorithms/</code>, converter
|
99
99
|
classes are searched in <code>~/.to_pass/converters/</code>.</p>
|
100
100
|
|
101
|
-
<p><a href="to_pass-algorithm.5.html" class="man-ref">to_pass-algorithm<span class="s">(5)</span></a> files are written in <a href="http://man.cx/yaml(3pm)" class="man-ref">yaml<span class="s">(3pm)</span></a>, <a href="to_pass-converter.5.html" class="man-ref">to_pass-converter<span class="s">(5)</span></a> classes are
|
101
|
+
<p><a href="../man5/to_pass-algorithm.5.html" class="man-ref">to_pass-algorithm<span class="s">(5)</span></a> files are written in <a href="http://man.cx/yaml(3pm)" class="man-ref">yaml<span class="s">(3pm)</span></a>, <a href="../man5/to_pass-converter.5.html" class="man-ref">to_pass-converter<span class="s">(5)</span></a> classes are
|
102
102
|
<a href="http://man.cx/ruby(1)" class="man-ref">ruby<span class="s">(1)</span></a> classes.</p>
|
103
103
|
|
104
104
|
<h2 id="FILES">FILES</h2>
|
@@ -110,7 +110,7 @@ load them. Search locations are the user-directory ~/.to_pass/algorithm/ and
|
|
110
110
|
the bundled algorithms. The file is expected to have a ".yml"-extension</p>
|
111
111
|
|
112
112
|
<p>Converters should be named like the method they provide. Details about the
|
113
|
-
expected class can be found in <a href="to_pass-converter.5.html" class="man-ref">to_pass-converter<span class="s">(5)</span></a>.</p>
|
113
|
+
expected class can be found in <a href="../man5/to_pass-converter.5.html" class="man-ref">to_pass-converter<span class="s">(5)</span></a>.</p>
|
114
114
|
|
115
115
|
<h2 id="OPTIONS">OPTIONS</h2>
|
116
116
|
|
@@ -146,7 +146,7 @@ ti1pwtsi2ltti@pf
|
|
146
146
|
|
147
147
|
<h2 id="SEE-ALSO">SEE ALSO</h2>
|
148
148
|
|
149
|
-
<p><a href="to_pass-converter.5.html" class="man-ref">to_pass-converter<span class="s">(5)</span></a>, <a href="to_pass-algorithm.5.html" class="man-ref">to_pass-algorithm<span class="s">(5)</span></a></p>
|
149
|
+
<p><a href="../man5/to_pass-converter.5.html" class="man-ref">to_pass-converter<span class="s">(5)</span></a>, <a href="../man5/to_pass-algorithm.5.html" class="man-ref">to_pass-algorithm<span class="s">(5)</span></a></p>
|
150
150
|
|
151
151
|
|
152
152
|
<ol class='man-decor man-foot man foot'>
|
@@ -75,7 +75,7 @@
|
|
75
75
|
|
76
76
|
<h2 id="NAME">NAME</h2>
|
77
77
|
<p class="man-name">
|
78
|
-
<code>to_pass-algorithm</code> - <span class="man-whatis">algorithm-description for <a href="to_pass.1.html" class="man-ref">to_pass<span class="s">(1)</span></a></span>
|
78
|
+
<code>to_pass-algorithm</code> - <span class="man-whatis">algorithm-description for <a href="../man1/to_pass.1.html" class="man-ref">to_pass<span class="s">(1)</span></a></span>
|
79
79
|
</p>
|
80
80
|
|
81
81
|
<h2 id="DESCRIPTION">DESCRIPTION</h2>
|
@@ -171,7 +171,7 @@ design however is intentionally simple and constrained.</p>
|
|
171
171
|
|
172
172
|
<h2 id="SEE-ALSO">SEE ALSO</h2>
|
173
173
|
|
174
|
-
<p><a href="to_pass.1.html" class="man-ref">to_pass<span class="s">(1)</span></a>, <a href="to_pass-converter.5.html" class="man-ref">to_pass-converter<span class="s">(5)</span></a>, <a href="http://man.cx/yaml(3pm)" class="man-ref">yaml<span class="s">(3pm)</span></a></p>
|
174
|
+
<p><a href="../man1/to_pass.1.html" class="man-ref">to_pass<span class="s">(1)</span></a>, <a href="../man5/to_pass-converter.5.html" class="man-ref">to_pass-converter<span class="s">(5)</span></a>, <a href="http://man.cx/yaml(3pm)" class="man-ref">yaml<span class="s">(3pm)</span></a></p>
|
175
175
|
|
176
176
|
|
177
177
|
<ol class='man-decor man-foot man foot'>
|
@@ -75,7 +75,7 @@
|
|
75
75
|
|
76
76
|
<h2 id="NAME">NAME</h2>
|
77
77
|
<p class="man-name">
|
78
|
-
<code>to_pass-converter</code> - <span class="man-whatis">converter-class for <a href="to_pass.1.html" class="man-ref">to_pass<span class="s">(1)</span></a></span>
|
78
|
+
<code>to_pass-converter</code> - <span class="man-whatis">converter-class for <a href="../man1/to_pass.1.html" class="man-ref">to_pass<span class="s">(1)</span></a></span>
|
79
79
|
</p>
|
80
80
|
|
81
81
|
<h2 id="DESCRIPTION">DESCRIPTION</h2>
|
@@ -150,7 +150,7 @@ end
|
|
150
150
|
|
151
151
|
<h2 id="SEE-ALSO">SEE ALSO</h2>
|
152
152
|
|
153
|
-
<p><a href="to_pass.1.html" class="man-ref">to_pass<span class="s">(1)</span></a>, <a href="to_pass-algorithm.5.html" class="man-ref">to_pass-algorithm<span class="s">(5)</span></a>, <a href="http://man.cx/ruby(1)" class="man-ref">ruby<span class="s">(1)</span></a></p>
|
153
|
+
<p><a href="../man1/to_pass.1.html" class="man-ref">to_pass<span class="s">(1)</span></a>, <a href="../man5/to_pass-algorithm.5.html" class="man-ref">to_pass-algorithm<span class="s">(5)</span></a>, <a href="http://man.cx/ruby(1)" class="man-ref">ruby<span class="s">(1)</span></a></p>
|
154
154
|
|
155
155
|
|
156
156
|
<ol class='man-decor man-foot man foot'>
|
data/test/all.rb
ADDED
@@ -1,17 +1,18 @@
|
|
1
|
-
#
|
2
|
-
# vim:ft=ruby:enc=utf-8
|
1
|
+
# vim:ft=ruby:fileencoding=utf-8
|
3
2
|
|
4
|
-
module ToPass
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
3
|
+
module ToPass
|
4
|
+
module Converters
|
5
|
+
# replace the string "USER" with the current username
|
6
|
+
class Userize
|
7
|
+
def self.convert(string) # :nodoc:
|
8
|
+
username = if `which whoami`
|
9
|
+
`whoami`.chomp
|
10
|
+
else
|
11
|
+
"thecurrentuser"
|
12
|
+
end
|
13
13
|
|
14
|
-
|
14
|
+
string.gsub("USER",username)
|
15
|
+
end
|
15
16
|
end
|
16
17
|
end
|
17
18
|
end
|
data/test/helper.rb
CHANGED
@@ -1,14 +1,24 @@
|
|
1
|
-
#
|
2
|
-
# vim:ft=ruby:enc=utf-8
|
1
|
+
# vim:ft=ruby:fileencoding=utf-8
|
3
2
|
|
4
|
-
require 'test/unit
|
5
|
-
require 'test/unit' unless defined?(Test::Unit)
|
3
|
+
require 'test/unit'
|
6
4
|
require 'mocha'
|
7
5
|
require 'rbconfig'
|
8
6
|
|
9
|
-
|
10
|
-
|
11
|
-
|
7
|
+
# optional libraries
|
8
|
+
begin
|
9
|
+
require 'redgreen'
|
10
|
+
rescue LoadError
|
11
|
+
end
|
12
|
+
|
13
|
+
begin
|
14
|
+
require 'test_benchmark' if ENV['BENCHMARK']
|
15
|
+
rescue LoadError
|
16
|
+
end
|
17
|
+
|
18
|
+
# setup the LoadPath
|
19
|
+
lib_path = File.expand_path('../../lib', __FILE__)
|
20
|
+
if File.exist?(lib_path)
|
21
|
+
$LOAD_PATH << lib_path unless $LOAD_PATH.include?(lib_path)
|
12
22
|
end
|
13
23
|
|
14
24
|
Test::Unit::TestCase.class_eval do
|
@@ -49,4 +59,4 @@ Test::Unit::TestCase.class_eval do
|
|
49
59
|
end
|
50
60
|
end
|
51
61
|
|
52
|
-
require '
|
62
|
+
require 'to_pass'
|
@@ -1,7 +1,6 @@
|
|
1
|
-
#
|
2
|
-
# vim:ft=ruby:enc=utf-8
|
1
|
+
# vim:ft=ruby:fileencoding=utf-8
|
3
2
|
|
4
|
-
require File.
|
3
|
+
require File.expand_path('../helper', __FILE__)
|
5
4
|
|
6
5
|
class TestAlgorithmReader < Test::Unit::TestCase
|
7
6
|
test_presence ToPass::AlgorithmReader
|
data/test/test_algorithms.rb
CHANGED
data/test/test_base.rb
CHANGED
@@ -1,7 +1,6 @@
|
|
1
|
-
#
|
2
|
-
# vim:ft=ruby:enc=utf-8
|
1
|
+
# vim:ft=ruby:fileencoding=utf-8
|
3
2
|
|
4
|
-
require File.
|
3
|
+
require File.expand_path('../helper', __FILE__)
|
5
4
|
|
6
5
|
class TestBase < Test::Unit::TestCase
|
7
6
|
test_presence ToPass::Base
|
@@ -14,11 +13,11 @@ class TestBase < Test::Unit::TestCase
|
|
14
13
|
end
|
15
14
|
|
16
15
|
def test_version
|
17
|
-
|
16
|
+
assert_match /\d+.\d+.\d+/, ToPass::VERSION
|
18
17
|
end
|
19
18
|
|
20
19
|
def test_date
|
21
|
-
assert_equal Pathname.new("#{File.dirname(__FILE__)}/../
|
20
|
+
assert_equal Pathname.new("#{File.dirname(__FILE__)}/../lib/to_pass/version.rb").expand_path.mtime, ToPass::DATE
|
22
21
|
end
|
23
22
|
|
24
23
|
def test_appname
|
@@ -44,4 +43,14 @@ class TestBase < Test::Unit::TestCase
|
|
44
43
|
|
45
44
|
assert_equal [ dirs[:user], dirs[:data], dirs[:source_data] ], dirs[:standard]
|
46
45
|
end
|
46
|
+
|
47
|
+
def test_release_notes
|
48
|
+
fn = File.expand_path('../../doc/RELEASE_NOTES', __FILE__)
|
49
|
+
|
50
|
+
if File.size?(fn)
|
51
|
+
assert_equal File.read(fn), ToPass::RELEASE_NOTES
|
52
|
+
else
|
53
|
+
assert_nil ToPass::RELEASE_NOTES
|
54
|
+
end
|
55
|
+
end
|
47
56
|
end
|
data/test/test_cli.rb
CHANGED
data/test/test_converter.rb
CHANGED
@@ -1,7 +1,6 @@
|
|
1
|
-
#
|
2
|
-
# vim:ft=ruby:enc=utf-8
|
1
|
+
# vim:ft=ruby:fileencoding=utf-8
|
3
2
|
|
4
|
-
require File.
|
3
|
+
require File.expand_path('../helper', __FILE__)
|
5
4
|
|
6
5
|
class TestConverterReader < Test::Unit::TestCase
|
7
6
|
test_presence ToPass::ConverterReader
|
data/test/test_converters.rb
CHANGED
@@ -1,7 +1,6 @@
|
|
1
|
-
#
|
2
|
-
# vim:ft=ruby:enc=utf-8
|
1
|
+
# vim:ft=ruby:fileencoding=utf-8
|
3
2
|
|
4
|
-
require File.
|
3
|
+
require File.expand_path('../helper', __FILE__)
|
5
4
|
|
6
5
|
class TestConverters < Test::Unit::TestCase
|
7
6
|
def test_presence
|
@@ -21,7 +20,6 @@ class TestConverters < Test::Unit::TestCase
|
|
21
20
|
def test_expand_below
|
22
21
|
assert_converter 'kFsNotestKrb87d', { 'expand_below' => 5 }, 'test'
|
23
22
|
assert_converter 'testtest', { 'expand_below' => 5 }, 'testtest'
|
24
|
-
|
25
23
|
end
|
26
24
|
|
27
25
|
def test_reverse
|
data/test/test_integration.rb
CHANGED
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: 3
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
|
-
-
|
8
|
+
- 7
|
9
9
|
- 0
|
10
|
-
version: 0.
|
10
|
+
version: 0.7.0
|
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-10-13 00:00:00 +02:00
|
19
19
|
default_executable:
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|
@@ -47,7 +47,7 @@ dependencies:
|
|
47
47
|
type: :development
|
48
48
|
version_requirements: *id002
|
49
49
|
- !ruby/object:Gem::Dependency
|
50
|
-
name:
|
50
|
+
name: sdoc
|
51
51
|
prerelease: false
|
52
52
|
requirement: &id003 !ruby/object:Gem::Requirement
|
53
53
|
none: false
|
@@ -60,20 +60,6 @@ dependencies:
|
|
60
60
|
version: "0"
|
61
61
|
type: :development
|
62
62
|
version_requirements: *id003
|
63
|
-
- !ruby/object:Gem::Dependency
|
64
|
-
name: sdoc
|
65
|
-
prerelease: false
|
66
|
-
requirement: &id004 !ruby/object:Gem::Requirement
|
67
|
-
none: false
|
68
|
-
requirements:
|
69
|
-
- - ">="
|
70
|
-
- !ruby/object:Gem::Version
|
71
|
-
hash: 3
|
72
|
-
segments:
|
73
|
-
- 0
|
74
|
-
version: "0"
|
75
|
-
type: :development
|
76
|
-
version_requirements: *id004
|
77
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"
|
78
64
|
email: kronn@kronn.de
|
79
65
|
executables:
|
@@ -82,27 +68,13 @@ executables:
|
|
82
68
|
extensions: []
|
83
69
|
|
84
70
|
extra_rdoc_files:
|
71
|
+
- doc/CHANGELOG
|
72
|
+
- doc/LICENSE
|
85
73
|
- README.rdoc
|
86
74
|
- TODO
|
87
75
|
files:
|
88
|
-
- LICENSE
|
89
|
-
- README.rdoc
|
90
|
-
- TODO
|
91
|
-
- VERSION
|
92
|
-
- Rakefile
|
93
|
-
- Gemfile
|
94
76
|
- bin/password_of
|
95
77
|
- bin/to_pass
|
96
|
-
- lib/to_pass/algorithm_reader.rb
|
97
|
-
- lib/to_pass/base.rb
|
98
|
-
- lib/to_pass/cli.rb
|
99
|
-
- lib/to_pass/converter.rb
|
100
|
-
- lib/to_pass/converter_reader.rb
|
101
|
-
- lib/to_pass/converters.rb
|
102
|
-
- lib/to_pass/directories.rb
|
103
|
-
- lib/to_pass/integration.rb
|
104
|
-
- lib/to_pass/version.rb
|
105
|
-
- lib/to_pass.rb
|
106
78
|
- data/to_pass/algorithms/basic_de.yml
|
107
79
|
- data/to_pass/algorithms/basic_en.yml
|
108
80
|
- data/to_pass/algorithms/secure.yml
|
@@ -114,6 +86,18 @@ files:
|
|
114
86
|
- data/to_pass/converters/replace.rb
|
115
87
|
- data/to_pass/converters/reverse.rb
|
116
88
|
- data/to_pass/converters/swapcase.rb
|
89
|
+
- doc/CHANGELOG
|
90
|
+
- doc/LICENSE
|
91
|
+
- lib/to_pass.rb
|
92
|
+
- lib/to_pass/algorithm_reader.rb
|
93
|
+
- lib/to_pass/base.rb
|
94
|
+
- lib/to_pass/cli.rb
|
95
|
+
- lib/to_pass/converter.rb
|
96
|
+
- lib/to_pass/converter_reader.rb
|
97
|
+
- lib/to_pass/converters.rb
|
98
|
+
- lib/to_pass/directories.rb
|
99
|
+
- lib/to_pass/integration.rb
|
100
|
+
- lib/to_pass/version.rb
|
117
101
|
- man/index.txt
|
118
102
|
- man/man1/to_pass.1
|
119
103
|
- man/man1/to_pass.1.html
|
@@ -124,6 +108,7 @@ files:
|
|
124
108
|
- man/to_pass-algorithm.5.ronn
|
125
109
|
- man/to_pass-converter.5.ronn
|
126
110
|
- man/to_pass.1.ronn
|
111
|
+
- test/all.rb
|
127
112
|
- test/fixtures/user_alg.yml
|
128
113
|
- test/fixtures/user_converter.rb
|
129
114
|
- test/helper.rb
|
@@ -135,6 +120,8 @@ files:
|
|
135
120
|
- test/test_converter_reader.rb
|
136
121
|
- test/test_converters.rb
|
137
122
|
- test/test_integration.rb
|
123
|
+
- README.rdoc
|
124
|
+
- TODO
|
138
125
|
has_rdoc: true
|
139
126
|
homepage: http://github.com/kronn/to_pass
|
140
127
|
licenses: []
|
@@ -173,6 +160,7 @@ signing_key:
|
|
173
160
|
specification_version: 3
|
174
161
|
summary: generate password from words or sentences
|
175
162
|
test_files:
|
163
|
+
- test/all.rb
|
176
164
|
- test/fixtures/user_alg.yml
|
177
165
|
- test/fixtures/user_converter.rb
|
178
166
|
- test/helper.rb
|
data/Gemfile
DELETED
data/Rakefile
DELETED
@@ -1,82 +0,0 @@
|
|
1
|
-
# -*- coding: utf-8 -*-
|
2
|
-
# vim:ft=ruby:enc=utf-8
|
3
|
-
|
4
|
-
# # enable trace to get better error output
|
5
|
-
# Rake.application.options.trace = true
|
6
|
-
|
7
|
-
# documentation tasks
|
8
|
-
begin
|
9
|
-
%w[ rake/rdoctask sdoc ].each { |lib| require lib }
|
10
|
-
Rake::RDocTask.new do |rdoc|
|
11
|
-
version = File.exist?('VERSION') ? File.read('VERSION') : ""
|
12
|
-
|
13
|
-
rdoc.rdoc_dir = 'doc/rdoc'
|
14
|
-
rdoc.title = "to_pass #{version}"
|
15
|
-
rdoc.options << '--fmt=shtml'
|
16
|
-
rdoc.options << '--all'
|
17
|
-
rdoc.options << '--charset=utf-8'
|
18
|
-
rdoc.template = 'direct'
|
19
|
-
rdoc.rdoc_files.include('README*')
|
20
|
-
# rdoc.rdoc_files.include('LICENSE')
|
21
|
-
rdoc.rdoc_files.include('TODO')
|
22
|
-
rdoc.rdoc_files.include('lib/**/*.rb')
|
23
|
-
rdoc.rdoc_files.include('data/**/*.rb')
|
24
|
-
end
|
25
|
-
rescue LoadError
|
26
|
-
end
|
27
|
-
begin
|
28
|
-
desc 'generate manpages for project'
|
29
|
-
task :man do
|
30
|
-
[1,5].each do |section|
|
31
|
-
files = Dir["./man/*#{section}.ronn"]
|
32
|
-
`ronn --html --roff --style=toc #{files.join(' ')}`
|
33
|
-
FileUtils.mkdir "./man/man#{section}/"
|
34
|
-
FileUtils.mv Dir["./man/*.#{section}.html"], "./man/man#{section}/"
|
35
|
-
FileUtils.mv Dir["./man/*.#{section}"], "./man/man#{section}/"
|
36
|
-
end
|
37
|
-
end
|
38
|
-
end
|
39
|
-
|
40
|
-
desc "run tests"
|
41
|
-
task :test do
|
42
|
-
# optional libraries
|
43
|
-
%w[ redgreen ].each do |lib|
|
44
|
-
begin
|
45
|
-
require lib
|
46
|
-
rescue LoadError
|
47
|
-
end
|
48
|
-
end
|
49
|
-
( ['test/unit', 'test/helper'] + Dir['test/test_*.rb'] ).each do |file|
|
50
|
-
require file
|
51
|
-
end
|
52
|
-
end
|
53
|
-
|
54
|
-
desc "list available algorithms"
|
55
|
-
task :algorithms, :needs => [:to_pass] do
|
56
|
-
puts ""
|
57
|
-
puts " available password algorithms"
|
58
|
-
puts " ============================================"
|
59
|
-
ToPass::AlgorithmReader.discover.each do |algorithm|
|
60
|
-
puts " - #{algorithm}"
|
61
|
-
end
|
62
|
-
puts " ============================================"
|
63
|
-
puts ""
|
64
|
-
end
|
65
|
-
|
66
|
-
desc "list available converters"
|
67
|
-
task :converters, :needs => [:to_pass] do
|
68
|
-
puts ""
|
69
|
-
puts " available converters for password algorithms"
|
70
|
-
puts " ============================================"
|
71
|
-
ToPass::ConverterReader.new.discover.each do |converter|
|
72
|
-
puts " - #{converter}"
|
73
|
-
end
|
74
|
-
puts " ============================================"
|
75
|
-
puts ""
|
76
|
-
end
|
77
|
-
|
78
|
-
task :to_pass do
|
79
|
-
require 'lib/to_pass'
|
80
|
-
end
|
81
|
-
|
82
|
-
task :default => :test
|
data/VERSION
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
0.6.0
|