oldskool-password 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/oldskool/password_handler.rb +22 -0
- data/lib/oldskool-password.rb +1 -0
- data/views/password.erb +8 -0
- metadata +82 -0
@@ -0,0 +1,22 @@
|
|
1
|
+
require 'passmakr'
|
2
|
+
|
3
|
+
module Oldskool
|
4
|
+
class PasswordHandler
|
5
|
+
include Utils
|
6
|
+
|
7
|
+
def initialize(params, keyword, config)
|
8
|
+
@params = params
|
9
|
+
@keyword = keyword
|
10
|
+
@config = config
|
11
|
+
self
|
12
|
+
end
|
13
|
+
|
14
|
+
def handle_request(keyword, query)
|
15
|
+
len = Integer(query) rescue 8
|
16
|
+
|
17
|
+
pw = Passmakr.new(:phonemic, len)
|
18
|
+
|
19
|
+
{:template => plugin_template(:password, __FILE__), :pw => pw}
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
@@ -0,0 +1 @@
|
|
1
|
+
require 'oldskool/password_handler'
|
data/views/password.erb
ADDED
@@ -0,0 +1,8 @@
|
|
1
|
+
<% unless @error %>
|
2
|
+
<table>
|
3
|
+
<tr><td><strong>Password:</strong></td><td><%= @result[:pw].password[:string] %></td></tr>
|
4
|
+
<tr><td><strong>Crypt:</strong></td><td><%= @result[:pw].password[:crypt] %></td></tr>
|
5
|
+
<tr><td><strong>MD5:</strong></td><td><%= @result[:pw].password[:md5] %></td></tr>
|
6
|
+
<tr><td><strong>Nato:</strong></td><td><%= @result[:pw].password[:nato] %></td></tr>
|
7
|
+
</table>
|
8
|
+
<% end %>
|
metadata
ADDED
@@ -0,0 +1,82 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: oldskool-password
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
hash: 29
|
5
|
+
prerelease: false
|
6
|
+
segments:
|
7
|
+
- 0
|
8
|
+
- 0
|
9
|
+
- 1
|
10
|
+
version: 0.0.1
|
11
|
+
platform: ruby
|
12
|
+
authors:
|
13
|
+
- R.I.Pienaar
|
14
|
+
autorequire:
|
15
|
+
bindir: bin
|
16
|
+
cert_chain: []
|
17
|
+
|
18
|
+
date: 2012-01-14 00:00:00 +00:00
|
19
|
+
default_executable:
|
20
|
+
dependencies:
|
21
|
+
- !ruby/object:Gem::Dependency
|
22
|
+
name: passmakr
|
23
|
+
prerelease: false
|
24
|
+
requirement: &id001 !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
26
|
+
requirements:
|
27
|
+
- - ">="
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
hash: 3
|
30
|
+
segments:
|
31
|
+
- 0
|
32
|
+
version: "0"
|
33
|
+
type: :runtime
|
34
|
+
version_requirements: *id001
|
35
|
+
description: "description: Generate random passwords in Oldskool using the passmakr gem"
|
36
|
+
email: rip@devco.net
|
37
|
+
executables: []
|
38
|
+
|
39
|
+
extensions: []
|
40
|
+
|
41
|
+
extra_rdoc_files: []
|
42
|
+
|
43
|
+
files:
|
44
|
+
- lib/oldskool-password.rb
|
45
|
+
- lib/oldskool/password_handler.rb
|
46
|
+
- views/password.erb
|
47
|
+
has_rdoc: true
|
48
|
+
homepage: http://devco.net/
|
49
|
+
licenses: []
|
50
|
+
|
51
|
+
post_install_message:
|
52
|
+
rdoc_options: []
|
53
|
+
|
54
|
+
require_paths:
|
55
|
+
- lib
|
56
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
57
|
+
none: false
|
58
|
+
requirements:
|
59
|
+
- - ">="
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
hash: 3
|
62
|
+
segments:
|
63
|
+
- 0
|
64
|
+
version: "0"
|
65
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
66
|
+
none: false
|
67
|
+
requirements:
|
68
|
+
- - ">="
|
69
|
+
- !ruby/object:Gem::Version
|
70
|
+
hash: 3
|
71
|
+
segments:
|
72
|
+
- 0
|
73
|
+
version: "0"
|
74
|
+
requirements: []
|
75
|
+
|
76
|
+
rubyforge_project:
|
77
|
+
rubygems_version: 1.3.7
|
78
|
+
signing_key:
|
79
|
+
specification_version: 3
|
80
|
+
summary: oldskool-password
|
81
|
+
test_files: []
|
82
|
+
|