screenkit 0.0.12 → 0.0.13

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: cd0de2fa10f13914e8b0f2b9d8f0f1e295e4d964d54c7e8c045f7a5dc3b7e031
4
- data.tar.gz: e16a92ffb88856e3cf482bd9ae1eb5f99d8785a73e632e92b5ad37c688e87f5e
3
+ metadata.gz: 6c5c78d98545b9e48cef700afe1aada9ea8ec2ff71c1e6245ae6bf7fb6aa32e3
4
+ data.tar.gz: 88e66ce7b3936b5298a46718f7ed0851fe609bdaad7337afdeba818b390c8006
5
5
  SHA512:
6
- metadata.gz: b20e2485811c2cd0321251e2e2ea0d7f4402df4979be44bf269ea9fbe71da79d7963146ec39d5634718ef6bc6011887948acafffdcf361c0db172d81455417e6
7
- data.tar.gz: 0465a5f3f7b623021b510cd16e8bc927c58e0db8cbc3479363c5b87f5b545d43f969866244ea862875f3f65f4596fa02b223e22fe1056afd0acc50a832c1cab0
6
+ metadata.gz: b8e9a7bb7db412939e9cb41653a24672f69b0e54f8a4cc841116d51c6e6b541507fc36b26473e6f56547d3c9f9edb24f01242944d0021d3646bed4855b769d68
7
+ data.tar.gz: 9943a2ef7bb19830590ddc57d50f4a8da5d53cde8751eb79d4956591864e6ad7f72eebc459715f25b116df5de0b484ffbd6eb0d4a94b1d95cfff412ee4a5acba
data/CHANGELOG.md CHANGED
@@ -11,6 +11,10 @@ Prefix your message with one of the following:
11
11
  - [Security] in case of vulnerabilities.
12
12
  -->
13
13
 
14
+ ## v0.0.13
15
+
16
+ - [Fixed] Redact API key in config log.
17
+
14
18
  ## v0.0.12
15
19
 
16
20
  - [Fixed] Fix how configuration is merged.
@@ -4,6 +4,7 @@ module ScreenKit
4
4
  module Exporter
5
5
  class Episode
6
6
  using CoreExt
7
+ include RedactFile
7
8
  include Utils
8
9
  include Shell
9
10
 
@@ -401,10 +402,11 @@ module ScreenKit
401
402
 
402
403
  # Logs initial information about the episode export process.
403
404
  def prelude
404
- logfile.json_log(
405
+ path = logfile.json_log(
405
406
  :config,
406
- options.merge(pwd: Dir.pwd, config:)
407
+ options.merge(pwd: Dir.pwd, config: config.as_json)
407
408
  )
409
+ redact_file(path, options.tts_api_key)
408
410
 
409
411
  log(
410
412
  :info,
@@ -74,7 +74,7 @@ module ScreenKit
74
74
  .new(
75
75
  script_path: content_path,
76
76
  options: episode.playwright_options,
77
- log_path:,
77
+ log_path:
78
78
  )
79
79
  .export(video_path)
80
80
  when *ContentType.video
@@ -2,7 +2,10 @@
2
2
 
3
3
  module ScreenKit
4
4
  module HTTP
5
+ include RedactFile
6
+
5
7
  # Sends a POST request.
8
+ #
6
9
  # @param url [String] The request URL.
7
10
  # @param params [Hash] The request parameters.
8
11
  # @param headers [Hash] The request headers.
@@ -32,6 +35,7 @@ module ScreenKit
32
35
  end
33
36
 
34
37
  # Sends a JSON POST request.
38
+ #
35
39
  # @param url [String] The request URL.
36
40
  # @param params [Hash] The request parameters.
37
41
  # @param headers [Hash] The request headers.
@@ -42,17 +46,5 @@ module ScreenKit
42
46
  headers = headers.merge(content_type: "application/json")
43
47
  post(headers:, **)
44
48
  end
45
-
46
- # Redacts sensitive text from a file.
47
- # @param path [String] The file path.
48
- # @param text [String] The text to redact.
49
- # @return [void]
50
- def redact_file(path, text)
51
- return unless path
52
- return unless File.file?(path)
53
-
54
- content = File.read(path).gsub(text, "[REDACTED]")
55
- File.write(path, content)
56
- end
57
49
  end
58
50
  end
@@ -23,6 +23,7 @@ module ScreenKit
23
23
  path = create(*args)
24
24
  FileUtils.mkdir_p(File.dirname(path))
25
25
  File.open(path, "w") { it << message.to_s }
26
+ path
26
27
  end
27
28
 
28
29
  def json_log(*args)
@@ -0,0 +1,17 @@
1
+ # frozen_string_literal: true
2
+
3
+ module ScreenKit
4
+ module RedactFile
5
+ # Redacts sensitive text from a file.
6
+ # @param path [String] The file path.
7
+ # @param text [String] The text to redact.
8
+ # @return [void]
9
+ def redact_file(path, text)
10
+ return unless path
11
+ return unless File.file?(path)
12
+
13
+ content = File.read(path).gsub(text, "[REDACTED]")
14
+ File.write(path, content)
15
+ end
16
+ end
17
+ end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module ScreenKit
4
- VERSION = "0.0.12"
4
+ VERSION = "0.0.13"
5
5
  end
data/lib/screenkit.rb CHANGED
@@ -18,6 +18,7 @@ module ScreenKit
18
18
  require_relative "screenkit/duration"
19
19
  require_relative "screenkit/core_ext"
20
20
  require_relative "screenkit/content_type"
21
+ require_relative "screenkit/redact_file"
21
22
  require_relative "screenkit/anchor"
22
23
  require_relative "screenkit/banner"
23
24
  require_relative "screenkit/time_formatter"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: screenkit
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.12
4
+ version: 0.0.13
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nando Vieira
@@ -348,6 +348,7 @@ files:
348
348
  - lib/screenkit/logfile.rb
349
349
  - lib/screenkit/parallel_processor.rb
350
350
  - lib/screenkit/path_lookup.rb
351
+ - lib/screenkit/redact_file.rb
351
352
  - lib/screenkit/resources/callout_styles/social/blog.png
352
353
  - lib/screenkit/resources/callout_styles/social/bsky.png
353
354
  - lib/screenkit/resources/callout_styles/social/discord.png
@@ -420,10 +421,10 @@ metadata:
420
421
  rubygems_mfa_required: 'true'
421
422
  homepage_uri: https://github.com/fnando/screenkit
422
423
  bug_tracker_uri: https://github.com/fnando/screenkit/issues
423
- source_code_uri: https://github.com/fnando/screenkit/tree/v0.0.12
424
- changelog_uri: https://github.com/fnando/screenkit/tree/v0.0.12/CHANGELOG.md
425
- documentation_uri: https://github.com/fnando/screenkit/tree/v0.0.12/README.md
426
- license_uri: https://github.com/fnando/screenkit/tree/v0.0.12/LICENSE.md
424
+ source_code_uri: https://github.com/fnando/screenkit/tree/v0.0.13
425
+ changelog_uri: https://github.com/fnando/screenkit/tree/v0.0.13/CHANGELOG.md
426
+ documentation_uri: https://github.com/fnando/screenkit/tree/v0.0.13/README.md
427
+ license_uri: https://github.com/fnando/screenkit/tree/v0.0.13/LICENSE.md
427
428
  rdoc_options: []
428
429
  require_paths:
429
430
  - lib