riffer-rig 0.19.0 → 0.19.1
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/CHANGELOG.md +7 -0
- data/lib/riffer/rig/loader/extension_source.rb +8 -4
- data/lib/riffer/rig/terminal/renderer.rb +1 -1
- data/lib/riffer/rig/trust/decision.rb +23 -0
- data/lib/riffer/rig/trust.rb +17 -5
- data/lib/riffer/rig/version.rb +1 -1
- data/sig/generated/riffer/rig/trust/decision.rbs +18 -0
- data/sig/generated/riffer/rig/trust.rbs +10 -6
- metadata +9 -7
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 956c768753795449f251c88032d34e29431990e85256a12f596bab048bbbd8fd
|
|
4
|
+
data.tar.gz: 4794240023e70cb83aa0ebea70bc42406976591b6aa174a43cb5802026970e08
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: a2cf805167fb267b267c433a7f204382980fac9c9a29eb2382d3ff2cf6a4ba804d83ca6fe2a3af47118bf61f4cf9de7a23105dea32039319359a81e3592168ae
|
|
7
|
+
data.tar.gz: c3642d77288f25120880f3dbd83d922166e7ac5e986cd012fb0b55bf2cf1e269b901a6e81fc74f58297249c25388ef00918fb74255c38c91fdb3a8ab7e49b799
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [0.19.1](https://github.com/bottrall/riffer-rig/compare/v0.19.0...v0.19.1) (2026-11-11)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Bug Fixes
|
|
7
|
+
|
|
8
|
+
* trust rig.rb by content and strip control characters from notices ([#629](https://github.com/bottrall/riffer-rig/issues/629)) ([593a569](https://github.com/bottrall/riffer-rig/commit/593a569f5e4f45699c88d30732fb0fbd7240cb08)), closes [#627](https://github.com/bottrall/riffer-rig/issues/627)
|
|
9
|
+
|
|
3
10
|
## [0.19.0](https://github.com/bottrall/riffer-rig/compare/v0.18.0...v0.19.0) (2026-11-07)
|
|
4
11
|
|
|
5
12
|
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
+
require 'digest'
|
|
4
|
+
|
|
3
5
|
class Riffer::Rig::Loader::ExtensionSource
|
|
4
6
|
EXTENSION_FEATURE = 'riffer/rig/extension'
|
|
5
7
|
|
|
@@ -124,13 +126,15 @@ class Riffer::Rig::Loader::ExtensionSource
|
|
|
124
126
|
decisions = Riffer::Rig::Trust.read(trust_path)
|
|
125
127
|
return decisions if decisions.is_a?(String)
|
|
126
128
|
|
|
129
|
+
sha256 = Digest::SHA256.file(path).hexdigest
|
|
127
130
|
stored = decisions[path]
|
|
128
|
-
return stored
|
|
131
|
+
return stored.trusted if stored && stored.sha256 == sha256
|
|
129
132
|
|
|
130
|
-
|
|
131
|
-
return false if
|
|
133
|
+
answer = @host.confirm("Trust #{path}?") if @host.capabilities.include?(:confirm)
|
|
134
|
+
return false if answer.nil?
|
|
132
135
|
|
|
133
|
-
Riffer::Rig::Trust.
|
|
136
|
+
decision = Riffer::Rig::Trust::Decision.new(sha256: sha256, trusted: answer)
|
|
137
|
+
Riffer::Rig::Trust.store(trust_path, path, decision) || answer
|
|
134
138
|
end
|
|
135
139
|
|
|
136
140
|
# @rbs return: String
|
|
@@ -69,7 +69,7 @@ class Riffer::Rig::Terminal::Renderer
|
|
|
69
69
|
# @rbs text: String
|
|
70
70
|
# @rbs return: String
|
|
71
71
|
def wrapped(text)
|
|
72
|
-
Riffer::Rig::Terminal::TurnReport.wrap(text, @width.call)
|
|
72
|
+
Riffer::Rig::Terminal::TurnReport.wrap(text.gsub(Riffer::Rig::Terminal::Markdown::CONTROL, ''), @width.call)
|
|
73
73
|
end
|
|
74
74
|
|
|
75
75
|
# @rbs text: String
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
class Riffer::Rig::Trust::Decision
|
|
4
|
+
include Riffer::Rig::Support::Equatable
|
|
5
|
+
|
|
6
|
+
# @dynamic sha256, trusted
|
|
7
|
+
attr_reader :sha256 #: String
|
|
8
|
+
attr_reader :trusted #: bool
|
|
9
|
+
|
|
10
|
+
# @rbs sha256: String
|
|
11
|
+
# @rbs trusted: bool
|
|
12
|
+
# @rbs return: void
|
|
13
|
+
def initialize(sha256:, trusted:)
|
|
14
|
+
@sha256 = sha256
|
|
15
|
+
@trusted = trusted
|
|
16
|
+
freeze
|
|
17
|
+
end
|
|
18
|
+
|
|
19
|
+
# @rbs return: Hash[Symbol, untyped]
|
|
20
|
+
def to_h
|
|
21
|
+
{ sha256: sha256, trusted: trusted }
|
|
22
|
+
end
|
|
23
|
+
end
|
data/lib/riffer/rig/trust.rb
CHANGED
|
@@ -4,7 +4,7 @@ module Riffer::Rig::Trust
|
|
|
4
4
|
extend self
|
|
5
5
|
|
|
6
6
|
# @rbs path: String
|
|
7
|
-
# @rbs return: (Hash[String,
|
|
7
|
+
# @rbs return: (Hash[String, Riffer::Rig::Trust::Decision] | String)
|
|
8
8
|
def read(path)
|
|
9
9
|
document = Riffer::Rig::Support::JsonFile.read(path)
|
|
10
10
|
document.is_a?(String) ? document : decisions(document)
|
|
@@ -12,17 +12,29 @@ module Riffer::Rig::Trust
|
|
|
12
12
|
|
|
13
13
|
# @rbs path: String
|
|
14
14
|
# @rbs file: String
|
|
15
|
-
# @rbs decision:
|
|
15
|
+
# @rbs decision: Riffer::Rig::Trust::Decision
|
|
16
16
|
# @rbs return: String?
|
|
17
17
|
def store(path, file, decision)
|
|
18
|
-
Riffer::Rig::Support::JsonFile.update(path)
|
|
18
|
+
Riffer::Rig::Support::JsonFile.update(path) do |document|
|
|
19
|
+
decisions(document).transform_values(&:to_h).merge(file => decision.to_h)
|
|
20
|
+
end
|
|
19
21
|
end
|
|
20
22
|
|
|
21
23
|
private
|
|
22
24
|
|
|
23
25
|
# @rbs document: Hash[untyped, untyped]
|
|
24
|
-
# @rbs return: Hash[String,
|
|
26
|
+
# @rbs return: Hash[String, Riffer::Rig::Trust::Decision]
|
|
25
27
|
def decisions(document)
|
|
26
|
-
document.
|
|
28
|
+
document.filter_map do |file, entry|
|
|
29
|
+
next unless decision?(entry)
|
|
30
|
+
|
|
31
|
+
[file, Riffer::Rig::Trust::Decision.new(sha256: entry['sha256'], trusted: entry['trusted'])]
|
|
32
|
+
end.to_h
|
|
33
|
+
end
|
|
34
|
+
|
|
35
|
+
# @rbs entry: untyped
|
|
36
|
+
# @rbs return: bool
|
|
37
|
+
def decision?(entry)
|
|
38
|
+
entry.is_a?(Hash) && entry['sha256'].is_a?(String) && [true, false].include?(entry['trusted'])
|
|
27
39
|
end
|
|
28
40
|
end
|
data/lib/riffer/rig/version.rb
CHANGED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
# Generated from lib/riffer/rig/trust/decision.rb with RBS::Inline
|
|
2
|
+
|
|
3
|
+
class Riffer::Rig::Trust::Decision
|
|
4
|
+
include Riffer::Rig::Support::Equatable
|
|
5
|
+
|
|
6
|
+
# @dynamic sha256, trusted
|
|
7
|
+
attr_reader sha256: String
|
|
8
|
+
|
|
9
|
+
attr_reader trusted: bool
|
|
10
|
+
|
|
11
|
+
# @rbs sha256: String
|
|
12
|
+
# @rbs trusted: bool
|
|
13
|
+
# @rbs return: void
|
|
14
|
+
def initialize: (sha256: String, trusted: bool) -> void
|
|
15
|
+
|
|
16
|
+
# @rbs return: Hash[Symbol, untyped]
|
|
17
|
+
def to_h: () -> Hash[Symbol, untyped]
|
|
18
|
+
end
|
|
@@ -2,18 +2,22 @@
|
|
|
2
2
|
|
|
3
3
|
module Riffer::Rig::Trust
|
|
4
4
|
# @rbs path: String
|
|
5
|
-
# @rbs return: (Hash[String,
|
|
6
|
-
def read: (String path) -> (Hash[String,
|
|
5
|
+
# @rbs return: (Hash[String, Riffer::Rig::Trust::Decision] | String)
|
|
6
|
+
def read: (String path) -> (Hash[String, Riffer::Rig::Trust::Decision] | String)
|
|
7
7
|
|
|
8
8
|
# @rbs path: String
|
|
9
9
|
# @rbs file: String
|
|
10
|
-
# @rbs decision:
|
|
10
|
+
# @rbs decision: Riffer::Rig::Trust::Decision
|
|
11
11
|
# @rbs return: String?
|
|
12
|
-
def store: (String path, String file,
|
|
12
|
+
def store: (String path, String file, Riffer::Rig::Trust::Decision decision) -> String?
|
|
13
13
|
|
|
14
14
|
private
|
|
15
15
|
|
|
16
16
|
# @rbs document: Hash[untyped, untyped]
|
|
17
|
-
# @rbs return: Hash[String,
|
|
18
|
-
def decisions: (Hash[untyped, untyped] document) -> Hash[String,
|
|
17
|
+
# @rbs return: Hash[String, Riffer::Rig::Trust::Decision]
|
|
18
|
+
def decisions: (Hash[untyped, untyped] document) -> Hash[String, Riffer::Rig::Trust::Decision]
|
|
19
|
+
|
|
20
|
+
# @rbs entry: untyped
|
|
21
|
+
# @rbs return: bool
|
|
22
|
+
def decision?: (untyped entry) -> bool
|
|
19
23
|
end
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: riffer-rig
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.19.
|
|
4
|
+
version: 0.19.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Jake Bottrall
|
|
@@ -15,28 +15,28 @@ dependencies:
|
|
|
15
15
|
requirements:
|
|
16
16
|
- - "~>"
|
|
17
17
|
- !ruby/object:Gem::Version
|
|
18
|
-
version: 0.
|
|
18
|
+
version: 0.14.0
|
|
19
19
|
type: :runtime
|
|
20
20
|
prerelease: false
|
|
21
21
|
version_requirements: !ruby/object:Gem::Requirement
|
|
22
22
|
requirements:
|
|
23
23
|
- - "~>"
|
|
24
24
|
- !ruby/object:Gem::Version
|
|
25
|
-
version: 0.
|
|
25
|
+
version: 0.14.0
|
|
26
26
|
- !ruby/object:Gem::Dependency
|
|
27
27
|
name: base64
|
|
28
28
|
requirement: !ruby/object:Gem::Requirement
|
|
29
29
|
requirements:
|
|
30
30
|
- - "~>"
|
|
31
31
|
- !ruby/object:Gem::Version
|
|
32
|
-
version: '0.
|
|
32
|
+
version: '0.3'
|
|
33
33
|
type: :runtime
|
|
34
34
|
prerelease: false
|
|
35
35
|
version_requirements: !ruby/object:Gem::Requirement
|
|
36
36
|
requirements:
|
|
37
37
|
- - "~>"
|
|
38
38
|
- !ruby/object:Gem::Version
|
|
39
|
-
version: '0.
|
|
39
|
+
version: '0.3'
|
|
40
40
|
- !ruby/object:Gem::Dependency
|
|
41
41
|
name: event_stream_parser
|
|
42
42
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -85,14 +85,14 @@ dependencies:
|
|
|
85
85
|
requirements:
|
|
86
86
|
- - "~>"
|
|
87
87
|
- !ruby/object:Gem::Version
|
|
88
|
-
version: 0.
|
|
88
|
+
version: 0.55.0
|
|
89
89
|
type: :runtime
|
|
90
90
|
prerelease: false
|
|
91
91
|
version_requirements: !ruby/object:Gem::Requirement
|
|
92
92
|
requirements:
|
|
93
93
|
- - "~>"
|
|
94
94
|
- !ruby/object:Gem::Version
|
|
95
|
-
version: 0.
|
|
95
|
+
version: 0.55.0
|
|
96
96
|
- !ruby/object:Gem::Dependency
|
|
97
97
|
name: zeitwerk
|
|
98
98
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -290,6 +290,7 @@ files:
|
|
|
290
290
|
- lib/riffer/rig/tools/read.rb
|
|
291
291
|
- lib/riffer/rig/tools/write.rb
|
|
292
292
|
- lib/riffer/rig/trust.rb
|
|
293
|
+
- lib/riffer/rig/trust/decision.rb
|
|
293
294
|
- lib/riffer/rig/version.rb
|
|
294
295
|
- sig/generated/riffer/rig.rbs
|
|
295
296
|
- sig/generated/riffer/rig/acp.rbs
|
|
@@ -462,6 +463,7 @@ files:
|
|
|
462
463
|
- sig/generated/riffer/rig/tools/read.rbs
|
|
463
464
|
- sig/generated/riffer/rig/tools/write.rbs
|
|
464
465
|
- sig/generated/riffer/rig/trust.rbs
|
|
466
|
+
- sig/generated/riffer/rig/trust/decision.rbs
|
|
465
467
|
- sig/generated/riffer/rig/version.rbs
|
|
466
468
|
- sig/manual/riffer/rig.rbs
|
|
467
469
|
- sig/manual/riffer/rig/acp/mapper.rbs
|