snibbets 2.0.34 → 2.0.36

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 4bfb107dedc2d689ec1ed371dcaf1ef7fb240218af43831856acb552789a0ce2
4
- data.tar.gz: 482355a0c4a27d707d92633c47adeb2be0db027a37311412cb903f7d47cdb0b6
3
+ metadata.gz: 8af73f9a7562bdf02e3219d15befffbee9c105181469502bec9fa4901bfbb26c
4
+ data.tar.gz: c315a562318df15e8d577fcaf7912b8142c7697f7c31dc014c616bcfe1d5d869
5
5
  SHA512:
6
- metadata.gz: 40afbc2d33dc562db0e5e21ec7fe40fc10872f279c1bc95b67deb6aac9cff90e663abc0100e49c2a08ea4500e0e2eb4f442bcf34259a54b0b901cf53c883c7ce
7
- data.tar.gz: 072cccc7e2c90dc557f4af25b9338a7cec21b00c0545b5155b07f413d6560b7d964008a8919a638b0c0b67089ccd12d568951c314c75c29d896694a3de45e19e
6
+ metadata.gz: f50419c0a66be0d46c6edf7aebe94554fcbd6630e046ad2977dddbeec66bdd43387ea556583028aebbd00433e060656e16eae4b9715efaba28db476dc92c06b5
7
+ data.tar.gz: 6de5b9b12cee67ca033b75bd81c0c2930d4880ab21920dd86ffa4da2cbe989f654f48048d115a53128ad4c36fe6366fbce27b5605269129c3df3f513e994342e
data/CHANGELOG.md CHANGED
@@ -1,293 +1,12 @@
1
- ### 2.0.34
1
+ ### 2.0.36
2
2
 
3
- 2023-06-17 09:17
3
+ 2024-04-08 14:25
4
4
 
5
5
  #### IMPROVED
6
6
 
7
- - If a section of a snippet contains no code blocks, output the whole thing
7
+ - Use name: instead of filename: for limiting by extension,
8
+ - Remove tag: from searches when resorting to find or grep
8
9
 
9
- #### FIXED
10
+ ### 1.0.0
10
11
 
