snibbets 2.0.22 → 2.0.23

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: 57f007cba021726dc009fc7817e47a0bab227238858bcd988db39084c6d38533
4
- data.tar.gz: '017086d98c644e5fe3f692ccd8ccd15f06a754d0ff20385daf6e2d2f5b77cc33'
3
+ metadata.gz: f4b84e73a8183169220197b680d511137b7aa5e191f22df4a4d8bc30217b9835
4
+ data.tar.gz: 6add8e505ca052e703c79aa43f99b2b58a1f05d71d850cda998681a58ac8f01a
5
5
  SHA512:
6
- metadata.gz: 6cf09bb6c7c548c849e9b9f3ecef02f2960bc4c0ad1df68cbca814ad05d95c011723fced0043083280b87d5c8e473763894e66ec3cc08d69cfa141b804cb3a4a
7
- data.tar.gz: e1f646b3216106a95c796f7838515026dabda0d103f759667d9855e57847420740e682128e1c1b873b1f265debfa5449b9af024ca025d339f5378190bbc3b66f
6
+ metadata.gz: dd8b8a316b2fd98445a3d7e387ed54218af99788c40aa0cf73b8bc149339bdc525b7e8cdb47da4cf211d642e65dfa591aabfb2e2ea49fe82650e58ad157f7099
7
+ data.tar.gz: 760f09adcce3a26ebb9093f019413e0b6ac14cc020f4cd8c4fbe4aff348bd75651b0c4170eabfd7b64445b47136181f56d9a0d0a38e9af6e60c399a16291b7a1
data/CHANGELOG.md CHANGED
@@ -1,3 +1,16 @@
1
+ ### 2.0.23
2
+
3
+ 2023-04-16 10:33
4
+
5
+ #### IMPROVED
6
+
7
+ - Use Readline for entering info with `--paste`, allows for better editing experience
8
+ - Allow `--edit` with `--paste` to open the new snippet in your editor immediately
9
+
10
+ #### FIXED
11
+
12
+ - Code indentation with `--paste`
13
+
1
14
  ### 2.0.22
2
15
 
3
16
  2023-04-16 09:33
@@ -169,6 +182,6 @@
169
182
 
170
183
  - Refactor script as modules and classes
171
184
 
172
- ## 2.0.2
185
+ ### 2.0.2
173
186
 
174
187
  Initial release as a gem
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- snibbets (2.0.22)
4
+ snibbets (2.0.23)
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
@@ -24,7 +24,7 @@ The name of the file should be the description of the snippet, at least in the c
24
24
 
25
25
  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.)
26
26
 
27
- If a file contains multiple snippets, they should be separated by ATX-style headers (one or more `#`) describing the snippets. Additional descriptions can be included outside of the code block. For example:
27
+ 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 `>`.
28
28
 
29
29
  A file titled `unix find.bash.md`:
30
30
 
@@ -45,13 +45,13 @@ A file titled `unix find.bash.md`:
45
45
 
46
46
  find /dir/dir -type f -mtime +540 -mtime -720 -printf \"%p\",\"%s\",\"%AD\",|"%TD\"\\n > /dir/dir/output.csv
47
47
 
48
- 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` in Snibbets.
48
+ 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.
49
49
 
50
50
  ## CLI
51
51
 
52
52
  ### Dependencies
53
53
 
54
- 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.
54
+ 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.
55
55
 
56
56
  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.
57
57
 
@@ -155,7 +155,7 @@ Snibbet's implementation of Skylighting has limited but better-looking themes, a
155
155
  ### Usage
156
156
 
157
157
  ```
158
- Snibbets v2.0.22
158
+ Snibbets v2.0.23
159
159
 
160
160
  Usage: snibbets [options] query
161
161
  -a, --all If a file contains multiple snippets, output all of them (no menu)
data/buildnotes.md CHANGED
@@ -8,7 +8,11 @@ project: snibbets
8
8
 
9
9
  A plain text snippet manager
10
10
 
11
- ## Test
11
+ ## Develop
12
+
13
+ @run(subl .)
14
+
15
+ ## Dummy
12
16
 
13
17
  @run(bundle exec bin/snibbets $@)
14
18
 
@@ -35,7 +39,3 @@ git push
35
39
  @after
36
40
  Don't forget to publish the website!
37
41
  @end
38
-
39
- ## Plans
40
-
41
-
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Snibbets
4
- VERSION = '2.0.22'
4
+ VERSION = '2.0.23'
5
5
  end
data/lib/snibbets.rb CHANGED
@@ -169,8 +169,8 @@ module Snibbets
169
169
  exts = langs if exts.empty?
170
170
 
171
171
  filename = "#{title}#{exts.map { |x| ".#{x}"}.join('')}.#{Snibbets.options[:extension]}"
172
-
173
- File.open(File.join(File.expand_path(Snibbets.options[:source]), filename), 'w') do |f|
172
+ filepath = File.join(File.expand_path(Snibbets.options[:source]), filename)
173
+ File.open(filepath, 'w') do |f|
174
174
  f.puts "tags: #{tags.join(', ')}
175
175
 
176
176
  ```
@@ -179,6 +179,8 @@ module Snibbets
179
179
  end
180
180
 
181
181
  puts "New snippet written to #{filename}."
182
+
183
+ open_snippet_in_editor(filepath) if Snibbets.arguments[:edit_snippet]
182
184
  end
183
185
 
184
186
  def handle_launchbar(results)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: snibbets
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.22
4
+ version: 2.0.23
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brett Terpstra