screenkit 0.0.11 → 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: b46db7b67fdb83851578e20864e338d1317eb0c86b2d9498cbde1163742ad0bc
4
- data.tar.gz: 7216d1335b3031308fffb8d65f9cb64aed60736248f1028bb1dbe802d9ca6e41
3
+ metadata.gz: 6c5c78d98545b9e48cef700afe1aada9ea8ec2ff71c1e6245ae6bf7fb6aa32e3
4
+ data.tar.gz: 88e66ce7b3936b5298a46718f7ed0851fe609bdaad7337afdeba818b390c8006
5
5
  SHA512:
6
- metadata.gz: 66c8b5c9cca753d9096af780a12f95e5ac30fd46bd978e6070505565c780493eded3e6bad4bc6d300f69a20cee2c2dca94ab73f8690c02572b826befa8714139
7
- data.tar.gz: 85951fb67485665ce3898d3e1130d8363467f896474e5ed901c3b177e7cfd059fd4ed5b47043a0c598f48b4a64d627abc1179ab2cf68d865a9fd7422a009ab6c
6
+ metadata.gz: b8e9a7bb7db412939e9cb41653a24672f69b0e54f8a4cc841116d51c6e6b541507fc36b26473e6f56547d3c9f9edb24f01242944d0021d3646bed4855b769d68
7
+ data.tar.gz: 9943a2ef7bb19830590ddc57d50f4a8da5d53cde8751eb79d4956591864e6ad7f72eebc459715f25b116df5de0b484ffbd6eb0d4a94b1d95cfff412ee4a5acba
data/CHANGELOG.md CHANGED
@@ -11,6 +11,15 @@ 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
+
18
+ ## v0.0.12
19
+
20
+ - [Fixed] Fix how configuration is merged.
21
+ - [Fixed] Fix how extensions are loaded.
22
+
14
23
  ## v0.0.11
15
24
 
16
25
  - [Added] Add support for playwright scripts, so you can have browser-based
data/Dockerfile CHANGED
@@ -48,6 +48,8 @@ RUN apk add --no-cache \
48
48
  jq \
49
49
  less \
50
50
  mesa-gl \
51
+ nodejs \
52
+ npm \
51
53
  nss \
52
54
  python3 \
53
55
  py3-pip \
@@ -61,9 +63,14 @@ RUN apk add --no-cache \
61
63
 
62
64
  ARG USER=screenkit
63
65
  ENV TERM=xterm-256color
64
- ENV PATH="/venv/bin:/source/bin:/${USER}/bin:$PATH"
66
+ ENV GEM_HOME=/usr/local/bundle
67
+ ENV BUNDLE_PATH=/usr/local/bundle
68
+ ENV PATH="/usr/local/bundle/bin:/venv/bin:/source/bin:/${USER}/bin:$PATH"
65
69
  ENV CHROME_BIN=/usr/bin/chromium-browser
66
70
  ENV CHROME_PATH=/usr/lib/chromium/
71
+ ENV PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD=1
72
+ ENV PLAYWRIGHT_BROWSERS_PATH=0
73
+ ENV FFMPEG_BIN=/usr/bin/ffmpeg
67
74
 
68
75
  # Copy binaries and fonts from builder stages
69
76
  COPY --from=binaries /bin-download/slides /usr/local/bin/slides
@@ -85,7 +92,7 @@ RUN mkdir -p /venv && chown -R ${USER}:${USER} /venv
85
92
  RUN mkdir -p /${USER}-local && chown -R ${USER}:${USER} /${USER}-local
86
93
 
87
94
  # Install screenkit gem
88
- RUN gem install screenkit && \
95
+ RUN gem install screenkit screenkit-tts-google screenkit-tts-minimax && \
89
96
  mkdir -p /usr/share/bash-completion/completions && \
90
97
  mkdir -p /usr/share/zsh/site-functions && \
91
98
  mkdir -p /usr/share/fish/vendor_completions.d && \
@@ -96,6 +103,9 @@ RUN gem install screenkit && \
96
103
  echo 'source /usr/share/bash-completion/bash_completion' >> /etc/bash/bashrc && \
97
104
  apk del build-base
98
105
 
106
+ # Install playwright-video globally
107
+ RUN npm install -g @fnando/playwright-video
108
+
99
109
  USER ${USER}
100
110
  WORKDIR /${USER}
101
111
 
@@ -90,7 +90,7 @@ module ScreenKit
90
90
  !options.overwrite_voiceover
91
91
 
92
92
  exporter = ScreenKit::Exporter::Episode.new(
93
- config: Config.load(**project_config.deep_merge(**episode_config)),
93
+ config: Config.load(project_config.deep_merge(episode_config)),
94
94
  options:
95
95
  )
96
96
 
@@ -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.11"
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"
@@ -56,7 +57,7 @@ module ScreenKit
56
57
  require_relative "screenkit/exporter/playwright"
57
58
 
58
59
  require_files = lambda do |pattern|
59
- Gem.find_files_from_load_path(pattern).each do |path|
60
+ Gem.find_files(pattern).each do |path|
60
61
  next if path.include?("test")
61
62
 
62
63
  require(path)
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.11
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.11
424
- changelog_uri: https://github.com/fnando/screenkit/tree/v0.0.11/CHANGELOG.md
425
- documentation_uri: https://github.com/fnando/screenkit/tree/v0.0.11/README.md
426
- license_uri: https://github.com/fnando/screenkit/tree/v0.0.11/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