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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 84303594a4521d8a9a93283732affcdc8832b7ae4483e1f9aa1af219003d35be
4
- data.tar.gz: ba13a8233cf612c716432f0fcdb98157b286c9790686dc46f739708c1ebec91c
3
+ metadata.gz: e7c51635053eb1a1e97fa5b9ad67882501388597a1c1254a3cdd07826de4de0c
4
+ data.tar.gz: b19017147fb580390f31cf210bfb5ee451845a2e908a5c610d9b4a44b1013f9a
5
5
  SHA512:
6
- metadata.gz: d6a70bb1ea3bb681793ae54066af65a143b345cc0ca446a57012e6e562a21816b01c38e8d7ec3188c59c50484ee376fa09b225df6e2feb9b47fefcfca5dabc76
7
- data.tar.gz: 47ea2519a20ce680dc1d2ef5c1d1e4473e013fce48a4bf6ca14e62bc6f6293eedd8fa533a97dc389717e5600d832c8781fbedf31c14259befcc5281bcc667793
6
+ metadata.gz: 0f1ecfa2e48a464eed2fdc316d3e8f56fa41942b3d3b8297738850f063c4809d1c7da3243f8d8401fc8c9a9cd8e9a0e2656c043e59d4de9dd8a17a46075e0953
7
+ data.tar.gz: d2562942691900f803d7f78f8c0f4e5fe4935c12f9f0c6fae954cdd4462ea0ee856fafb609596b73ef0e9302353e70661010df9d1e5dd2595b1b1e2b1e81d7ba
data/README.md CHANGED
@@ -1,8 +1,7 @@
1
- # SnippetCli
1
+ # snippet_cli
2
+ [![Gem Version](https://badge.fury.io/rb/snippet_cli.svg)](https://badge.fury.io/rb/snippet_cli)
2
3
 
3
- Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/snippet_cli`. To experiment with that code, run `bin/console` for an interactive prompt.
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. Do not use rbenv, rvm, asdf, or Homebrew Ruby.
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 vendored
8
- # merged schema at vendor/espanso-schema-json/schemas/Espanso_Merged_Matchfile_Schema.json.
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 { !it.empty? }
62
- lines << " comment: #{YamlScalar.quote(opts[:comment])}" if opts[:comment]&.then { !it.empty? }
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
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module SnippetCli
4
- VERSION = '0.5.2'
4
+ VERSION = '0.5.3'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: snippet_cli
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.2
4
+ version: 0.5.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - AJ Markow