demotape 0.0.5 → 0.0.7
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 +12 -0
- data/README.md +5 -0
- data/editors/sublime-text/DemoTape.sublime-syntax +1 -1
- data/editors/vim/syntax/demotape.vim +1 -1
- data/editors/vscode/demotape.tmLanguage.json +1 -1
- data/editors/zed/tree-sitter/grammar.js +1 -1
- data/lib/demo_tape/cli.rb +7 -1
- data/lib/demo_tape/parser/rules.rb +37 -34
- data/lib/demo_tape/version.rb +1 -1
- metadata +5 -5
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 9703d45771aaa186b951e020ed1f30f6eb0ef4c12aa9de87a55cc6b229dacb07
|
|
4
|
+
data.tar.gz: 3f16d0099cffbc04e345c062e04c176dcec891063177bcdb2850056b2f24d29f
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: e71e511638f3bb46d93bc332f79df365c9a80e5a6daef615500685a1f9e5a7760e37bbb7e0f2faf333a5a439685439defe0140baab13fdbcf2119d8ac718871f
|
|
7
|
+
data.tar.gz: d563b7107de203799897fcf840f045f8d73b009a7e9a60c54f16f55f61b0570accfbe656756603abb32a845aaed304fc7151a911103bdd273197ad42efa82099
|
data/CHANGELOG.md
CHANGED
|
@@ -11,6 +11,18 @@ Prefix your message with one of the following:
|
|
|
11
11
|
- [Security] in case of vulnerabilities.
|
|
12
12
|
-->
|
|
13
13
|
|
|
14
|
+
## v0.0.7
|
|
15
|
+
|
|
16
|
+
- [Fixed] Fix key combos that had numbers in them not being recognized.
|
|
17
|
+
|
|
18
|
+
## v0.0.6
|
|
19
|
+
|
|
20
|
+
- [Added] Add `demotape run --working-dir` to specify the working directory for
|
|
21
|
+
commands. Notice that this changes all path references to be relative to the
|
|
22
|
+
working directory, including `--output-path` (if it's a relative path).
|
|
23
|
+
- [Fixed] Fix issue where `Set typing_speed` wasn't recognized.
|
|
24
|
+
- [Fixed] Fix issue where `Set shell` wasn't recognized.
|
|
25
|
+
|
|
14
26
|
## v0.0.5
|
|
15
27
|
|
|
16
28
|
- [Changed] Add newline to multiline strings if they don't end with one.
|
data/README.md
CHANGED
|
@@ -109,6 +109,11 @@ $ echo "Type 'echo \"it works with stdin too\"'\nEnter\nSleep 5" | \
|
|
|
109
109
|
info Finished in 11.92s
|
|
110
110
|
```
|
|
111
111
|
|
|
112
|
+
> [!TIP]
|
|
113
|
+
>
|
|
114
|
+
> Notice that when using `--working-dir`, all path references will be relative
|
|
115
|
+
> to the working directory, including `--output-path`.
|
|
116
|
+
|
|
112
117
|
### Output formats
|
|
113
118
|
|
|
114
119
|
- When exporting videos, you can choose between `.mp4`, `.webm` or `.avi`.
|
|
@@ -32,7 +32,7 @@ syn match demotapeKey "\<Numpad[0-9]\>"
|
|
|
32
32
|
syn match demotapeKey "\<F\([1-9]\|1[0-2]\)\>"
|
|
33
33
|
|
|
34
34
|
" Modifiers
|
|
35
|
-
syn keyword demotapeModifier Ctrl Control Alt Option Shift Meta Command
|
|
35
|
+
syn keyword demotapeModifier Ctrl Control Alt Option Shift Meta Command Cmd
|
|
36
36
|
|
|
37
37
|
" Key combination operator
|
|
38
38
|
syn match demotapeOperator "+"
|
|
@@ -187,7 +187,7 @@ module.exports = grammar({
|
|
|
187
187
|
),
|
|
188
188
|
|
|
189
189
|
modifier_key: $ => choice(
|
|
190
|
-
'Ctrl', 'Control', 'Alt', 'Option', 'Shift', 'Meta', 'Command'
|
|
190
|
+
'Ctrl', 'Control', 'Alt', 'Option', 'Shift', 'Meta', 'Command', 'Cmd'
|
|
191
191
|
),
|
|
192
192
|
|
|
193
193
|
letter_key: $ => /[A-Za-z0-9]/,
|
data/lib/demo_tape/cli.rb
CHANGED
|
@@ -13,6 +13,10 @@ module DemoTape
|
|
|
13
13
|
end
|
|
14
14
|
|
|
15
15
|
desc "run PATH", "Runs a demo tape"
|
|
16
|
+
option :working_dir,
|
|
17
|
+
type: :string,
|
|
18
|
+
desc: "Working directory to run the commands in",
|
|
19
|
+
default: Dir.pwd
|
|
16
20
|
option :typing_speed,
|
|
17
21
|
type: :string,
|
|
18
22
|
default: "50ms",
|
|
@@ -158,7 +162,9 @@ module DemoTape
|
|
|
158
162
|
content = File.read(file_path)
|
|
159
163
|
end
|
|
160
164
|
|
|
161
|
-
|
|
165
|
+
Dir.chdir(options.working_dir) do
|
|
166
|
+
Runner.new(file_path:, content:, thor: shell, options:).run
|
|
167
|
+
end
|
|
162
168
|
end
|
|
163
169
|
|
|
164
170
|
desc "themes", "Lists available built-in themes"
|
|
@@ -42,12 +42,26 @@ module DemoTape
|
|
|
42
42
|
results.any?
|
|
43
43
|
end
|
|
44
44
|
|
|
45
|
+
def |(other)
|
|
46
|
+
Any.new(self, other)
|
|
47
|
+
end
|
|
48
|
+
|
|
45
49
|
def +(other)
|
|
46
50
|
expectations << other
|
|
47
51
|
self
|
|
48
52
|
end
|
|
49
53
|
end
|
|
50
54
|
|
|
55
|
+
class Any
|
|
56
|
+
def initialize(*types)
|
|
57
|
+
@types = types
|
|
58
|
+
end
|
|
59
|
+
|
|
60
|
+
def valid?(*)
|
|
61
|
+
@types.any? { it.valid?(*) }
|
|
62
|
+
end
|
|
63
|
+
end
|
|
64
|
+
|
|
51
65
|
class Duration
|
|
52
66
|
include Helpers
|
|
53
67
|
|
|
@@ -232,50 +246,38 @@ module DemoTape
|
|
|
232
246
|
# Group invocations
|
|
233
247
|
rules.push identifier(/^[a-z0-9_]+$/)
|
|
234
248
|
|
|
249
|
+
key = identifier(*Command::VALID_KEYS) | number
|
|
250
|
+
|
|
235
251
|
# KEY+KEY
|
|
252
|
+
rules.push identifier(*Command::KEY_MAPPING.keys) + operator("+") + key
|
|
236
253
|
rules.push identifier(*Command::KEY_MAPPING.keys) +
|
|
237
254
|
operator("+") +
|
|
238
|
-
|
|
255
|
+
key +
|
|
256
|
+
number
|
|
239
257
|
|
|
240
258
|
# KEY+KEY+KEY
|
|
241
259
|
rules.push identifier(*Command::KEY_MAPPING.keys) +
|
|
242
260
|
operator("+") +
|
|
243
|
-
|
|
244
|
-
operator("+") +
|
|
245
|
-
identifier(*Command::VALID_KEYS)
|
|
246
|
-
|
|
247
|
-
# KEY+KEY+KEY+KEY
|
|
248
|
-
rules.push identifier(*Command::KEY_MAPPING.keys) +
|
|
249
|
-
operator("+") +
|
|
250
|
-
identifier(*Command::VALID_KEYS) +
|
|
251
|
-
operator("+") +
|
|
252
|
-
identifier(*Command::VALID_KEYS) +
|
|
261
|
+
key +
|
|
253
262
|
operator("+") +
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
# KEY+KEY COUNT
|
|
257
|
-
rules.push identifier(*Command::KEY_MAPPING.keys) +
|
|
258
|
-
operator("+") +
|
|
259
|
-
identifier(*Command::VALID_KEYS) +
|
|
260
|
-
number
|
|
261
|
-
|
|
262
|
-
# KEY+KEY+KEY COUNT
|
|
263
|
+
key
|
|
263
264
|
rules.push identifier(*Command::KEY_MAPPING.keys) +
|
|
264
265
|
operator("+") +
|
|
265
|
-
|
|
266
|
+
key +
|
|
266
267
|
operator("+") +
|
|
267
|
-
|
|
268
|
+
key +
|
|
268
269
|
number
|
|
269
270
|
|
|
270
|
-
# KEY+KEY+KEY+KEY
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
271
|
+
# KEY+KEY+KEY+KEY
|
|
272
|
+
key_combo = identifier(*Command::KEY_MAPPING.keys) +
|
|
273
|
+
operator("+") +
|
|
274
|
+
key +
|
|
275
|
+
operator("+") +
|
|
276
|
+
key +
|
|
277
|
+
operator("+") +
|
|
278
|
+
key
|
|
279
|
+
rules.push key_combo
|
|
280
|
+
rules.push key_combo.dup + number
|
|
279
281
|
|
|
280
282
|
# COMMAND
|
|
281
283
|
rules.push identifier(
|
|
@@ -335,7 +337,8 @@ module DemoTape
|
|
|
335
337
|
|
|
336
338
|
# Set attribute DURATION
|
|
337
339
|
rules.push identifier("Set") +
|
|
338
|
-
identifier("loop_delay", "run_sleep", "run_enter_delay"
|
|
340
|
+
identifier("loop_delay", "run_sleep", "run_enter_delay",
|
|
341
|
+
"typing_speed") +
|
|
339
342
|
duration
|
|
340
343
|
|
|
341
344
|
# Set attribute BOOLEAN
|
|
@@ -347,12 +350,12 @@ module DemoTape
|
|
|
347
350
|
rules.push identifier("Set") +
|
|
348
351
|
identifier("width", "height", "cursor_width", "font_size",
|
|
349
352
|
"padding", "margin", "loop_delay", "line_height",
|
|
350
|
-
"border_radius") +
|
|
353
|
+
"border_radius", "typing_speed") +
|
|
351
354
|
number
|
|
352
355
|
|
|
353
356
|
# Set attribute STRING
|
|
354
357
|
rules.push identifier("Set") +
|
|
355
|
-
identifier("theme", "font_family", "margin_fill") +
|
|
358
|
+
identifier("theme", "font_family", "margin_fill", "shell") +
|
|
356
359
|
string
|
|
357
360
|
|
|
358
361
|
# Set cursor_style STRING
|
data/lib/demo_tape/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: demotape
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.0.
|
|
4
|
+
version: 0.0.7
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Nando Vieira
|
|
@@ -691,10 +691,10 @@ metadata:
|
|
|
691
691
|
rubygems_mfa_required: 'true'
|
|
692
692
|
homepage_uri: https://github.com/fnando/demotape
|
|
693
693
|
bug_tracker_uri: https://github.com/fnando/demotape/issues
|
|
694
|
-
source_code_uri: https://github.com/fnando/demotape/tree/v0.0.
|
|
695
|
-
changelog_uri: https://github.com/fnando/demotape/tree/v0.0.
|
|
696
|
-
documentation_uri: https://github.com/fnando/demotape/tree/v0.0.
|
|
697
|
-
license_uri: https://github.com/fnando/demotape/tree/v0.0.
|
|
694
|
+
source_code_uri: https://github.com/fnando/demotape/tree/v0.0.7
|
|
695
|
+
changelog_uri: https://github.com/fnando/demotape/tree/v0.0.7/CHANGELOG.md
|
|
696
|
+
documentation_uri: https://github.com/fnando/demotape/tree/v0.0.7/README.md
|
|
697
|
+
license_uri: https://github.com/fnando/demotape/tree/v0.0.7/LICENSE.md
|
|
698
698
|
rdoc_options: []
|
|
699
699
|
require_paths:
|
|
700
700
|
- lib
|