signore 0.6.0 → 0.7.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- checksums.yaml.gz.sig +0 -0
- data.tar.gz.sig +0 -0
- data/.overcommit.yml +4 -0
- data/.reek.yml +3 -0
- data/.rubocop.yml +13 -5
- data/.ruby-version +1 -1
- data/.travis.yml +5 -4
- data/Rakefile +2 -4
- data/bin/signore +0 -1
- data/certs/chastell.pem +23 -19
- data/gems.locked +83 -0
- data/{Gemfile → gems.rb} +0 -2
- data/lib/signore.rb +0 -2
- data/lib/signore/cli.rb +4 -5
- data/lib/signore/repo.rb +25 -23
- data/lib/signore/settings.rb +1 -9
- data/lib/signore/sig_finder.rb +3 -11
- data/lib/signore/sig_from_stream.rb +6 -18
- data/lib/signore/signature.rb +10 -12
- data/lib/signore/tags.rb +1 -3
- data/signore.gemspec +7 -7
- data/test/fixtures/wrapper.yml +28 -19
- data/test/signore/cli_test.rb +30 -25
- data/test/signore/repo_test.rb +38 -40
- data/test/signore/settings_test.rb +3 -28
- data/test/signore/sig_finder_test.rb +9 -12
- data/test/signore/sig_from_stream_test.rb +9 -10
- data/test/signore/signature_test.rb +28 -16
- data/test/signore/tags_test.rb +10 -12
- data/test/test_helper.rb +0 -8
- metadata +65 -35
- metadata.gz.sig +0 -0
- data/.reek +0 -2
- data/Gemfile.lock +0 -67
- data/lib/signore/mapper.rb +0 -17
- data/test/signore/mapper_test.rb +0 -39
data/lib/signore/mapper.rb
DELETED
@@ -1,17 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require_relative 'signature'
|
4
|
-
|
5
|
-
module Signore
|
6
|
-
module Mapper
|
7
|
-
module_function
|
8
|
-
|
9
|
-
def from_h(hash)
|
10
|
-
Signature.new(hash.map { |key, value| [key.to_sym, value] }.to_h)
|
11
|
-
end
|
12
|
-
|
13
|
-
def to_h(signature)
|
14
|
-
signature.to_h
|
15
|
-
end
|
16
|
-
end
|
17
|
-
end
|
data/test/signore/mapper_test.rb
DELETED
@@ -1,39 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require_relative '../test_helper'
|
4
|
-
require_relative '../../lib/signore/mapper'
|
5
|
-
require_relative '../../lib/signore/signature'
|
6
|
-
|
7
|
-
module Signore
|
8
|
-
describe Mapper do
|
9
|
-
let(:sig_hash) do
|
10
|
-
{
|
11
|
-
'author' => 'Anonymous Coward',
|
12
|
-
'source' => '/.',
|
13
|
-
'subject' => 'on ‘Monty Wants to Save MySQL’',
|
14
|
-
'tags' => %w(/. MySQL),
|
15
|
-
'text' => text,
|
16
|
-
}
|
17
|
-
end
|
18
|
-
let(:signature) do
|
19
|
-
Signature.new(author: 'Anonymous Coward', source: '/.',
|
20
|
-
subject: 'on ‘Monty Wants to Save MySQL’',
|
21
|
-
tags: %w(/. MySQL), text: text)
|
22
|
-
end
|
23
|
-
let(:text) do
|
24
|
-
'For the sake of topic titles, I’d rather if Monty saved Python.'
|
25
|
-
end
|
26
|
-
|
27
|
-
describe '.from_h' do
|
28
|
-
it 'deserializes a Signature from a Hash' do
|
29
|
-
_(Mapper.from_h(sig_hash)).must_equal signature
|
30
|
-
end
|
31
|
-
end
|
32
|
-
|
33
|
-
describe '.to_h' do
|
34
|
-
it 'serialises a Signature to a Hash' do
|
35
|
-
_(Mapper.to_h(signature)).must_equal sig_hash
|
36
|
-
end
|
37
|
-
end
|
38
|
-
end
|
39
|
-
end
|