11
- - Correct error if searching name only and no results are returned
12
-
13
- ### 2.0.33
14
-
15
- 2023-04-26 10:23
16
-
17
- #### IMPROVED
18
-
19
- - More coloring for prompts and messages
20
- - Colorize headers in multi-snippet output
21
- - If skylighting highlighting is enabled and the specified
22
- - Add some normalization for some skylighting lexers
23
-
24
- #### FIXED
25
-
26
- - Highlighting returns empty if language contains non-alphanumeric characters
27
-
28
- ### 2.0.32
29
-
30
- 2023-04-25 17:14
31
-
32
- #### FIXED
33
-
34
- - Don't highlight code sent to `--copy`
35
-
36
- ### 2.0.31
37
-
38
- 2023-04-20 10:20
39
-
40
- #### IMPROVED
41
-
42
- - Syntax highlight blocks individually, so multiple languages can exist within one snippet
43
- - If outputting notes, wrap code in backticks to differentiate
44
-
45
- #### FIXED
46
-
47
- - Handle cases where snippet contains `\k<name>` and breaks regex replacement even with Regexp.escape
48
- - Remove fences from single snippet when not syntax highlighting
49
-
50
- ### 2.0.30
51
-
52
- 2023-04-19 06:44
53
-
54
- #### NEW
55
-
56
- - Added `--notes` option and accompanying `all_notes` config option to allow display of all notes instead of just code blocks in each snippet
57
-
58
- #### IMPROVED
59
-
60
- - Previously if multiple snippets were output, titles of snippets would go to STDERR so they weren't copied. Now they go to STDOUT as well.
61
-
62
- ### 2.0.29
63
-
64
- 2023-04-18 10:45
65
-
66
- #### IMPROVED
67
-
68
- - Better removal of extra leading/trailing newlines
69
-
70
- #### FIXED
71
-
72
- - Selecting 'All snippets' could return blank results in some cases
73
-
74
- ### 2.0.28
75
-
76
- 2023-04-18 09:18
77
-
78
- #### FIXED
79
-
80
- - When detecting indented code blocks, require a blank line (or start of file) before them, to avoid picking up lines within indented lists
81
-
82
- ### 2.0.26
83
-
84
- 2023-04-16 11:18
85
-
86
- #### FIXED
87
-
88
- - Nil error when highlighting without extension
89
-
90
- ### 2.0.24
91
-
92
- 2023-04-16 10:49
93
-
94
- #### NEW
95
-
96
- - `--nvultra` will open the selected snippet in nvUltra
97
-
98
- #### IMPROVED
99
-
100
- - Use Readline for entering info with `--paste`, allows for better editing experience
101
- - Allow `--edit` with `--paste` to open the new snippet in your editor immediately
102
-
103
- #### FIXED
104
-
105
- - Code indentation with `--paste`
106
-
107
- ### 2.0.23
108
-
109
- 2023-04-16 10:33
110
-
111
- #### IMPROVED
112
-
113
- - Use Readline for entering info with `--paste`, allows for better editing experience
114
- - Allow `--edit` with `--paste` to open the new snippet in your editor immediately
115
-
116
- #### FIXED
117
-
118
- - Code indentation with `--paste`
119
-
120
- ### 2.0.22
121
-
122
- 2023-04-16 09:33
123
-
124
- #### IMPROVED
125
-
126
- - Use Readline for entering info with `--paste`, allows for better editing experience
127
-
128
- #### FIXED
129
-
130
- - Code indentation with `--paste`
131
-
132
- ### 2.0.21
133
-
134
- 2023-04-16 09:04
135
-
136
- #### IMPROVED
137
-
138
- - Use leading and trailing hashes to make snippet titles more obvious when outputting All Snippets
139
-
140
- ### 2.0.20
141
-
142
- 2023-04-16 08:31
143
-
144
- #### FIXED
145
-
146
- - Fail to include skylighting themes in gem bundle
147
- - Failure to recognize fenced code blocks with language specifiers containing hyphens
148
-
149
- ### 2.0.19
150
-
151
- 2023-04-16 08:05
152
-
153
- #### FIXED
154
-
155
- - A fenced code block following a line containing only 4+ spaces or tabs would get parsed as an indented code block
156
- - Last fenced code block in a snippet might not be recognized
157
-
158
- ### 2.0.18
159
-
160
- 2023-04-16 06:57
161
-
162
- #### FIXED
163
-
164
- - If an invalid language (without a lexer) is supplied when using `--paste`, just use the input as the extension and tag
165
-
166
- ### 2.0.17
167
-
168
- 2023-04-16 06:31
169
-
170
- #### NEW
171
-
172
- - Languages specified in the opening fence of a code block are passed to the syntax highlighter (only affects Skylighting)
173
-
174
- #### IMPROVED
175
-
176
- - Add all available themes for Skylighting
177
- - Allow a custom theme path to be provided for Skylighting by including a path in `highlight_theme` config
178
- - Handle syntax highlighter errors, returning plain code if command fails
179
-
180
- #### FIXED
181
-
182
- - Disable syntax highlighting when command is being piped or redirected
183
- - Don't syntax highlight clipboard code when using `--copy`
184
-
185
- ### 2.0.16
186
-
187
- 2023-04-15 22:15
188
-
189
- #### FIXED
190
-
191
- - Remove debugging output
192
-
193
- ### 2.0.15
194
-
195
- 2023-04-15 22:11
196
-
197
- #### NEW
198
-
199
- - Additional themes for skylighting: nord, monokai, solarized-light/dark
200
-
201
- #### FIXED
202
-
203
- - Bad path to highlighter themes for skylighting
204
-
205
- ### 2.0.14
206
-
207
- 2023-04-15 21:21
208
-
209
- #### IMPROVED
210
-
211
- - Better default themes for highlighters
212
-
213
- #### FIXED
214
-
215
- - Error with lexers_db when using higlighting
216
-
217
- ### 2.0.13
218
-
219
- 2023-04-15 19:57
220
-
221
- #### NEW
222
-
223
- - Option to include blockquotes (>) in output
224
-
225
- ### 2.0.12
226
-
227
- 2023-04-15 19:28
228
-
229
- #### FIXED
230
-
231
- - Lowered minimum ruby version to allow Ruby 2.6
232
- - Failure to recognize snippet if title is on first line of file
233
- - Errantly discarding first snippet in file with multiple snippets
234
-
235
- ### 2.0.11
236
-
237
- 2023-04-15 19:06
238
-
239
- #### FIXED
240
-
241
- - Overactive stripping of newlines within code blocks
242
- - Syntax definition determination when adding new snippets
243
-
244
- ### 2.0.10
245
-
246
- 2023-04-15 16:28
247
-
248
- #### FIXED
249
-
250
- - Update dependencies for security
251
- - Incorporate fixes from @robjwells addressing #3 and #4
252
- - Incorporate fixes from @robjwells addressing #3 and #4
253
- - Best menu CLI determination missing modules
254
-
255
- ### 2.0.9
256
-
257
- 2023-04-15 15:44
258
-
259
- #### IMPROVED
260
-
261
- - Allow setting `menus` config key to force Snibbets to use fzf, gum, or console menus
262
- - Allow setting `menus` config key to force Snibbets to use fzf, gum, or console menus
263
-
264
- #### FIXED
265
-
266
- - If a header section contains no code blocks, don't display it in menu
267
- - Remove leading and trailing newlines without affecting indentation
268
-
269
- ### 2.0.8
270
-
271
- 2023-04-15 15:41
272
-
273
- #### IMPROVED
274
-
275
- - Allow setting `menus` config key to force Snibbets to use fzf, gum, or console menus
276
- - Allow setting `menus` config key to force Snibbets to use fzf, gum, or console menus
277
-
278
- #### FIXED
279
-
280
- - If a header section contains no code blocks, don't display it in menu
281
- - Remove leading and trailing newlines without affecting indentation
282
-
283
- ### 2.0.6
284
-
285
- 2023-04-15 11:55
286
-
287
- #### IMPROVED
288
-
289
- - Refactor script as modules and classes
290
-
291
- ### 2.0.2
292
-
293
- Initial release as a gem
12
+ 2023-09-05 16:46
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- snibbets (2.0.34)
4
+ snibbets (2.0.36)
5
5
  mdless (~> 1.0, >= 1.0.32)
