funny_yubikey_generator 0.3.0 → 0.4.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.
- checksums.yaml +4 -4
- data/Gemfile +1 -1
- data/Gemfile.lock +1 -1
- data/README.md +3 -3
- data/exe/generate_funny_yubikey +1 -1
- data/funny_yubikey_generator.gemspec +3 -5
- data/lib/funny_yubikey_generator.rb +3 -6
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: aa628988e7878d56e67bdb26d912dc7d21f419f9f0e75fb6ccc845a8937c1a56
|
4
|
+
data.tar.gz: 7dbeea9dc0759e3f894fa2893530cf79a041dbc29de99087b9ccbd7ddceb27bc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f91e58a6fc9d03de37625515a93918f33e7e3fc41334f4e1dd0ac982ae2a740cbcd67bff7cb2e422fd4eb21c29c9c3217e5af19084967abda92775f6d12a040e
|
7
|
+
data.tar.gz: 1d225d62b4b474bbdaad7edff6ee078194b7ea6a72146f9bc07844666048336c0d0eef4a9d07b9ead94799da7f822babd13ce44a2cd7ab274bd8d57a4f0a7a21
|
data/Gemfile
CHANGED
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# FunnyYubikeyGenerator
|
2
2
|
|
3
|
-
[](https://badge.fury.io/rb/funny_yubikey_generator)
|
4
4
|
|
5
5
|
Generate funny looking [yubikey OTP](https://developers.yubico.com/OTP/OTPs_Explained.html) containing words based on a dictionary.
|
6
6
|
|
@@ -37,7 +37,7 @@ dictionary = <<~DICO
|
|
37
37
|
interbelligerent
|
38
38
|
reinterference
|
39
39
|
DICO
|
40
|
-
generator = FunnyYubikeyGenerator.from_dictionary(dictionary
|
40
|
+
generator = FunnyYubikeyGenerator.from_dictionary(dictionary)
|
41
41
|
puts generator.generate(colorize: true)
|
42
42
|
|
43
43
|
generator = FunnyYubikeyGenerator.from_dictionary(File.open("/usr/share/dict/words"))
|
@@ -48,7 +48,7 @@ puts generator.generate(colorize: false)
|
|
48
48
|
|
49
49
|
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake test` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|
50
50
|
|
51
|
-
To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version
|
51
|
+
To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the `spec.version` in [funny_yubikey_generator.gemspec](funny_yubikey_generator.gemspec), and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and the created tag, and push the `.gem` file to [rubygems.org](https://rubygems.org).
|
52
52
|
|
53
53
|
## Contributing
|
54
54
|
|
data/exe/generate_funny_yubikey
CHANGED
@@ -27,7 +27,7 @@ end.parse!
|
|
27
27
|
|
28
28
|
generator = if dictionary
|
29
29
|
raise "Could not find file #{dictionary}" unless File.exist?(dictionary)
|
30
|
-
FunnyYubikeyGenerator.
|
30
|
+
FunnyYubikeyGenerator.from_dictionary(File.open(dictionary))
|
31
31
|
else
|
32
32
|
FunnyYubikeyGenerator.instance
|
33
33
|
end
|
@@ -1,15 +1,13 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require_relative "lib/funny_yubikey_generator"
|
4
|
-
|
5
3
|
Gem::Specification.new do |spec|
|
6
4
|
spec.name = "funny_yubikey_generator"
|
7
|
-
spec.version =
|
5
|
+
spec.version = "0.4.0"
|
8
6
|
spec.authors = ["Xavier Delamotte"]
|
9
7
|
spec.email = ["git@xade.eu"]
|
10
8
|
|
11
|
-
spec.summary = "
|
12
|
-
spec.description = "
|
9
|
+
spec.summary = "Generate funny looking yubikey OTP containing words based on a dictionary."
|
10
|
+
spec.description = "Generate funny looking yubikey OTP containing words based on a dictionary."
|
13
11
|
spec.homepage = "https://github.com/x4d3/funny_yubikey_generator"
|
14
12
|
spec.license = "MIT"
|
15
13
|
spec.required_ruby_version = ">= 2.6.0"
|
@@ -7,10 +7,9 @@ require "yaml"
|
|
7
7
|
|
8
8
|
class FunnyYubikeyGenerator
|
9
9
|
include Singleton
|
10
|
-
VERSION = "0.3.0"
|
11
10
|
COLORS = %i[red green yellow blue magenta cyan]
|
12
|
-
LETTERS = "cbdefghijklnrtuv"
|
13
|
-
|
11
|
+
LETTERS = "cbdefghijklnrtuv"
|
12
|
+
WORD_REGEX = /^[#{Regexp.quote(LETTERS)}]+{4,}$/
|
14
13
|
private_constant :COLORS
|
15
14
|
private_constant :LETTERS
|
16
15
|
|
@@ -21,9 +20,7 @@ class FunnyYubikeyGenerator
|
|
21
20
|
end
|
22
21
|
|
23
22
|
def filter_and_index_words(dictionary)
|
24
|
-
dictionary.
|
25
|
-
line.size > 3 && line.chars.all? { |c| LETTERS.include?(c) }
|
26
|
-
}.group_by(&:length)
|
23
|
+
dictionary.scan(WORD_REGEX).group_by(&:length)
|
27
24
|
end
|
28
25
|
|
29
26
|
def generate(colorize: false)
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: funny_yubikey_generator
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Xavier Delamotte
|
@@ -24,7 +24,7 @@ dependencies:
|
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: 0.8.1
|
27
|
-
description:
|
27
|
+
description: Generate funny looking yubikey OTP containing words based on a dictionary.
|
28
28
|
email:
|
29
29
|
- git@xade.eu
|
30
30
|
executables:
|
@@ -68,5 +68,5 @@ requirements: []
|
|
68
68
|
rubygems_version: 3.3.7
|
69
69
|
signing_key:
|
70
70
|
specification_version: 4
|
71
|
-
summary:
|
71
|
+
summary: Generate funny looking yubikey OTP containing words based on a dictionary.
|
72
72
|
test_files: []
|