demotape 0.0.6 → 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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e3798bd4179968cb52b8665fee05eb4195be7ec98898bb1bbfd881f44f79c59d
4
- data.tar.gz: 714db5cf0c410162b7aff172f6b4b1175ff3cfff4e3e001943429a53dd7ac372
3
+ metadata.gz: 9703d45771aaa186b951e020ed1f30f6eb0ef4c12aa9de87a55cc6b229dacb07
4
+ data.tar.gz: 3f16d0099cffbc04e345c062e04c176dcec891063177bcdb2850056b2f24d29f
5
5
  SHA512:
6
- metadata.gz: 2fc9f8b39e9c07ece1effff7b412242d64c31af62e0a9e33011556f390c0e2a15ec0f51005250dbf7eaa8799b47ac07cf533695447271fa197b6501ea4102a53
7
- data.tar.gz: 96125fe7e9ddf9a702b4857ec4780776fb98c4d971110d7a4ac9e9cf30f04f67745ad0c07ca733108655c244e0efbad48a0c13a99eace8e52802547c6d050adc
6
+ metadata.gz: e71e511638f3bb46d93bc332f79df365c9a80e5a6daef615500685a1f9e5a7760e37bbb7e0f2faf333a5a439685439defe0140baab13fdbcf2119d8ac718871f
7
+ data.tar.gz: d563b7107de203799897fcf840f045f8d73b009a7e9a60c54f16f55f61b0570accfbe656756603abb32a845aaed304fc7151a911103bdd273197ad42efa82099
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.7
15
+
16
+ - [Fixed] Fix key combos that had numbers in them not being recognized.
17
+
14
18
  ## v0.0.6
15
19
 
16
20
  - [Added] Add `demotape run --working-dir` to specify the working directory for
@@ -85,7 +85,7 @@ contexts:
85
85
  push: possible_key_count
86
86
 
87
87
  # Modifiers
88
- - match: '\b(Ctrl|Control|Alt|Option|Shift|Meta|Command)\b'
88
+ - match: '\b(Ctrl|Control|Alt|Option|Shift|Meta|Command|Cmd)\b'
89
89
  scope: keyword.control.demotape
90
90
  push: key_combo
91
91
 
@@ -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 "+"
@@ -95,7 +95,7 @@
95
95
  },
96
96
  {
97
97
  "comment": "Modifiers",
98
- "match": "\\b(Ctrl|Control|Alt|Option|Shift|Meta|Command)\\b",
98
+ "match": "\\b(Ctrl|Control|Alt|Option|Shift|Meta|Command|Cmd)\\b",
99
99
  "name": "keyword.control.demotape"
100
100
  },
101
101
  {
@@ -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]/,
@@ -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
- identifier(*Command::VALID_KEYS)
255
+ key +
256
+ number
239
257
 
240
258
  # KEY+KEY+KEY
241
259
  rules.push identifier(*Command::KEY_MAPPING.keys) +
242
260
  operator("+") +
243
- identifier(*Command::VALID_KEYS) +
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
- identifier(*Command::VALID_KEYS)
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
- identifier(*Command::VALID_KEYS) +
266
+ key +
266
267
  operator("+") +
267
- identifier(*Command::VALID_KEYS) +
268
+ key +
268
269
  number
269
270
 
270
- # KEY+KEY+KEY+KEY COUNT
271
- rules.push identifier(*Command::KEY_MAPPING.keys) +
272
- operator("+") +
273
- identifier(*Command::VALID_KEYS) +
274
- operator("+") +
275
- identifier(*Command::VALID_KEYS) +
276
- operator("+") +
277
- identifier(*Command::VALID_KEYS) +
278
- number
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(
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module DemoTape
4
- VERSION = "0.0.6"
4
+ VERSION = "0.0.7"
5
5
  end
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.6
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.6
695
- changelog_uri: https://github.com/fnando/demotape/tree/v0.0.6/CHANGELOG.md
696
- documentation_uri: https://github.com/fnando/demotape/tree/v0.0.6/README.md
697
- license_uri: https://github.com/fnando/demotape/tree/v0.0.6/LICENSE.md
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