snippet_cli 0.5.2 → 0.5.3
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/README.md +4 -5
- data/lib/snippet_cli/match_validator.rb +2 -2
- data/lib/snippet_cli/snippet_builder.rb +2 -2
- data/lib/snippet_cli/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: e7c51635053eb1a1e97fa5b9ad67882501388597a1c1254a3cdd07826de4de0c
|
|
4
|
+
data.tar.gz: b19017147fb580390f31cf210bfb5ee451845a2e908a5c610d9b4a44b1013f9a
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 0f1ecfa2e48a464eed2fdc316d3e8f56fa41942b3d3b8297738850f063c4809d1c7da3243f8d8401fc8c9a9cd8e9a0e2656c043e59d4de9dd8a17a46075e0953
|
|
7
|
+
data.tar.gz: d2562942691900f803d7f78f8c0f4e5fe4935c12f9f0c6fae954cdd4462ea0ee856fafb609596b73ef0e9302353e70661010df9d1e5dd2595b1b1e2b1e81d7ba
|
data/README.md
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
#
|
|
1
|
+
# snippet_cli
|
|
2
|
+
[](https://badge.fury.io/rb/snippet_cli)
|
|
2
3
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
TODO: Delete this and the text above, and describe your gem
|
|
4
|
+
snippet_cli is a gem for generating valid yaml configurations for snippets for the program Espanso. Additionally, it includes a few espanso related utilities, like commands to check your matchfile for validity against the Espanso schema, or for conflicting triggers in your matchfile.
|
|
6
5
|
|
|
7
6
|
## Installation
|
|
8
7
|
|
|
@@ -16,7 +15,7 @@ TODO: Write usage instructions here
|
|
|
16
15
|
|
|
17
16
|
## Development
|
|
18
17
|
|
|
19
|
-
This project uses [devenv](https://devenv.sh) (Nix-based) for environment management.
|
|
18
|
+
This project uses [devenv](https://devenv.sh) (Nix-based) for environment management.
|
|
20
19
|
|
|
21
20
|
### First-time setup
|
|
22
21
|
|
|
@@ -4,8 +4,8 @@ require_relative 'hash_utils'
|
|
|
4
4
|
require_relative 'schema_validator'
|
|
5
5
|
|
|
6
6
|
module SnippetCli
|
|
7
|
-
# Validates an Espanso match entry (as a Ruby hash) against the
|
|
8
|
-
#
|
|
7
|
+
# Validates an Espanso match entry (as a Ruby hash) against the merged
|
|
8
|
+
# schema embedded at lib/snippet_cli/Espanso_Merged_Matchfile_Schema.json.
|
|
9
9
|
# Uses json_schemer which supports JSON Schema draft-07 (required for
|
|
10
10
|
# the if/then conditionals used in the Espanso match schema).
|
|
11
11
|
module MatchValidator
|
|
@@ -58,8 +58,8 @@ module SnippetCli
|
|
|
58
58
|
private_class_method :append_optional_fields
|
|
59
59
|
|
|
60
60
|
def self.append_label_and_comment(lines, opts)
|
|
61
|
-
lines << " label: #{YamlScalar.quote(opts[:label])}" if opts[:label]&.then { !
|
|
62
|
-
lines << " comment: #{YamlScalar.quote(opts[:comment])}" if opts[:comment]&.then { !
|
|
61
|
+
lines << " label: #{YamlScalar.quote(opts[:label])}" if opts[:label]&.then { |v| !v.empty? }
|
|
62
|
+
lines << " comment: #{YamlScalar.quote(opts[:comment])}" if opts[:comment]&.then { |v| !v.empty? }
|
|
63
63
|
end
|
|
64
64
|
private_class_method :append_label_and_comment
|
|
65
65
|
|
data/lib/snippet_cli/version.rb
CHANGED