snibbets 2.0.29 → 2.0.31
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.devcontainer/Dockerfile +11 -0
- data/.devcontainer/devcontainer.json +17 -0
- data/.editorconfig +9 -0
- data/.irbrc +2 -0
- data/.rspec +4 -0
- data/.ruby-version +1 -0
- data/CHANGELOG.md +19 -58
- data/Gemfile.lock +1 -1
- data/README.md +4 -1
- data/Snibbets.lbaction/Contents/Info.plist +49 -0
- data/Snibbets.lbaction/Contents/Scripts/default.js +52 -0
- data/Snibbets.lbaction/Contents/Scripts/snibbets.rb +420 -0
- data/bin/snibbets +4 -0
- data/lib/snibbets/array.rb +5 -1
- data/lib/snibbets/config.rb +1 -0
- data/lib/snibbets/highlight.rb +17 -1
- data/lib/snibbets/menu.rb +4 -8
- data/lib/snibbets/os.rb +3 -3
- data/lib/snibbets/string.rb +78 -37
- data/lib/snibbets/todo_spec.rb +11 -0
- data/lib/snibbets/version.rb +1 -1
- data/lib/snibbets.rb +25 -19
- data/scripts/fixreadme.rb +23 -0
- data/snibbets.gemspec +3 -3
- data/{README.md.orig → src/_README.md} +56 -35
- data/yard_templates/default/method_details/setup.rb +3 -0
- metadata +15 -6
- data/Gemfile.lock.orig +0 -107
- data/buildnotes.md +0 -47
- data/snibbets.taskpaper +0 -14
data/lib/snibbets/version.rb
CHANGED
data/lib/snibbets.rb
CHANGED
@@ -116,7 +116,6 @@ module Snibbets
|
|
116
116
|
notebook = Snibbets.options[:source].gsub(/ /, '%20')
|
117
117
|
note = ERB::Util.url_encode(File.basename(filepath, '.md'))
|
118
118
|
url = "x-nvultra://open?notebook=#{notebook}¬e=#{note}"
|
119
|
-
puts url
|
120
119
|
`open '#{url}'`
|
121
120
|
end
|
122
121
|
|
@@ -153,7 +152,7 @@ module Snibbets
|
|
153
152
|
end
|
154
153
|
|
155
154
|
def new_snippet_from_clipboard
|
156
|
-
return false unless $
|
155
|
+
return false unless $stdout.isatty
|
157
156
|
|
158
157
|
trap('SIGINT') do
|
159
158
|
Howzit.console.info "\nCancelled"
|
@@ -248,7 +247,7 @@ module Snibbets
|
|
248
247
|
else
|
249
248
|
filepath = nil
|
250
249
|
if results.empty?
|
251
|
-
warn 'No results'
|
250
|
+
warn 'No results' if Snibbets.options[:interactive]
|
252
251
|
Process.exit 0
|
253
252
|
elsif results.length == 1 || !Snibbets.options[:interactive]
|
254
253
|
filepath = results[0]['path']
|
@@ -272,7 +271,7 @@ module Snibbets
|
|
272
271
|
snippets = input.snippets
|
273
272
|
|
274
273
|
if snippets.empty?
|
275
|
-
warn 'No snippets found'
|
274
|
+
warn 'No snippets found' if Snibbets.options[:interactive]
|
276
275
|
Process.exit 0
|
277
276
|
elsif snippets.length == 1 || !Snibbets.options[:interactive]
|
278
277
|
if Snibbets.options[:output] == 'json'
|
@@ -280,9 +279,11 @@ module Snibbets
|
|
280
279
|
else
|
281
280
|
snippets.each do |snip|
|
282
281
|
header = File.basename(filepath, '.md')
|
283
|
-
|
284
|
-
|
285
|
-
|
282
|
+
if $stdout.isatty
|
283
|
+
puts header
|
284
|
+
puts '-' * header.length
|
285
|
+
puts ''
|
286
|
+
end
|
286
287
|
code = snip['code']
|
287
288
|
lang = snip['language']
|
288
289
|
print(code, filepath, lang)
|
@@ -307,19 +308,23 @@ module Snibbets
|
|
307
308
|
if Snibbets.options[:output] == 'json'
|
308
309
|
print(snippets.to_json, filepath)
|
309
310
|
else
|
310
|
-
|
311
|
-
|
312
|
-
|
313
|
-
|
311
|
+
if $stdout.isatty
|
312
|
+
header = File.basename(filepath, '.md')
|
313
|
+
warn header
|
314
|
+
warn '=' * header.length
|
315
|
+
warn ''
|
316
|
+
end
|
314
317
|
print_all(snippets, filepath)
|
315
318
|
end
|
316
319
|
elsif Snibbets.options[:output] == 'json'
|
317
320
|
print(answer.to_json, filepath)
|
318
321
|
else
|
319
|
-
|
320
|
-
|
321
|
-
|
322
|
-
|
322
|
+
if $stdout.isatty
|
323
|
+
header = "#{File.basename(filepath, '.md')}: #{answer['title']}"
|
324
|
+
warn header
|
325
|
+
warn '-' * header.length
|
326
|
+
warn ''
|
327
|
+
end
|
323
328
|
code = answer['code']
|
324
329
|
lang = answer['language']
|
325
330
|
print(code, filepath, lang)
|
@@ -333,9 +338,10 @@ module Snibbets
|
|
333
338
|
|
334
339
|
snippets.each do |snippet|
|
335
340
|
lang = snippet['language']
|
336
|
-
|
337
|
-
|
338
|
-
|
341
|
+
|
342
|
+
puts "### #{snippet['title']} ###"
|
343
|
+
puts ''
|
344
|
+
|
339
345
|
print(snippet['code'], filepath, lang)
|
340
346
|
puts
|
341
347
|
end
|
@@ -346,7 +352,7 @@ module Snibbets
|
|
346
352
|
if Snibbets.options[:highlight] && Snibbets.options[:output] == 'raw'
|
347
353
|
$stdout.puts(Highlight.highlight(output, filepath, syntax))
|
348
354
|
else
|
349
|
-
$stdout.puts(output)
|
355
|
+
$stdout.puts(Snibbets.options[:all_notes] ? output : output.clean_code)
|
350
356
|
end
|
351
357
|
if Snibbets.options[:copy]
|
352
358
|
OS.copy(output)
|
@@ -0,0 +1,23 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
# frozen_string_literal: true
|
3
|
+
|
4
|
+
current_ver = `rake cver`
|
5
|
+
src = 'src/_README.md'
|
6
|
+
dest = 'README.md'
|
7
|
+
|
8
|
+
readme = IO.read(src).force_encoding('ASCII-8BIT').encode('UTF-8', invalid: :replace, undef: :replace, replace: '?')
|
9
|
+
|
10
|
+
content = readme.match(/(?<=\<!--README-->)(.*?)(?=\<!--END README-->)/m)[0]
|
11
|
+
|
12
|
+
content.gsub!(/<!--VER-->(.*?)<!--END VER-->/, current_ver)
|
13
|
+
content.gsub!(/<!--GITHUB-->(.*?)<!--END GITHUB-->/m, '\1')
|
14
|
+
content.gsub!(/<!--JEKYLL(.*?)-->/m, '')
|
15
|
+
|
16
|
+
content.gsub!(/^@cli\((.*?)\)/) do
|
17
|
+
cmd = Regexp.last_match(1)
|
18
|
+
`#{cmd}`.strip.gsub(/\n{2,}/, "\n\n")
|
19
|
+
end
|
20
|
+
|
21
|
+
File.open(dest, 'w') { |f| f.puts(content) }
|
22
|
+
|
23
|
+
Process.exit 0
|
data/snibbets.gemspec
CHANGED
@@ -27,9 +27,9 @@ Gem::Specification.new do |spec|
|
|
27
27
|
spec.bindir = "bin"
|
28
28
|
spec.executables << 'snibbets'
|
29
29
|
|
30
|
-
spec.files = Dir
|
31
|
-
|
32
|
-
|
30
|
+
spec.files = Dir.chdir(File.expand_path('..', __FILE__)) do
|
31
|
+
`git ls-files -z`.split("\x0").reject { |f| f.strip =~ %r{^((test|spec|features)/|\.git|buildnotes|.*\.taskpaper)} }
|
32
|
+
end
|
33
33
|
|
34
34
|
spec.add_development_dependency "bundler", "~> 2.0"
|
35
35
|
spec.add_development_dependency "awesome_print", "~> 1.9"
|
@@ -1,22 +1,20 @@
|
|
1
|
+
# Snibbets
|
1
2
|
|
2
|
-
|
3
|
+
<!--README-->
|
4
|
+
<!--GITHUB-->
|
3
5
|
[![RubyGems.org](https://img.shields.io/gem/v/snibbets)](https://rubygems.org/gems/snibbets)
|
4
|
-
<<<<<<< HEAD
|
5
|
-
[![GitHub Actions](https://github.com/ttscoff/snibbets/actions/workflows/check.yml/badge.svg)](https://github.com/ttscoff/snibbets/actions/workflows/check.yml)
|
6
|
-
=======
|
7
6
|
<!-- [![GitHub Actions](https://github.com/ttscoff/snibbets/actions/workflows/check.yml/badge.svg)](https://github.com/ttscoff/snibbets/actions/workflows/check.yml) -->
|
8
|
-
|
9
|
-
|
7
|
+
<!--END GITHUB-->
|
10
8
|
A tool for accessing code snippets contained in a folder of plain text Markdown files.
|
11
9
|
|
12
10
|
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.
|
13
11
|
|
14
12
|
What Snibbets does is simply allow a quick search for a specific snippet that I can either output to the terminal, pipe to my clipboard, or access via LaunchBar (via the included LaunchBar Action). It's basically a wrapper for `find` and `grep` with the ability to separate code blocks from other text in my Markdown files.
|
15
13
|
|
16
|
-
|
14
|
+
<!--GITHUB-->
|
17
15
|
![Snibbets in action](https://cdn3.brettterpstra.com/uploads/2023/04/snibbets2.gif)
|
18
|
-
|
19
|
-
|
16
|
+
<!--END GITHUB-->
|
17
|
+
<!--JEKYLL{% gif /uploads/2023/04/snibbets2.gif %}-->
|
20
18
|
|
21
19
|
## Collecting Snippets
|
22
20
|
|
@@ -28,7 +26,7 @@ The name of the file should be the description of the snippet, at least in the c
|
|
28
26
|
|
29
27
|
You can combine multiple snippets in a file, though. For example, I have a file called 'Ruby hash snippets.rb.md'. That file contains an array of useful snippets, and each one has a descriptive title in an h3 header above it. Those (ATX) headers are used to split the file, and when you search from the command line, you'll get a menu of all of the snippets in the selected file. (And if you have [fzf](https://github.com/junegunn/fzf) or [gum](https://github.com/charmbracelet/gum) installed, you can quickly filter through with fuzzy searching and find exactly what you need.)
|
30
28
|
|
31
|
-
If a file contains multiple snippets, they should be separated by ATX-style headers (one or more `#`) describing the snippets. Additional
|
29
|
+
If a file contains multiple snippets, they should be separated by ATX-style headers (one or more `#`) describing the snippets. Additional descriptions and notes can be included outside of the code block. Notes are not output on the console, only the code is displayed. If you want a note to be included in console output, make it a blockquote by preceding it with `>`.
|
32
30
|
|
33
31
|
A file titled `unix find.bash.md`:
|
34
32
|
|
@@ -49,22 +47,22 @@ A file titled `unix find.bash.md`:
|
|
49
47
|
|
50
48
|
find /dir/dir -type f -mtime +540 -mtime -720 -printf \"%p\",\"%s\",\"%AD\",|"%TD\"\\n > /dir/dir/output.csv
|
51
49
|
|
52
|
-
You can include MultiMarkdown metadata in your snippets, either in a YAML block or just at the top of the file with raw key/value pairs. I mostly use this for adding tags, which are then synced to macOS tags when I save. It makes it easy to search for snippets in [nvUltra](https://nvultra.com/), and also allows you to do searches like `snibbets tag:javascript url parser`
|
50
|
+
You can include MultiMarkdown metadata in your snippets, either in a YAML block or just at the top of the file with raw key/value pairs. I mostly use this for adding tags, which are then synced to macOS tags when I save. It makes it easy to search for snippets in [nvUltra](https://nvultra.com/), and also allows you to do searches like `snibbets tag:javascript url parser` with Snibbets.
|
53
51
|
|
54
52
|
## CLI
|
55
53
|
|
56
54
|
### Dependencies
|
57
55
|
|
58
|
-
Snibbets requires Ruby 3.0+. On recent versions of macOS, this is not included by default. You can install it via the Command Line Tools from Apple. On macOS and most other systems, you can use something like [Homebrew], [rbenv], [rvm], or [asdf] to install Ruby 3.
|
56
|
+
Snibbets requires Ruby 3.0+. On recent versions of macOS, this is not included by default. You can install it via the Command Line Tools from Apple. On macOS and most other systems, you can also use something like [Homebrew], [rbenv], [rvm], or [asdf] to install Ruby 3.
|
59
57
|
|
60
58
|
If available, menus are generated by [fzf] or [gum]. If neither are available, a basic Readline menu system will be displayed, so neither are required, just nice to have as they provide fuzzy filtering, scrolling, and type-ahead completion.
|
61
59
|
|
62
|
-
[homebrew]: https://brew.sh/ "Homebrew
|
60
|
+
[homebrew]: https://brew.sh/ "Homebrew—The Missing Package Manager for macOS (or Linux)"
|
63
61
|
[rbenv]: https://github.com/rbenv/rbenv "rbenv/rbenv:Manage your app's Ruby environment"
|
64
62
|
[rvm]: https://rvm.io/ "Ruby Version Manager"
|
65
63
|
[asdf]: https://asdf-vm.com/ "ASDF environment manager"
|
66
64
|
[fzf]: https://github.com/junegunn/fzf "junegunn/fzf:A command-line fuzzy finder"
|
67
|
-
[gum]: https://github.com/charmbracelet/gum "charmbracelet/gum:A tool for glamorous shell scripts
|
65
|
+
[gum]: https://github.com/charmbracelet/gum "charmbracelet/gum:A tool for glamorous shell scripts 🎀"
|
68
66
|
|
69
67
|
### Installation
|
70
68
|
|
@@ -106,14 +104,14 @@ Set the `source` key to the folder where you keep your Markdown snippets. Option
|
|
106
104
|
|
107
105
|
The `all` setting determines how Snibbets handles files containing multiple snippets. If `all` is true, then it will always display every snippet in the selected file. If false, it will offer a menu and let you choose which snippet to display. You can use `--all` on the command line to just enable this once.
|
108
106
|
|
107
|
+
By default, Snibbets displays only the code from each snippet (and optionally block quotes, see below). If you set `all_notes` to true, then the full content of each snippet containing a code block will be returned, allowing you to see additional notes on the command line. This can be toggled at runtime with `--notes` or `--no-notes`.
|
108
|
+
|
109
109
|
The `copy` setting determines whether the output is copied to the clipboard in addition to being displayed on STDOUT. This is the equivalent of running `snibbets QUERY | pbcopy` (macOS) or `snibbets QUERY | xclip` (Linux). This can be enabled for just one run with `--copy` on the command line. Setting it to true in the config will copy to the clipboard every time a snippet is displayed. On Mac this will work automatically, on Windows/Linux you may need to [install `xclip` or `xsel`][xclip].
|
110
110
|
|
111
111
|
[xclip]: https://ostechnix.com/access-clipboard-contents-using-xclip-and-xsel-in-linux/
|
112
112
|
|
113
113
|
The `editor` setting is used to open the config file, and to open snippets for editing when using the `--edit` flag. This setting can be any command line utility (`code`, `subl`, `vim`, `nano`, etc.), or on macOS it can be an application name (`BBEdit`, `VS Code`, etc.) or a bundle identifier (`com.sublimetext.4`, `com.microsoft.VSCode`, etc.). If no editor is set, then the file will be opened by whatever the system default is (using `open` on macOS, `start` on Windows, or `xdg-open`on Linux).
|
114
114
|
|
115
|
-
The `highlight` key turns on syntax highlighting. This requires that either `pygmentize` or `skyligting` is available on your system (both available via package managers like Homebrew). This feature is still in development and results may be mixed.
|
116
|
-
|
117
115
|
The `include_blockquotes` setting determines whether blockquotes are included in the output. By default, Snibbets removes everything other than code blocks (indented or fenced) from the output it displays. But if you want to include a note that you'll see on the command line, you can put it in a block quote by preceding each line you want to preserve with a right angle bracket (`>`).
|
118
116
|
|
119
117
|
The `interactive` setting determines whether menus will be displayed. This should generally be true, but if you want silent operation that just displays the best match automatically, set it to false.
|
@@ -122,26 +120,48 @@ The `menus` setting will determine what method is used for displaying interactiv
|
|
122
120
|
|
123
121
|
The `name_only` key will permanently set Snibbets to only search for snippets by their filename rather than examining their contents. You can enable this at runtime using `--name-only` in the command.
|
124
122
|
|
123
|
+
#### Syntax Highlighting
|
124
|
+
|
125
|
+
The `highlight` key turns on syntax highlighting. This requires that either `pygmentize` or `skylighting` is available on your system (both available via package managers like Homebrew). This feature is still in development and results may be mixed. You can also set `highlighter` to `pygments` or `skylight` to force using one highlighter over the other.
|
126
|
+
|
127
|
+
Highlighting using Skylighting requires that your snippets be named with extra extensions defining the lexer to use. The last extension before `.md` (or whatever your snippet extension is set to) should be the one that the highlighter will recognize as a valid lexer, e.g. `my code.jquery.js.md`.
|
128
|
+
|
129
|
+
You can also define languages in your fenced code blocks by putting the lexer name right after the opening fence. When defining multiple snippets in one file that are of different languages, this method will ensure that each one is properly highlighted.
|
130
|
+
|
131
|
+
If you don't use either extensions or fenced code labels with Skylighting, code won't get highlighted.
|
132
|
+
|
133
|
+
To define a snippet as python code, for example:
|
134
|
+
|
135
|
+
```python
|
136
|
+
class EmlServer(SMTPServer):
|
137
|
+
no = 0
|
138
|
+
def process_message(self, peer, mailfrom, rcpttos, data):
|
139
|
+
filename = '%s-%d.eml' % (datetime.now().strftime('%Y%m%d%H%M%S'),
|
140
|
+
self.no)
|
141
|
+
f = open(filename, 'w')
|
142
|
+
```
|
143
|
+
|
144
|
+
You can also define a color scheme with `highlight_theme`. If you're using Pygments, run `pygmentize -L styles` to see available options. If you're using Skylighting, you can reference any theme in the [KDE repository]. Skylighting themes are included in Snibbets and can be referenced by their filename without `.theme`, or you can install your own themes and reference them with a full path. (I recommend `nord` when using Sylighting.)
|
145
|
+
|
146
|
+
[KDE repository]: https://github.com/KDE/syntax-highlighting/tree/master/data/themes
|
147
|
+
|
148
|
+
You can turn highlighting on or off for a single run using `--highlight` or `--no-highlight`. Syntax highlighting definitely affects copyable output, so it's automatically disabled when piping/redirecting output. When using `--copy`, the code sent to the clipboard is not highlighted.
|
149
|
+
|
150
|
+
##### Installing a Syntax Highlighter
|
151
|
+
|
152
|
+
Snibbet's implementation of Skylighting has limited but better-looking themes, and has some lexers that Pygments lacks. However, Pygments has _more_ lexers and a wider array of themes. It also can determine the target syntax automatically better than Skylighting (which requires the syntax to be specified -- it's pulled from the extensions of your snippets), which is why Pygments is the default if it's installed and you don't configure it otherwise.
|
153
|
+
|
154
|
+
- Install [Skylighting] with [Homebrew] (`brew install skylighting`) or [apt-get].
|
155
|
+
- Install [Pygments] using [Homebrew] (`brew install pygments`) or `pip install pygments`.
|
156
|
+
|
157
|
+
[Skylighting]: https://github.com/jgm/skylighting
|
158
|
+
[apt-get]: https://installati.one/install-skylighting-ubuntu-22-04/
|
159
|
+
[Pygments]: https://pygments.org/
|
160
|
+
|
125
161
|
### Usage
|
126
162
|
|
127
163
|
```
|
128
|
-
|
129
|
-
|
130
|
-
Usage: snibbets [options] query
|
131
|
-
-a, --all If a file contains multiple snippets, output all of them (no menu)
|
132
|
-
-c, --[no-]copy Copy the output to the clibpoard (also displays on STDOUT)
|
133
|
-
-e, --edit Open the selected snippet in your configured editor
|
134
|
-
-n, --[no-]name-only Only search file names, not content
|
135
|
-
-o, --output FORMAT Output format (json|launchbar|*raw)
|
136
|
-
-p, --paste, --new Interactively create a new snippet from clipboard contents (Mac only)
|
137
|
-
-q, --quiet Skip menus and display first match
|
138
|
-
-s, --source FOLDER Snippets folder to search
|
139
|
-
--configure Open the configuration file in your default editor
|
140
|
-
--[no-]blockquotes Include block quotes in output
|
141
|
-
--highlight Use pygments or skylighting to syntax highlight (if installed)
|
142
|
-
--save Save the current command line options to the YAML configuration
|
143
|
-
-h, --help Display this screen
|
144
|
-
-v, --version Display version information
|
164
|
+
@cli(bundle exec bin/snibbets -h)
|
145
165
|
```
|
146
166
|
|
147
167
|
If your Snippets folder is set in the config, simply running `snibbets [search query]` will perform the search and output the code blocks, presenting a menu if more than one match is found or the target file contains more than one snippet. Selected contents are output raw to STDOUT.
|
@@ -175,7 +195,7 @@ Any time you specify things like a source folder with the `--source` flag, or tu
|
|
175
195
|
|
176
196
|
_I'm currently reworking the LaunchBar action, and it doesn't function very well at this time. I'll update when I have a chance._
|
177
197
|
|
178
|
-
### Installation
|
198
|
+
<!-- ### Installation
|
179
199
|
|
180
200
|
The LaunchBar action can be installed simply by double clicking the `.lbaction` file in Finder. The CLI is not required for the LaunchBar action to function.
|
181
201
|
|
@@ -183,4 +203,5 @@ Once installed, run the action (type `snib` and hit return on the result) to sel
|
|
183
203
|
|
184
204
|
### Usage
|
185
205
|
|
186
|
-
Type `snib` to bring the Action up, then hit Space to enter your query text. Matching files will be presented. If the selected file contains more than one snippet, a list of snippets (based on ATX headers in the file) will be presented as a child menu. Selecting a snippet and hitting return will copy the associated code block to the clipboard.
|
206
|
+
Type `snib` to bring the Action up, then hit Space to enter your query text. Matching files will be presented. If the selected file contains more than one snippet, a list of snippets (based on ATX headers in the file) will be presented as a child menu. Selecting a snippet and hitting return will copy the associated code block to the clipboard. -->
|
207
|
+
<!--END README-->
|
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.
|
4
|
+
version: 2.0.31
|
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-04-
|
11
|
+
date: 2023-04-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -238,17 +238,23 @@ extensions: []
|
|
238
238
|
extra_rdoc_files:
|
239
239
|
- README.md
|
240
240
|
files:
|
241
|
+
- ".devcontainer/Dockerfile"
|
242
|
+
- ".devcontainer/devcontainer.json"
|
243
|
+
- ".editorconfig"
|
244
|
+
- ".irbrc"
|
245
|
+
- ".rspec"
|
246
|
+
- ".ruby-version"
|
241
247
|
- CHANGELOG.md
|
242
248
|
- Gemfile
|
243
249
|
- Gemfile.lock
|
244
|
-
- Gemfile.lock.orig
|
245
250
|
- LICENSE.txt
|
246
251
|
- README.md
|
247
|
-
- README.md.orig
|
248
252
|
- README.rdoc
|
249
253
|
- Rakefile
|
254
|
+
- Snibbets.lbaction/Contents/Info.plist
|
255
|
+
- Snibbets.lbaction/Contents/Scripts/default.js
|
256
|
+
- Snibbets.lbaction/Contents/Scripts/snibbets.rb
|
250
257
|
- bin/snibbets
|
251
|
-
- buildnotes.md
|
252
258
|
- lib/snibbets.rb
|
253
259
|
- lib/snibbets/array.rb
|
254
260
|
- lib/snibbets/config.rb
|
@@ -259,6 +265,7 @@ files:
|
|
259
265
|
- lib/snibbets/menu.rb
|
260
266
|
- lib/snibbets/os.rb
|
261
267
|
- lib/snibbets/string.rb
|
268
|
+
- lib/snibbets/todo_spec.rb
|
262
269
|
- lib/snibbets/version.rb
|
263
270
|
- lib/snibbets/which.rb
|
264
271
|
- lib/themes/atom-one-dark.theme
|
@@ -287,8 +294,10 @@ files:
|
|
287
294
|
- lib/themes/solarized-dark.theme
|
288
295
|
- lib/themes/solarized-light.theme
|
289
296
|
- lib/themes/vim-dark.theme
|
297
|
+
- scripts/fixreadme.rb
|
290
298
|
- snibbets.gemspec
|
291
|
-
-
|
299
|
+
- src/_README.md
|
300
|
+
- yard_templates/default/method_details/setup.rb
|
292
301
|
homepage: https://github.com/ttscoff/snibbets
|
293
302
|
licenses:
|
294
303
|
- MIT
|
data/Gemfile.lock.orig
DELETED
@@ -1,107 +0,0 @@
|
|
1
|
-
PATH
|
2
|
-
remote: .
|
3
|
-
specs:
|
4
|
-
snibbets (2.0.10)
|
5
|
-
tty-which (~> 0.5, >= 0.5.0)
|
6
|
-
|
7
|
-
GEM
|
8
|
-
remote: https://rubygems.org/
|
9
|
-
specs:
|
10
|
-
ansi (1.5.0)
|
11
|
-
ast (2.4.2)
|
12
|
-
awesome_print (1.9.2)
|
13
|
-
diff-lcs (1.5.0)
|
14
|
-
docile (1.4.0)
|
15
|
-
gem-release (2.2.2)
|
16
|
-
json (2.6.3)
|
17
|
-
language_server-protocol (3.17.0.3)
|
18
|
-
multi_json (1.15.0)
|
19
|
-
parallel (1.22.1)
|
20
|
-
parse_gemspec (1.0.0)
|
21
|
-
parse_gemspec-cli (1.0.0)
|
22
|
-
multi_json
|
23
|
-
parse_gemspec
|
24
|
-
thor
|
25
|
-
parser (3.2.2.0)
|
26
|
-
ast (~> 2.4.1)
|
27
|
-
rainbow (3.1.1)
|
28
|
-
rake (13.0.6)
|
29
|
-
<<<<<<< HEAD
|
30
|
-
rdoc (6.3.1)
|
31
|
-
=======
|
32
|
-
rdoc (6.3.3)
|
33
|
-
>>>>>>> af6f234 (Update rdoc)
|
34
|
-
regexp_parser (2.7.0)
|
35
|
-
rexml (3.2.5)
|
36
|
-
rspec (3.12.0)
|
37
|
-
rspec-core (~> 3.12.0)
|
38
|
-
rspec-expectations (~> 3.12.0)
|
39
|
-
rspec-mocks (~> 3.12.0)
|
40
|
-
rspec-core (3.12.1)
|
41
|
-
rspec-support (~> 3.12.0)
|
42
|
-
rspec-expectations (3.12.2)
|
43
|
-
diff-lcs (>= 1.2.0, < 2.0)
|
44
|
-
rspec-support (~> 3.12.0)
|
45
|
-
rspec-mocks (3.12.5)
|
46
|
-
diff-lcs (>= 1.2.0, < 2.0)
|
47
|
-
rspec-support (~> 3.12.0)
|
48
|
-
rspec-support (3.12.0)
|
49
|
-
rubocop (1.48.1)
|
50
|
-
json (~> 2.3)
|
51
|
-
parallel (~> 1.10)
|
52
|
-
parser (>= 3.2.0.0)
|
53
|
-
rainbow (>= 2.2.2, < 4.0)
|
54
|
-
regexp_parser (>= 1.8, < 3.0)
|
55
|
-
rexml (>= 3.2.5, < 4.0)
|
56
|
-
rubocop-ast (>= 1.26.0, < 2.0)
|
57
|
-
ruby-progressbar (~> 1.7)
|
58
|
-
unicode-display_width (>= 2.4.0, < 3.0)
|
59
|
-
rubocop-ast (1.28.0)
|
60
|
-
parser (>= 3.2.1.0)
|
61
|
-
rubocop-performance (1.16.0)
|
62
|
-
rubocop (>= 1.7.0, < 2.0)
|
63
|
-
rubocop-ast (>= 0.4.0)
|
64
|
-
ruby-progressbar (1.13.0)
|
65
|
-
simplecov (0.22.0)
|
66
|
-
docile (~> 1.1)
|
67
|
-
simplecov-html (~> 0.11)
|
68
|
-
simplecov_json_formatter (~> 0.1)
|
69
|
-
simplecov-console (0.9.1)
|
70
|
-
ansi
|
71
|
-
simplecov
|
72
|
-
terminal-table
|
73
|
-
simplecov-html (0.12.3)
|
74
|
-
simplecov_json_formatter (0.1.4)
|
75
|
-
standard (1.26.0)
|
76
|
-
language_server-protocol (~> 3.17.0.2)
|
77
|
-
rubocop (~> 1.48.1)
|
78
|
-
rubocop-performance (~> 1.16.0)
|
79
|
-
terminal-table (3.0.2)
|
80
|
-
unicode-display_width (>= 1.1.1, < 3)
|
81
|
-
thor (1.2.1)
|
82
|
-
tty-which (0.5.0)
|
83
|
-
unicode-display_width (2.4.2)
|
84
|
-
webrick (1.7.0)
|
85
|
-
yard (0.9.28)
|
86
|
-
webrick (~> 1.7.0)
|
87
|
-
|
88
|
-
PLATFORMS
|
89
|
-
arm64-darwin-20
|
90
|
-
x86_64-linux
|
91
|
-
|
92
|
-
DEPENDENCIES
|
93
|
-
awesome_print (~> 1.9)
|
94
|
-
bundler (~> 2.0)
|
95
|
-
gem-release (~> 2.2)
|
96
|
-
parse_gemspec-cli (~> 1.0)
|
97
|
-
rake (~> 13.0)
|
98
|
-
rdoc (~> 6.3.1)
|
99
|
-
rspec (~> 3.0)
|
100
|
-
simplecov (~> 0.21)
|
101
|
-
simplecov-console (~> 0.9)
|
102
|
-
snibbets!
|
103
|
-
standard (~> 1.3)
|
104
|
-
yard (~> 0.9, >= 0.9.26)
|
105
|
-
|
106
|
-
BUNDLED WITH
|
107
|
-
2.2.29
|
data/buildnotes.md
DELETED
@@ -1,47 +0,0 @@
|
|
1
|
-
template: gem, git, gli, project
|
2
|
-
executable: na
|
3
|
-
readme: src/_README.md
|
4
|
-
changelog: CHANGELOG.md
|
5
|
-
project: snibbets
|
6
|
-
|
7
|
-
# Snibbets
|
8
|
-
|
9
|
-
A plain text snippet manager
|
10
|
-
|
11
|
-
## Develop
|
12
|
-
|
13
|
-
@run(subl .)
|
14
|
-
|
15
|
-
## Dummy
|
16
|
-
|
17
|
-
@run(bundle exec bin/snibbets $@)
|
18
|
-
|
19
|
-
## Deploy
|
20
|
-
|
21
|
-
You no longer need to manually bump the version, it will be incremented when this task runs.
|
22
|
-
|
23
|
-
```run Update Changelog
|
24
|
-
#!/bin/bash
|
25
|
-
|
26
|
-
changelog -u
|
27
|
-
```
|
28
|
-
|
29
|
-
@include(project:Update GitHub README)
|
30
|
-
|
31
|
-
```run Update README
|
32
|
-
#!/bin/bash
|
33
|
-
|
34
|
-
changelog | git commit -a -F -
|
35
|
-
git pull
|
36
|
-
git push
|
37
|
-
```
|
38
|
-
|
39
|
-
@include(gem:Release Gem) Release Gem
|
40
|
-
@include(project:Update Blog Project) Update Blog Project
|
41
|
-
@run(rake bump[patch]) Bump Version
|
42
|
-
|
43
|
-
@run(git commit -am 'Version bump')
|
44
|
-
|
45
|
-
@after
|
46
|
-
Don't forget to publish the website!
|
47
|
-
@end
|
data/snibbets.taskpaper
DELETED
@@ -1,14 +0,0 @@
|
|
1
|
-
Inbox:
|
2
|
-
- handle multiple code blocks within a section separately for highlighting @maybe @na
|
3
|
-
If a header contains multiple snippets, create an array with a language specifier for each snippet, and then pass the array to the print function to handle individually highlighting each code block. Have a special language specifier for blockquote notes to avoid highlighting them at all.
|
4
|
-
Could possibly just highlight each block as its found, and save an original copy in memory for uncolored output, or just write a decoloring method. Skip highlighting if it's not enabled, but decolor ouput sent to non-tty or --copy.
|
5
|
-
snibbets:
|
6
|
-
Feature Requests:
|
7
|
-
Ideas:
|
8
|
-
Bugs:
|
9
|
-
Archive:
|
10
|
-
Search Definitions:
|
11
|
-
Top Priority @search(@priority = 5 and not @done)
|
12
|
-
High Priority @search(@priority > 3 and not @done)
|
13
|
-
Maybe @search(@maybe)
|
14
|
-
Next @search(@na and not @done and not project = "Archive")
|