jameswilding-secret 2.1.0 → 2.1.2
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/lib/secret.rb +1 -1
- data/lib/secret/memorable.rb +8 -3
- metadata +2 -2
data/lib/secret.rb
CHANGED
data/lib/secret/memorable.rb
CHANGED
@@ -25,7 +25,7 @@ module Secret
|
|
25
25
|
end
|
26
26
|
|
27
27
|
def random_symbols_and_numbers
|
28
|
-
SYMBOLS[rand(SYMBOLS.length)]
|
28
|
+
random_numbers + SYMBOLS[rand(SYMBOLS.length)]
|
29
29
|
end
|
30
30
|
|
31
31
|
def random_numbers
|
@@ -36,7 +36,8 @@ module Secret
|
|
36
36
|
# Inspired by http://stephencelis.com/2009/03/29/whats-the-password-haddock.html
|
37
37
|
class Dictionary
|
38
38
|
|
39
|
-
PATHS
|
39
|
+
PATHS = %w(/usr/share/dict/words /usr/share/words)
|
40
|
+
FALLBACK = File.dirname(__FILE__) + '/words.txt'
|
40
41
|
|
41
42
|
def random
|
42
43
|
words = get_words
|
@@ -46,7 +47,11 @@ module Secret
|
|
46
47
|
def get_words
|
47
48
|
File.readlines(PATHS.first).select { |word| word.length < 6 }
|
48
49
|
rescue Errno::ENOENT
|
49
|
-
|
50
|
+
begin
|
51
|
+
File.readlines(PATHS.last).select { |word| word.length < 6 }
|
52
|
+
rescue Errno::ENOENT
|
53
|
+
File.readlines(FALLBACK)
|
54
|
+
end
|
50
55
|
end
|
51
56
|
|
52
57
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jameswilding-secret
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.1.
|
4
|
+
version: 2.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- James Wilding
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2009-06-
|
12
|
+
date: 2009-06-26 00:00:00 -07:00
|
13
13
|
default_executable:
|
14
14
|
dependencies: []
|
15
15
|
|