signore 0.7.0 → 1.1.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/.rubocop.yml +16 -7
- data/README.md +1 -1
- data/gems.locked +86 -60
- data/lib/signore/repo.rb +0 -9
- data/lib/signore/settings.rb +2 -2
- data/lib/signore/sig_from_stream.rb +4 -5
- data/lib/signore/signature.rb +2 -2
- data/lib/signore/tags.rb +2 -2
- data/signore.gemspec +13 -17
- data/test/signore/repo_test.rb +8 -25
- data/test/signore/sig_finder_test.rb +0 -2
- data/test/signore/sig_from_stream_test.rb +10 -0
- data/test/signore/signature_test.rb +8 -6
- data/test/signore/tags_test.rb +3 -0
- data/test/test_helper.rb +0 -5
- metadata +33 -75
- checksums.yaml.gz.sig +0 -4
- data/.overcommit.yml +0 -4
- data/.ruby-version +0 -1
- data/.travis.yml +0 -11
- data/certs/chastell.pem +0 -25
- data/test/fixtures/signatures.legacy.yml +0 -23
- data.tar.gz.sig +0 -0
- metadata.gz.sig +0 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3836fca9879726bbdd969adeb450e296799c3bbcbce890d3f00bae4381ae0fde
|
4
|
+
data.tar.gz: 5bbe4c90bd1f80dd63d6062a89f2708f9f92be3f4f69917c0f8fa00cb08454a3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e5e6381cb3b0067c61c8f8951528c166deeca50b2cdaf00aff640f42b3ab203fe4366925948cf20f0506a8b2a432028933020d1918d46548c9fe90e5a3a4a1b0
|
7
|
+
data.tar.gz: 72170f9b4ae8a52d92ac780fa2a581b87cdc5202cd613ea440506c582b5aefd69515c55f784da530b34201febb915b65e0780c18221bc8242c660ba63a6a6070
|
data/.rubocop.yml
CHANGED
@@ -1,20 +1,29 @@
|
|
1
|
+
plugins:
|
2
|
+
- rubocop-minitest
|
3
|
+
- rubocop-rake
|
4
|
+
|
5
|
+
AllCops:
|
6
|
+
NewCops: enable
|
7
|
+
TargetRubyVersion: 3.4
|
8
|
+
|
9
|
+
Bundler/GemFilename:
|
10
|
+
Enabled: false
|
11
|
+
|
12
|
+
Gemspec/DevelopmentDependencies:
|
13
|
+
Enabled: false
|
14
|
+
|
1
15
|
Metrics/BlockLength:
|
2
|
-
|
3
|
-
- signore.gemspec
|
4
|
-
- test/**/*
|
16
|
+
AllowedMethods: describe
|
5
17
|
|
6
18
|
Naming/HeredocDelimiterCase:
|
7
19
|
Enabled: false
|
8
20
|
|
9
|
-
|
21
|
+
Naming/HeredocDelimiterNaming:
|
10
22
|
Enabled: false
|
11
23
|
|
12
24
|
Style/Documentation:
|
13
25
|
Enabled: false
|
14
26
|
|
15
|
-
Style/EmptyCaseCondition:
|
16
|
-
Enabled: false
|
17
|
-
|
18
27
|
Style/FrozenStringLiteralComment:
|
19
28
|
Enabled: false
|
20
29
|
|
data/README.md
CHANGED
@@ -86,4 +86,4 @@ signore stores the signatures in a YAML file (for ease of editing, if such a nee
|
|
86
86
|
|
87
87
|
---
|
88
88
|
|
89
|
-
© MMIX-
|
89
|
+
© MMIX-MMXIX Piotr Szotkowski <chastell@chastell.net>, licensed under AGPL-3.0 (see LICENCE)
|
data/gems.locked
CHANGED
@@ -1,83 +1,109 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
signore (0.
|
4
|
+
signore (1.0.0)
|
5
5
|
lovely_rufus (~> 1.0)
|
6
|
-
|
6
|
+
pstore (~> 0.2.0)
|
7
7
|
|
8
8
|
GEM
|
9
9
|
remote: https://rubygems.org/
|
10
10
|
specs:
|
11
|
-
ast (2.4.
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
11
|
+
ast (2.4.3)
|
12
|
+
bigdecimal (3.1.9)
|
13
|
+
concurrent-ruby (1.3.5)
|
14
|
+
dry-configurable (1.3.0)
|
15
|
+
dry-core (~> 1.1)
|
16
|
+
zeitwerk (~> 2.6)
|
17
|
+
dry-core (1.1.0)
|
18
|
+
concurrent-ruby (~> 1.0)
|
19
|
+
logger
|
20
|
+
zeitwerk (~> 2.6)
|
21
|
+
dry-inflector (1.2.0)
|
22
|
+
dry-initializer (3.2.0)
|
23
|
+
dry-logic (1.6.0)
|
24
|
+
bigdecimal
|
25
|
+
concurrent-ruby (~> 1.0)
|
26
|
+
dry-core (~> 1.1)
|
27
|
+
zeitwerk (~> 2.6)
|
28
|
+
dry-schema (1.14.1)
|
29
|
+
concurrent-ruby (~> 1.0)
|
30
|
+
dry-configurable (~> 1.0, >= 1.0.1)
|
31
|
+
dry-core (~> 1.1)
|
32
|
+
dry-initializer (~> 3.2)
|
33
|
+
dry-logic (~> 1.5)
|
34
|
+
dry-types (~> 1.8)
|
35
|
+
zeitwerk (~> 2.6)
|
36
|
+
dry-types (1.8.2)
|
37
|
+
bigdecimal (~> 3.0)
|
38
|
+
concurrent-ruby (~> 1.0)
|
39
|
+
dry-core (~> 1.0)
|
40
|
+
dry-inflector (~> 1.0)
|
41
|
+
dry-logic (~> 1.4)
|
42
|
+
zeitwerk (~> 2.6)
|
43
|
+
json (2.12.0)
|
44
|
+
language_server-protocol (3.17.0.5)
|
45
|
+
lint_roller (1.1.0)
|
46
|
+
logger (1.7.0)
|
47
|
+
lovely_rufus (1.3.0)
|
48
|
+
minitest (5.25.5)
|
49
|
+
minitest-focus (1.4.0)
|
36
50
|
minitest (>= 4, < 6)
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
parser (>= 2.5.0.0, < 2.6, != 2.5.1.1)
|
51
|
+
parallel (1.27.0)
|
52
|
+
parser (3.3.8.0)
|
53
|
+
ast (~> 2.4.1)
|
54
|
+
racc
|
55
|
+
prism (1.4.0)
|
56
|
+
pstore (0.2.0)
|
57
|
+
racc (1.8.1)
|
58
|
+
rainbow (3.1.1)
|
59
|
+
rake (13.2.1)
|
60
|
+
reek (6.5.0)
|
61
|
+
dry-schema (~> 1.13)
|
62
|
+
logger (~> 1.6)
|
63
|
+
parser (~> 3.3.0)
|
51
64
|
rainbow (>= 2.0, < 4.0)
|
52
|
-
|
53
|
-
|
65
|
+
rexml (~> 3.1)
|
66
|
+
regexp_parser (2.10.0)
|
67
|
+
rexml (3.4.1)
|
68
|
+
rubocop (1.75.6)
|
69
|
+
json (~> 2.3)
|
70
|
+
language_server-protocol (~> 3.17.0.2)
|
71
|
+
lint_roller (~> 1.1.0)
|
54
72
|
parallel (~> 1.10)
|
55
|
-
parser (>=
|
56
|
-
powerpack (~> 0.1)
|
73
|
+
parser (>= 3.3.0.2)
|
57
74
|
rainbow (>= 2.2.2, < 4.0)
|
75
|
+
regexp_parser (>= 2.9.3, < 3.0)
|
76
|
+
rubocop-ast (>= 1.44.0, < 2.0)
|
58
77
|
ruby-progressbar (~> 1.7)
|
59
|
-
unicode-display_width (
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
78
|
+
unicode-display_width (>= 2.4.0, < 4.0)
|
79
|
+
rubocop-ast (1.44.1)
|
80
|
+
parser (>= 3.3.7.2)
|
81
|
+
prism (~> 1.4)
|
82
|
+
rubocop-minitest (0.38.0)
|
83
|
+
lint_roller (~> 1.1)
|
84
|
+
rubocop (>= 1.75.0, < 2.0)
|
85
|
+
rubocop-ast (>= 1.38.0, < 2.0)
|
86
|
+
rubocop-rake (0.7.1)
|
87
|
+
lint_roller (~> 1.1)
|
88
|
+
rubocop (>= 1.72.1)
|
89
|
+
ruby-progressbar (1.13.0)
|
90
|
+
unicode-display_width (3.1.4)
|
91
|
+
unicode-emoji (~> 4.0, >= 4.0.4)
|
92
|
+
unicode-emoji (4.0.4)
|
93
|
+
zeitwerk (2.7.3)
|
68
94
|
|
69
95
|
PLATFORMS
|
70
96
|
ruby
|
71
97
|
|
72
98
|
DEPENDENCIES
|
73
|
-
bogus (~> 0.1.3)
|
74
99
|
minitest (~> 5.6)
|
75
100
|
minitest-focus (~> 1.1)
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
rubocop (~> 0.
|
101
|
+
rake (~> 13.0)
|
102
|
+
reek (~> 6.0)
|
103
|
+
rubocop (~> 1.0)
|
104
|
+
rubocop-minitest (~> 0.38.0)
|
105
|
+
rubocop-rake (~> 0.7.0)
|
80
106
|
signore!
|
81
107
|
|
82
108
|
BUNDLED WITH
|
83
|
-
|
109
|
+
2.6.9
|
data/lib/signore/repo.rb
CHANGED
@@ -17,7 +17,6 @@ module Signore
|
|
17
17
|
|
18
18
|
def initialize(path: self.class.default_path)
|
19
19
|
@path = path
|
20
|
-
convert if legacy?
|
21
20
|
end
|
22
21
|
|
23
22
|
def <<(signature)
|
@@ -34,14 +33,6 @@ module Signore
|
|
34
33
|
|
35
34
|
attr_reader :path
|
36
35
|
|
37
|
-
def convert
|
38
|
-
self.hashes = hashes.map(&:to_h)
|
39
|
-
end
|
40
|
-
|
41
|
-
def legacy?
|
42
|
-
path.exist? and path.read.include?('Signore::Signature')
|
43
|
-
end
|
44
|
-
|
45
36
|
def hashes
|
46
37
|
store.transaction(true) { store.fetch('signatures', []) }
|
47
38
|
end
|
data/lib/signore/settings.rb
CHANGED
@@ -13,7 +13,7 @@ module Signore
|
|
13
13
|
|
14
14
|
def tags
|
15
15
|
negated, required = tag_names.partition { |name| name.start_with?('~') }
|
16
|
-
Tags.new(forbidden: negated.map { |neg| neg[1
|
16
|
+
Tags.new(forbidden: negated.map { |neg| neg[1..] }, required: required)
|
17
17
|
end
|
18
18
|
|
19
19
|
private
|
@@ -21,7 +21,7 @@ module Signore
|
|
21
21
|
attr_reader :args
|
22
22
|
|
23
23
|
def tag_names
|
24
|
-
args.empty? ? [] : args[1
|
24
|
+
args.empty? ? [] : args[1..]
|
25
25
|
end
|
26
26
|
end
|
27
27
|
end
|
@@ -1,10 +1,9 @@
|
|
1
|
-
require 'procto'
|
2
1
|
require_relative 'signature'
|
3
2
|
require_relative 'tags'
|
4
3
|
|
5
4
|
module Signore
|
6
5
|
class SigFromStream
|
7
|
-
|
6
|
+
def self.call(input, tags: Tags.new) = new(input, tags:).call
|
8
7
|
|
9
8
|
def initialize(input, tags: Tags.new)
|
10
9
|
@input = input
|
@@ -17,16 +16,16 @@ module Signore
|
|
17
16
|
text: params.text)
|
18
17
|
end
|
19
18
|
|
19
|
+
Params = Struct.new(:text, :author, :subject, :source)
|
20
|
+
|
20
21
|
private
|
21
22
|
|
22
23
|
attr_reader :input, :tags
|
23
24
|
|
24
|
-
Params = Struct.new(:text, :author, :subject, :source)
|
25
|
-
|
26
25
|
def get_param(param)
|
27
26
|
puts "\n#{param}?"
|
28
27
|
separator = param == :text ? "\n\n" : "\n"
|
29
|
-
input.gets(separator).strip
|
28
|
+
input.gets(separator).strip.gsub(/(?<=\p{L})'/, '’').tr("'", '‘')
|
30
29
|
end
|
31
30
|
|
32
31
|
def params
|
data/lib/signore/signature.rb
CHANGED
@@ -4,12 +4,12 @@ module Signore
|
|
4
4
|
class Signature < Struct.new(:text, :author, :source, :subject, :tags)
|
5
5
|
class << self
|
6
6
|
def from_h(hash)
|
7
|
-
new(hash.
|
7
|
+
new(**hash.transform_keys(&:to_sym))
|
8
8
|
end
|
9
9
|
end
|
10
10
|
|
11
11
|
def initialize(author: '', source: '', subject: '', tags: [], text: '')
|
12
|
-
super
|
12
|
+
super(text, author, source, subject, tags)
|
13
13
|
end
|
14
14
|
|
15
15
|
def empty?
|
data/lib/signore/tags.rb
CHANGED
@@ -1,11 +1,11 @@
|
|
1
1
|
module Signore
|
2
2
|
Tags = Struct.new(:forbidden, :required) do
|
3
3
|
def initialize(forbidden: [], required: [])
|
4
|
-
super
|
4
|
+
super(forbidden, required)
|
5
5
|
end
|
6
6
|
|
7
7
|
def match?(sig_tags)
|
8
|
-
(required & sig_tags) == required and (
|
8
|
+
(required & sig_tags) == required and not forbidden.intersect?(sig_tags) # rubocop:disable Style/BitwisePredicate
|
9
9
|
end
|
10
10
|
|
11
11
|
def to_s
|
data/signore.gemspec
CHANGED
@@ -7,30 +7,26 @@ Gem::Specification.new do |gem|
|
|
7
7
|
'random ones based on their tags'
|
8
8
|
gem.email = 'chastell@chastell.net'
|
9
9
|
gem.homepage = 'http://github.com/chastell/signore'
|
10
|
-
gem.license = 'AGPL-3.0'
|
10
|
+
gem.license = 'AGPL-3.0-or-later'
|
11
11
|
gem.name = 'signore'
|
12
12
|
gem.summary = 'signore: an email signature manager/randomiser'
|
13
|
-
gem.version = '
|
13
|
+
gem.version = '1.1.0'
|
14
14
|
|
15
|
-
gem.required_ruby_version = '~>
|
15
|
+
gem.required_ruby_version = '~> 3.4'
|
16
16
|
|
17
17
|
gem.files = `git ls-files -z`.split "\0"
|
18
18
|
gem.executables = gem.files.grep(%r{^bin/}).map { |path| File.basename(path) }
|
19
|
-
gem.test_files = gem.files.grep(%r{^test/.*\.rb$})
|
20
|
-
|
21
|
-
gem.cert_chain = ['certs/chastell.pem']
|
22
|
-
if Pathname.new($PROGRAM_NAME).basename == Pathname.new('gem')
|
23
|
-
gem.signing_key = Pathname.new('~/.ssh/gem-private_key.pem').expand_path
|
24
|
-
end
|
25
19
|
|
26
20
|
gem.add_dependency 'lovely_rufus', '~> 1.0'
|
27
|
-
gem.add_dependency '
|
21
|
+
gem.add_dependency 'pstore', '~> 0.2.0'
|
22
|
+
|
23
|
+
gem.add_development_dependency 'minitest', '~> 5.6'
|
24
|
+
gem.add_development_dependency 'minitest-focus', '~> 1.1'
|
25
|
+
gem.add_development_dependency 'rake', '~> 13.0'
|
26
|
+
gem.add_development_dependency 'reek', '~> 6.0'
|
27
|
+
gem.add_development_dependency 'rubocop', '~> 1.0'
|
28
|
+
gem.add_development_dependency 'rubocop-minitest', '~> 0.38.0'
|
29
|
+
gem.add_development_dependency 'rubocop-rake', '~> 0.7.0'
|
28
30
|
|
29
|
-
gem.
|
30
|
-
gem.add_development_dependency 'minitest', '~> 5.6'
|
31
|
-
gem.add_development_dependency 'minitest-focus', '~> 1.1'
|
32
|
-
gem.add_development_dependency 'overcommit', '~> 0.46.0'
|
33
|
-
gem.add_development_dependency 'rake', '~> 12.0'
|
34
|
-
gem.add_development_dependency 'reek', '~> 5.0'
|
35
|
-
gem.add_development_dependency 'rubocop', '~> 0.60.0'
|
31
|
+
gem.metadata['rubygems_mfa_required'] = 'true'
|
36
32
|
end
|
data/test/signore/repo_test.rb
CHANGED
@@ -15,10 +15,10 @@ module Signore
|
|
15
15
|
it 'honours XDG_DATA_HOME if it’s set' do
|
16
16
|
old_xdg = ENV.delete('XDG_DATA_HOME')
|
17
17
|
ENV['XDG_DATA_HOME'] = Dir.mktmpdir
|
18
|
-
path = "#{ENV
|
18
|
+
path = "#{ENV.fetch('XDG_DATA_HOME')}/signore/signatures.yml"
|
19
19
|
_(Repo.default_path).must_equal Pathname.new(path)
|
20
20
|
ensure
|
21
|
-
FileUtils.rmtree ENV
|
21
|
+
FileUtils.rmtree ENV.fetch('XDG_DATA_HOME')
|
22
22
|
old_xdg ? ENV['XDG_DATA_HOME'] = old_xdg : ENV.delete('XDG_DATA_HOME')
|
23
23
|
end
|
24
24
|
|
@@ -31,14 +31,6 @@ module Signore
|
|
31
31
|
end
|
32
32
|
end
|
33
33
|
|
34
|
-
describe '.new' do
|
35
|
-
it 'rewrites legacy file to hashes on first access' do
|
36
|
-
FileUtils.cp Pathname.new('test/fixtures/signatures.legacy.yml'), path
|
37
|
-
Repo.new(path: path)
|
38
|
-
_(path.read).wont_include 'Signore::Signature'
|
39
|
-
end
|
40
|
-
end
|
41
|
-
|
42
34
|
describe '#<<' do
|
43
35
|
let(:sig) { Signature.new(text: text) }
|
44
36
|
let(:text) { 'Normaliser Unix c’est comme pasteuriser le camembert.' }
|
@@ -48,21 +40,21 @@ module Signore
|
|
48
40
|
_(path.read).must_include text
|
49
41
|
end
|
50
42
|
|
51
|
-
it '
|
52
|
-
|
43
|
+
it 'handles edge cases' do
|
44
|
+
sig = Signature.new(author: '000___000')
|
53
45
|
Repo.new(path: path) << sig
|
54
|
-
_(path.read).wont_include 'Signore::Signature'
|
55
46
|
end
|
56
47
|
end
|
57
48
|
|
58
49
|
describe '#empty?' do
|
59
50
|
it 'is true when a repo is empty' do
|
60
|
-
|
51
|
+
assert_predicate Repo.new(path: path), :empty?
|
61
52
|
end
|
62
53
|
|
63
54
|
it 'is false when a repo is not empty' do
|
64
|
-
FileUtils.cp Pathname.new('test/fixtures/signatures.
|
65
|
-
|
55
|
+
FileUtils.cp Pathname.new('test/fixtures/signatures.yml'), path
|
56
|
+
|
57
|
+
refute_predicate Repo.new(path: path), :empty?
|
66
58
|
end
|
67
59
|
end
|
68
60
|
|
@@ -75,15 +67,6 @@ module Signore
|
|
75
67
|
_(sigs.last.subject).must_equal 'Star Wars ending explained'
|
76
68
|
end
|
77
69
|
|
78
|
-
it 'keeps working with legacy YAML files' do
|
79
|
-
legacy_path = Pathname.new('test/fixtures/signatures.legacy.yml')
|
80
|
-
temp_path = Pathname.new(Tempfile.new.path)
|
81
|
-
FileUtils.cp legacy_path, temp_path
|
82
|
-
legacy_repo = Repo.new(path: temp_path)
|
83
|
-
new_repo = Repo.new(path: Pathname.new('test/fixtures/signatures.yml'))
|
84
|
-
_(legacy_repo.sigs).must_equal new_repo.sigs
|
85
|
-
end
|
86
|
-
|
87
70
|
it 'doesn’t blow up if the path is missing' do
|
88
71
|
tempdir = Dir.mktmpdir
|
89
72
|
path = Pathname.new("#{tempdir}/some_intermediate_dir/sigs.yml")
|
@@ -51,6 +51,16 @@ module Signore
|
|
51
51
|
end
|
52
52
|
_(sig).must_equal Signature.new(author: 'Patrick Ewing', text: text)
|
53
53
|
end
|
54
|
+
|
55
|
+
it 'replaces apostrophes with proper quotation marks' do
|
56
|
+
simple = "There's no 'i' in 'denial'."
|
57
|
+
author = 'ʎoɟ ʎɹoɔ'
|
58
|
+
input = StringIO.new("#{simple}\n\n#{author}\n\n\n")
|
59
|
+
sig = nil
|
60
|
+
capture_io { sig = SigFromStream.call input }
|
61
|
+
text = 'There’s no ‘i’ in ‘denial’.'
|
62
|
+
_(sig).must_equal Signature.new(author:, text:)
|
63
|
+
end
|
54
64
|
end
|
55
65
|
end
|
56
66
|
end
|
@@ -21,7 +21,7 @@ module Signore # rubocop:disable Metrics/ModuleLength
|
|
21
21
|
it 'instantiates Signatures via parameters' do
|
22
22
|
source = 'A History of Modern Computing'
|
23
23
|
text = 'In 1940 he summarized his work in an influential book, ' \
|
24
|
-
|
24
|
+
'‘Punched Card Methods in Scientific Computation’.'
|
25
25
|
sig = Signature.new(author: 'Paul E. Ceruzzi', source: source,
|
26
26
|
subject: 'on Wallace Eckert',
|
27
27
|
tags: ['punched cards'], text: text)
|
@@ -42,11 +42,11 @@ module Signore # rubocop:disable Metrics/ModuleLength
|
|
42
42
|
|
43
43
|
describe '#empty?' do
|
44
44
|
it 'is true when the Signature is a null object' do
|
45
|
-
|
45
|
+
assert_predicate Signature.new, :empty?
|
46
46
|
end
|
47
47
|
|
48
48
|
it 'is false when the Signature has some text' do
|
49
|
-
|
49
|
+
refute_predicate Signature.new(text: 'Node.jk'), :empty?
|
50
50
|
end
|
51
51
|
end
|
52
52
|
|
@@ -62,7 +62,7 @@ module Signore # rubocop:disable Metrics/ModuleLength
|
|
62
62
|
end
|
63
63
|
|
64
64
|
it 'removes non-existing keys' do
|
65
|
-
|
65
|
+
assert_predicate Signature.new.to_h, :empty?
|
66
66
|
end
|
67
67
|
end
|
68
68
|
|
@@ -118,7 +118,7 @@ module Signore # rubocop:disable Metrics/ModuleLength
|
|
118
118
|
|
119
119
|
it 'shows subject on its own' do
|
120
120
|
text = 'Amateur fighter pilot ignores orders, listens ' \
|
121
|
-
|
121
|
+
'to the voices in his head and slaughters thousands.'
|
122
122
|
sig = Signature.new(subject: 'Star Wars ending explained', text: text)
|
123
123
|
_(sig.to_s).must_equal <<~end.strip
|
124
124
|
Amateur fighter pilot ignores orders, listens to
|
@@ -128,7 +128,9 @@ module Signore # rubocop:disable Metrics/ModuleLength
|
|
128
128
|
end
|
129
129
|
|
130
130
|
it 'handles edge cases properly' do
|
131
|
-
YAML.load_file('test/fixtures/wrapper.yml'
|
131
|
+
wrappings = YAML.load_file('test/fixtures/wrapper.yml',
|
132
|
+
permitted_classes: [Signature, Symbol])
|
133
|
+
wrappings.each do |sig, wrapped|
|
132
134
|
_(Signature.from_h(sig.to_h).to_s).must_equal wrapped
|
133
135
|
end
|
134
136
|
end
|
data/test/signore/tags_test.rb
CHANGED
@@ -3,9 +3,11 @@ require_relative '../../lib/signore/tags'
|
|
3
3
|
|
4
4
|
module Signore
|
5
5
|
describe Tags do
|
6
|
+
# rubocop:disable Minitest/AssertMatch, Minitest/RefuteMatch
|
6
7
|
describe '#match?' do
|
7
8
|
it 'is a predicate whether the Tags match the given list of tags' do
|
8
9
|
tags = %w[programming tech]
|
10
|
+
|
9
11
|
assert Tags.new.match?([])
|
10
12
|
assert Tags.new(forbidden: %w[fnord]).match?([])
|
11
13
|
assert Tags.new.match?(tags)
|
@@ -16,6 +18,7 @@ module Signore
|
|
16
18
|
refute Tags.new(forbidden: %w[tech], required: %w[tech]).match?(tags)
|
17
19
|
end
|
18
20
|
end
|
21
|
+
# rubocop:enable Minitest/AssertMatch, Minitest/RefuteMatch
|
19
22
|
|
20
23
|
describe '#to_s' do
|
21
24
|
it 'returns a CLI-like representation of the Tags' do
|
data/test/test_helper.rb
CHANGED
metadata
CHANGED
@@ -1,40 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: signore
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 1.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Piotr Szotkowski
|
8
|
-
autorequire:
|
9
8
|
bindir: bin
|
10
|
-
cert_chain:
|
11
|
-
-
|
12
|
-
-----BEGIN CERTIFICATE-----
|
13
|
-
MIIERDCCAqygAwIBAgIBATANBgkqhkiG9w0BAQsFADAmMSQwIgYDVQQDDBtjaGFz
|
14
|
-
dGVsbC9EQz1jaGFzdGVsbC9EQz1uZXQwHhcNMTgxMTEzMTkzNDIxWhcNMTkxMTEz
|
15
|
-
MTkzNDIxWjAmMSQwIgYDVQQDDBtjaGFzdGVsbC9EQz1jaGFzdGVsbC9EQz1uZXQw
|
16
|
-
ggGiMA0GCSqGSIb3DQEBAQUAA4IBjwAwggGKAoIBgQC1jioiuQD8eIyuCXhry37a
|
17
|
-
KBqipfFlkc6Oz37i/LN6NE+TJCtGmgn/wDZDdJVTv3SOGomI1fFVkP7cWAIF+/4+
|
18
|
-
965ktOvenWIwok3LRaMvpnkzo0cqPoUYF9x5kx+9W2ATjmPldNsfC5gtfg5qEsPs
|
19
|
-
wqdeMet0Ll5ZMR36GfB+FDlGCD7OetSN7p3oZLqp0tMaac+VYWLdHbBNBmB1jQ3s
|
20
|
-
yXYndD3U/NjcTQhVJvpV/Qx9LnDdgsGlXYChiZcy1UTuTj/947WYc40/q9lVFAKg
|
21
|
-
MawVC/0NJhB5CC2+eTFX5fSioNNEecET5nJlIhxPO3YhL1o04cZ9a5qL3cfKouUp
|
22
|
-
Sf/QSolrGMS6K6fkUK6pkgoQSsjKqdgNXWe/I2LPstXhUEcQtPy1hEwVHBDY3DFS
|
23
|
-
bFJxJCzG+0gQavu2F26unT1Ypc2pVtrD85uMIMsRv322EYrDKIFZnBK9caXr4P0A
|
24
|
-
8qF4Q8KLkrVbNSI8yQBYAZbX2s/ujgSGyVjr6EVmAAUCAwEAAaN9MHswCQYDVR0T
|
25
|
-
BAIwADALBgNVHQ8EBAMCBLAwHQYDVR0OBBYEFEk81YvjHuQWi2e2Few63uIWo0jR
|
26
|
-
MCAGA1UdEQQZMBeBFWNoYXN0ZWxsQGNoYXN0ZWxsLm5ldDAgBgNVHRIEGTAXgRVj
|
27
|
-
aGFzdGVsbEBjaGFzdGVsbC5uZXQwDQYJKoZIhvcNAQELBQADggGBADHA0HjFqCjn
|
28
|
-
IQkwo43CSWEZBCB+J9vfzYWAeVGWhupHlI/SxhrT7r8chfioDZ3viHMasmZQ5LE6
|
29
|
-
CMnQSQ/Cpj/WwmbUzVqBKFK+awivbFoOVbLWjUbhpIZ8CTJ71bj76bNfmJM+EoyJ
|
30
|
-
+e/45fxaSeq9FBuF2RN9EFndbUQ8HX2+0q66QgWV3aeegqi0HrapWE1pYMYCq3oa
|
31
|
-
YxTqzgX5Dc0hOJlfUbHa8o9Wd+uZtCUDYgW2mMFWDhtqODUelGQVE1ep+r2ezdkz
|
32
|
-
CC+NRY+4YHFBPMo6GFZvxWCuCURP5njE02LvRvQm/0sBJN5iiPrhCBC7B20vUD2W
|
33
|
-
BBp3qVHoVKxMKQ9hflY/qov85/Hgre3BKTv338CWTrDSC3HoHUXi1LhM2QYNG8oK
|
34
|
-
J29ZBdaXkaJ0zXg0Gi2ltKxs4vjxwSHdRqnaT29A8ca9mGWzzVmTqjPz8cFnt+1I
|
35
|
-
vmVyvVV5f57oDgaXeZLHRbgp+sU4WyyESZ9cHyYZks1tWKMOavbO7Q==
|
36
|
-
-----END CERTIFICATE-----
|
37
|
-
date: 2018-11-13 00:00:00.000000000 Z
|
9
|
+
cert_chain: []
|
10
|
+
date: 1980-01-02 00:00:00.000000000 Z
|
38
11
|
dependencies:
|
39
12
|
- !ruby/object:Gem::Dependency
|
40
13
|
name: lovely_rufus
|
@@ -51,117 +24,117 @@ dependencies:
|
|
51
24
|
- !ruby/object:Gem::Version
|
52
25
|
version: '1.0'
|
53
26
|
- !ruby/object:Gem::Dependency
|
54
|
-
name:
|
27
|
+
name: pstore
|
55
28
|
requirement: !ruby/object:Gem::Requirement
|
56
29
|
requirements:
|
57
30
|
- - "~>"
|
58
31
|
- !ruby/object:Gem::Version
|
59
|
-
version: 0.0
|
32
|
+
version: 0.2.0
|
60
33
|
type: :runtime
|
61
34
|
prerelease: false
|
62
35
|
version_requirements: !ruby/object:Gem::Requirement
|
63
36
|
requirements:
|
64
37
|
- - "~>"
|
65
38
|
- !ruby/object:Gem::Version
|
66
|
-
version: 0.0
|
39
|
+
version: 0.2.0
|
67
40
|
- !ruby/object:Gem::Dependency
|
68
|
-
name:
|
41
|
+
name: minitest
|
69
42
|
requirement: !ruby/object:Gem::Requirement
|
70
43
|
requirements:
|
71
44
|
- - "~>"
|
72
45
|
- !ruby/object:Gem::Version
|
73
|
-
version:
|
46
|
+
version: '5.6'
|
74
47
|
type: :development
|
75
48
|
prerelease: false
|
76
49
|
version_requirements: !ruby/object:Gem::Requirement
|
77
50
|
requirements:
|
78
51
|
- - "~>"
|
79
52
|
- !ruby/object:Gem::Version
|
80
|
-
version:
|
53
|
+
version: '5.6'
|
81
54
|
- !ruby/object:Gem::Dependency
|
82
|
-
name: minitest
|
55
|
+
name: minitest-focus
|
83
56
|
requirement: !ruby/object:Gem::Requirement
|
84
57
|
requirements:
|
85
58
|
- - "~>"
|
86
59
|
- !ruby/object:Gem::Version
|
87
|
-
version: '
|
60
|
+
version: '1.1'
|
88
61
|
type: :development
|
89
62
|
prerelease: false
|
90
63
|
version_requirements: !ruby/object:Gem::Requirement
|
91
64
|
requirements:
|
92
65
|
- - "~>"
|
93
66
|
- !ruby/object:Gem::Version
|
94
|
-
version: '
|
67
|
+
version: '1.1'
|
95
68
|
- !ruby/object:Gem::Dependency
|
96
|
-
name:
|
69
|
+
name: rake
|
97
70
|
requirement: !ruby/object:Gem::Requirement
|
98
71
|
requirements:
|
99
72
|
- - "~>"
|
100
73
|
- !ruby/object:Gem::Version
|
101
|
-
version: '
|
74
|
+
version: '13.0'
|
102
75
|
type: :development
|
103
76
|
prerelease: false
|
104
77
|
version_requirements: !ruby/object:Gem::Requirement
|
105
78
|
requirements:
|
106
79
|
- - "~>"
|
107
80
|
- !ruby/object:Gem::Version
|
108
|
-
version: '
|
81
|
+
version: '13.0'
|
109
82
|
- !ruby/object:Gem::Dependency
|
110
|
-
name:
|
83
|
+
name: reek
|
111
84
|
requirement: !ruby/object:Gem::Requirement
|
112
85
|
requirements:
|
113
86
|
- - "~>"
|
114
87
|
- !ruby/object:Gem::Version
|
115
|
-
version:
|
88
|
+
version: '6.0'
|
116
89
|
type: :development
|
117
90
|
prerelease: false
|
118
91
|
version_requirements: !ruby/object:Gem::Requirement
|
119
92
|
requirements:
|
120
93
|
- - "~>"
|
121
94
|
- !ruby/object:Gem::Version
|
122
|
-
version:
|
95
|
+
version: '6.0'
|
123
96
|
- !ruby/object:Gem::Dependency
|
124
|
-
name:
|
97
|
+
name: rubocop
|
125
98
|
requirement: !ruby/object:Gem::Requirement
|
126
99
|
requirements:
|
127
100
|
- - "~>"
|
128
101
|
- !ruby/object:Gem::Version
|
129
|
-
version: '
|
102
|
+
version: '1.0'
|
130
103
|
type: :development
|
131
104
|
prerelease: false
|
132
105
|
version_requirements: !ruby/object:Gem::Requirement
|
133
106
|
requirements:
|
134
107
|
- - "~>"
|
135
108
|
- !ruby/object:Gem::Version
|
136
|
-
version: '
|
109
|
+
version: '1.0'
|
137
110
|
- !ruby/object:Gem::Dependency
|
138
|
-
name:
|
111
|
+
name: rubocop-minitest
|
139
112
|
requirement: !ruby/object:Gem::Requirement
|
140
113
|
requirements:
|
141
114
|
- - "~>"
|
142
115
|
- !ruby/object:Gem::Version
|
143
|
-
version:
|
116
|
+
version: 0.38.0
|
144
117
|
type: :development
|
145
118
|
prerelease: false
|
146
119
|
version_requirements: !ruby/object:Gem::Requirement
|
147
120
|
requirements:
|
148
121
|
- - "~>"
|
149
122
|
- !ruby/object:Gem::Version
|
150
|
-
version:
|
123
|
+
version: 0.38.0
|
151
124
|
- !ruby/object:Gem::Dependency
|
152
|
-
name: rubocop
|
125
|
+
name: rubocop-rake
|
153
126
|
requirement: !ruby/object:Gem::Requirement
|
154
127
|
requirements:
|
155
128
|
- - "~>"
|
156
129
|
- !ruby/object:Gem::Version
|
157
|
-
version: 0.
|
130
|
+
version: 0.7.0
|
158
131
|
type: :development
|
159
132
|
prerelease: false
|
160
133
|
version_requirements: !ruby/object:Gem::Requirement
|
161
134
|
requirements:
|
162
135
|
- - "~>"
|
163
136
|
- !ruby/object:Gem::Version
|
164
|
-
version: 0.
|
137
|
+
version: 0.7.0
|
165
138
|
description: signore helps manage email signatures and select random ones based on
|
166
139
|
their tags
|
167
140
|
email: chastell@chastell.net
|
@@ -170,16 +143,12 @@ executables:
|
|
170
143
|
extensions: []
|
171
144
|
extra_rdoc_files: []
|
172
145
|
files:
|
173
|
-
- ".overcommit.yml"
|
174
146
|
- ".reek.yml"
|
175
147
|
- ".rubocop.yml"
|
176
|
-
- ".ruby-version"
|
177
|
-
- ".travis.yml"
|
178
148
|
- LICENCE
|
179
149
|
- README.md
|
180
150
|
- Rakefile
|
181
151
|
- bin/signore
|
182
|
-
- certs/chastell.pem
|
183
152
|
- gems.locked
|
184
153
|
- gems.rb
|
185
154
|
- lib/signore.rb
|
@@ -192,7 +161,6 @@ files:
|
|
192
161
|
- lib/signore/tags.rb
|
193
162
|
- signore.gemspec
|
194
163
|
- test/fixtures/nosignatures.yml
|
195
|
-
- test/fixtures/signatures.legacy.yml
|
196
164
|
- test/fixtures/signatures.yml
|
197
165
|
- test/fixtures/wrapper.yml
|
198
166
|
- test/signore/cli_test.rb
|
@@ -205,9 +173,9 @@ files:
|
|
205
173
|
- test/test_helper.rb
|
206
174
|
homepage: http://github.com/chastell/signore
|
207
175
|
licenses:
|
208
|
-
- AGPL-3.0
|
209
|
-
metadata:
|
210
|
-
|
176
|
+
- AGPL-3.0-or-later
|
177
|
+
metadata:
|
178
|
+
rubygems_mfa_required: 'true'
|
211
179
|
rdoc_options: []
|
212
180
|
require_paths:
|
213
181
|
- lib
|
@@ -215,24 +183,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
215
183
|
requirements:
|
216
184
|
- - "~>"
|
217
185
|
- !ruby/object:Gem::Version
|
218
|
-
version: '
|
186
|
+
version: '3.4'
|
219
187
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
220
188
|
requirements:
|
221
189
|
- - ">="
|
222
190
|
- !ruby/object:Gem::Version
|
223
191
|
version: '0'
|
224
192
|
requirements: []
|
225
|
-
|
226
|
-
rubygems_version: 2.7.6
|
227
|
-
signing_key:
|
193
|
+
rubygems_version: 3.6.9
|
228
194
|
specification_version: 4
|
229
195
|
summary: 'signore: an email signature manager/randomiser'
|
230
|
-
test_files:
|
231
|
-
- test/signore/cli_test.rb
|
232
|
-
- test/signore/repo_test.rb
|
233
|
-
- test/signore/settings_test.rb
|
234
|
-
- test/signore/sig_finder_test.rb
|
235
|
-
- test/signore/sig_from_stream_test.rb
|
236
|
-
- test/signore/signature_test.rb
|
237
|
-
- test/signore/tags_test.rb
|
238
|
-
- test/test_helper.rb
|
196
|
+
test_files: []
|
checksums.yaml.gz.sig
DELETED
@@ -1,4 +0,0 @@
|
|
1
|
-
��b��ů��:���8S���e�٦ڞ_���Bv:���b�!3�[7*�L)V�0�x9�.<�.����a)TxHe*QX�hk�7C�I�9�o
|
2
|
-
j��e�L?8R�~�YB`����oR��~u%���|�x����d�_����,j��K+�܉�a8R��TNK���"��ψvӣe[,��q/�/Ӆ�k����URI�/�`��;��e�$@���CQ��ju�����X=�°ߩ�?�H$�94O�Uq��-汹� �8@G�v� /�*�ƞ�[��B�aD⦓x'��\O�
|
3
|
-
��u-��&gcm��
|
4
|
-
��"k� ���Y@l��\��>�`���"�ZZ��d�����-�j�F(�/o��62�5���7c�=J
|
data/.overcommit.yml
DELETED
data/.ruby-version
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
2.5
|
data/.travis.yml
DELETED
data/certs/chastell.pem
DELETED
@@ -1,25 +0,0 @@
|
|
1
|
-
-----BEGIN CERTIFICATE-----
|
2
|
-
MIIERDCCAqygAwIBAgIBATANBgkqhkiG9w0BAQsFADAmMSQwIgYDVQQDDBtjaGFz
|
3
|
-
dGVsbC9EQz1jaGFzdGVsbC9EQz1uZXQwHhcNMTgxMTEzMTkzNDIxWhcNMTkxMTEz
|
4
|
-
MTkzNDIxWjAmMSQwIgYDVQQDDBtjaGFzdGVsbC9EQz1jaGFzdGVsbC9EQz1uZXQw
|
5
|
-
ggGiMA0GCSqGSIb3DQEBAQUAA4IBjwAwggGKAoIBgQC1jioiuQD8eIyuCXhry37a
|
6
|
-
KBqipfFlkc6Oz37i/LN6NE+TJCtGmgn/wDZDdJVTv3SOGomI1fFVkP7cWAIF+/4+
|
7
|
-
965ktOvenWIwok3LRaMvpnkzo0cqPoUYF9x5kx+9W2ATjmPldNsfC5gtfg5qEsPs
|
8
|
-
wqdeMet0Ll5ZMR36GfB+FDlGCD7OetSN7p3oZLqp0tMaac+VYWLdHbBNBmB1jQ3s
|
9
|
-
yXYndD3U/NjcTQhVJvpV/Qx9LnDdgsGlXYChiZcy1UTuTj/947WYc40/q9lVFAKg
|
10
|
-
MawVC/0NJhB5CC2+eTFX5fSioNNEecET5nJlIhxPO3YhL1o04cZ9a5qL3cfKouUp
|
11
|
-
Sf/QSolrGMS6K6fkUK6pkgoQSsjKqdgNXWe/I2LPstXhUEcQtPy1hEwVHBDY3DFS
|
12
|
-
bFJxJCzG+0gQavu2F26unT1Ypc2pVtrD85uMIMsRv322EYrDKIFZnBK9caXr4P0A
|
13
|
-
8qF4Q8KLkrVbNSI8yQBYAZbX2s/ujgSGyVjr6EVmAAUCAwEAAaN9MHswCQYDVR0T
|
14
|
-
BAIwADALBgNVHQ8EBAMCBLAwHQYDVR0OBBYEFEk81YvjHuQWi2e2Few63uIWo0jR
|
15
|
-
MCAGA1UdEQQZMBeBFWNoYXN0ZWxsQGNoYXN0ZWxsLm5ldDAgBgNVHRIEGTAXgRVj
|
16
|
-
aGFzdGVsbEBjaGFzdGVsbC5uZXQwDQYJKoZIhvcNAQELBQADggGBADHA0HjFqCjn
|
17
|
-
IQkwo43CSWEZBCB+J9vfzYWAeVGWhupHlI/SxhrT7r8chfioDZ3viHMasmZQ5LE6
|
18
|
-
CMnQSQ/Cpj/WwmbUzVqBKFK+awivbFoOVbLWjUbhpIZ8CTJ71bj76bNfmJM+EoyJ
|
19
|
-
+e/45fxaSeq9FBuF2RN9EFndbUQ8HX2+0q66QgWV3aeegqi0HrapWE1pYMYCq3oa
|
20
|
-
YxTqzgX5Dc0hOJlfUbHa8o9Wd+uZtCUDYgW2mMFWDhtqODUelGQVE1ep+r2ezdkz
|
21
|
-
CC+NRY+4YHFBPMo6GFZvxWCuCURP5njE02LvRvQm/0sBJN5iiPrhCBC7B20vUD2W
|
22
|
-
BBp3qVHoVKxMKQ9hflY/qov85/Hgre3BKTv338CWTrDSC3HoHUXi1LhM2QYNG8oK
|
23
|
-
J29ZBdaXkaJ0zXg0Gi2ltKxs4vjxwSHdRqnaT29A8ca9mGWzzVmTqjPz8cFnt+1I
|
24
|
-
vmVyvVV5f57oDgaXeZLHRbgp+sU4WyyESZ9cHyYZks1tWKMOavbO7Q==
|
25
|
-
-----END CERTIFICATE-----
|
@@ -1,23 +0,0 @@
|
|
1
|
-
signatures:
|
2
|
-
- !ruby/struct:Signore::Signature
|
3
|
-
text: You do have to be mad to work here, but it doesn’t help.
|
4
|
-
author: Gary Barnes
|
5
|
-
source: asr
|
6
|
-
tags: [tech, work]
|
7
|
-
- !ruby/struct:Signore::Signature
|
8
|
-
text: More gangland camp than neo-noir.
|
9
|
-
author: Nicholas Christopher
|
10
|
-
subject: on Pulp Fiction
|
11
|
-
- !ruby/struct:Signore::Signature
|
12
|
-
text: // sometimes I believe compiler ignores all my comments
|
13
|
-
tags: [programming, tech]
|
14
|
-
- !ruby/struct:Signore::Signature
|
15
|
-
text: Bruce Schneier knows Alice and Bob’s shared secret.
|
16
|
-
source: Bruce Schneier Facts
|
17
|
-
tags: [security, tech]
|
18
|
-
- !ruby/struct:Signore::Signature
|
19
|
-
text: stay-at-home executives vs. wallstreet dads
|
20
|
-
author: kodz
|
21
|
-
- !ruby/struct:Signore::Signature
|
22
|
-
text: Amateur fighter pilot ignores orders, listens to the voices in his head and slaughters thousands.
|
23
|
-
subject: Star Wars ending explained
|
data.tar.gz.sig
DELETED
Binary file
|
metadata.gz.sig
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
m��Ѵ��k��
|