6
6
  tty-reader (~> 0.9, >= 0.9.0)
7
7
  tty-which (~> 0.5, >= 0.5.0)
data/README.md CHANGED
@@ -1,7 +1,5 @@
1
1
 
2
-
3
2
  [![RubyGems.org](https://img.shields.io/gem/v/snibbets)](https://rubygems.org/gems/snibbets)
4
- <!-- [![GitHub Actions](https://github.com/ttscoff/snibbets/actions/workflows/check.yml/badge.svg)](https://github.com/ttscoff/snibbets/actions/workflows/check.yml) -->
5
3
 
6
4
  A tool for accessing code snippets contained in a folder of plain text Markdown files.
7
5
 
@@ -68,7 +66,7 @@ To install Snibbets:
68
66
 
69
67
  gem install snibbets
70
68
 
71
- If you're using the system Ruby, you may need to use `sudo gem install snibbets`.
69
+ If you're using the system Ruby, use `gem install --user-install snibbets` instead.
72
70
 
73
71
  ### Configuration
74
72
 
@@ -159,7 +157,7 @@ Snibbet's implementation of Skylighting has limited but better-looking themes, a
159
157
  ### Usage
160
158
 
161
159
  ```
162
- Snibbets v2.0.34
160
+ Snibbets v2.0.36
163
161
 
164
162
  Usage: snibbets [options] query
165
163
  -a, --all If a file contains multiple snippets, output all of them (no menu)
@@ -2,7 +2,6 @@ module Snibbets
2
2
  module Highlight
3
3
  class << self
4
4
  def run_command_with_input(*cmd, input: nil, fallback: nil)
5
-
6
5
  stdout, _stderr, status = Open3.capture3(*cmd, stdin_data: input)
7
6
  if status.success?
8
7
  stdout
@@ -74,7 +74,7 @@ module Snibbets
74
74
  end
75
75
 
76
76
  def rx
77
- ".*#{gsub(/\s+/, '.*')}.*"
77
+ ".*#{gsub(/tags?:/, '').gsub(/\s+/, '.*')}.*"
78
78
  end
79
79
 
80
80
  # remove outside comments, fences, and indentation
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Snibbets
4
- VERSION = '2.0.34'
4
+ VERSION = '2.0.36'
5
5
  end
data/lib/snibbets.rb CHANGED
@@ -74,11 +74,11 @@ module Snibbets
74
74
  end
75
75
  else
76
76
  mdfind = TTY::Which.which('mdfind')
77
- if mdfind.empty?
77
+ if mdfind.nil? || mdfind.empty?
78
78
  nil
79
79
  else
80
80
  name_only = Snibbets.options[:name_only] ? '-name ' : ''
81
- %(mdfind -onlyin #{folder} #{name_only}'#{@query} filename:.#{ext}' 2>/dev/null)
81
+ %(mdfind -onlyin #{folder} #{name_only}'#{@query} name:.#{ext}' 2>/dev/null)
82
82
  end
83
83
  end
84
84
 
data/snibbets.gemspec CHANGED
@@ -22,7 +22,7 @@ Gem::Specification.new do |spec|
22
22
 
23
23
  spec.require_paths << 'lib'
24
24
  spec.extra_rdoc_files = ['README.md']
25
- spec.rdoc_options << '--title' << 'na' << '--main' << 'README.md' << '--markup' << 'markdown'
25
+ spec.rdoc_options << '--title' << 'snibbets' << '--main' << 'README.md' << '--markup' << 'markdown'
26
26
 
27
27
  spec.bindir = "bin"
28
28
  spec.executables << 'snibbets'
data/src/_README.md CHANGED
@@ -1,10 +1,8 @@
1
1
  # Snibbets
2
2
 
3
3
  <!--README-->
4
- <!--GITHUB-->
5
4
  [![RubyGems.org](https://img.shields.io/gem/v/snibbets)](https://rubygems.org/gems/snibbets)
6
- <!-- [![GitHub Actions](https://github.com/ttscoff/snibbets/actions/workflows/check.yml/badge.svg)](https://github.com/ttscoff/snibbets/actions/workflows/check.yml) -->
7
- <!--END GITHUB-->
5
+
8
6
  A tool for accessing code snippets contained in a folder of plain text Markdown files.
9
7
 
10
8
  Snibbets allows me to keep code snippets in raw files, not relying on a dedicated code snippet app. I can collect and edit my snippets using a text editor, nvALT (nvUltra), or simply by saving snippets from my clipboard to a text file using *NIX redirection on the command line. I can add descriptive names and extended descriptions/notes to code snippets using standard Markdown.
@@ -70,7 +68,7 @@ To install Snibbets:
70
68
 
71
69
  gem install snibbets
72
70
 
73
- If you're using the system Ruby, you may need to use `sudo gem install snibbets`.
71
+ If you're using the system Ruby, use `gem install --user-install snibbets` instead.
74
72
 
75
73
  ### Configuration
76
74
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: snibbets
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.34
4
+ version: 2.0.36
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brett Terpstra
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-06-17 00:00:00.000000000 Z
11
+ date: 2024-04-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -311,7 +311,7 @@ metadata:
311
311
  post_install_message:
312
312
  rdoc_options:
313
313
  - "--title"
314
- - na
314
+ - snibbets
315
315
  - "--main"
316
316
  - README.md
317
317
  - "--markup"