snibbets 2.0.9 → 2.0.10

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: e721debb0d3122f59722537839a728cc81e532c8039edeca696b46f19c91d920
4
- data.tar.gz: ab7261e014473773db55aa1e56f392ba11dc2b423c2d281216d18b57bf51378e
3
+ metadata.gz: f07f0d4772b8d611c0e29da125b4e6915d3909479c4384348699eedc2e1baf90
4
+ data.tar.gz: e9abdf59d66f3c099c0c25f20a912efc53b690c7c45a5f4ada2b18355c3d473c
5
5
  SHA512:
6
- metadata.gz: 9f991baaab2bbe857bb1f2f0edb924ebc241faa58ffb20dec1084283a54d5e7c0163e1aac0368cb051b6b8bc3fe90d7db18517ff48176956e98b6889d7c918bb
7
- data.tar.gz: 01175aaaa465ae16bafff11a8a1d891b188c288042073f667f34a597e28bce105fd3e73e2a56683ed3780c12f7520d525694a1075af728f609e8a28803aad614
6
+ metadata.gz: ac873395a3735c827164f03b497f21f06e8af227b515e299c40eb8a4eeff26c907a5893077e1ee1a528200ef4ef9e6fe7c5ac1c9ddfecf7522ed0d772e6fd6eb
7
+ data.tar.gz: ca65c353589adda9fb4af59d390e98e277e5ba1523d746ab3f5cce19119cfa541b2db36045a90ecddd73be7224665dd96dd8642a2d7c010c438e6e9141a79d6a
data/CHANGELOG.md.orig ADDED
@@ -0,0 +1,56 @@
1
+ ### 2.0.10
2
+
3
+ 2023-04-15 16:28
4
+
5
+ #### FIXED
6
+
7
+ - Update dependencies for security
8
+ - Incorporate fixes from @robjwells addressing #3 and #4
9
+ - Incorporate fixes from @robjwells addressing #3 and #4
10
+ - Best menu CLI determination missing modules
11
+
12
+ <<<<<<< HEAD
13
+ ### 2.0.7
14
+
15
+ 2023-04-15 12:02
16
+ =======
17
+ ### 2.0.9
18
+
19
+ 2023-04-15 15:44
20
+
21
+ #### IMPROVED
22
+
23
+ - Allow setting `menus` config key to force Snibbets to use fzf, gum, or console menus
24
+ - Allow setting `menus` config key to force Snibbets to use fzf, gum, or console menus
25
+
26
+ #### FIXED
27
+
28
+ - If a header section contains no code blocks, don't display it in menu
29
+ - Remove leading and trailing newlines without affecting indentation
30
+
31
+ ### 2.0.8
32
+
33
+ 2023-04-15 15:41
34
+
35
+ #### IMPROVED
36
+
37
+ - Allow setting `menus` config key to force Snibbets to use fzf, gum, or console menus
38
+ - Allow setting `menus` config key to force Snibbets to use fzf, gum, or console menus
39
+
40
+ #### FIXED
41
+
42
+ - If a header section contains no code blocks, don't display it in menu
43
+ - Remove leading and trailing newlines without affecting indentation
44
+ >>>>>>> release/2.0.9
45
+
46
+ ### 2.0.6
47
+
48
+ 2023-04-15 11:55
49
+
50
+ #### IMPROVED
51
+
52
+ - Refactor script as modules and classes
53
+
54
+ ## 2.0.2
55
+
56
+ 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.7)
4
+ snibbets (2.0.10)
5
5
  tty-which (~> 0.5, >= 0.5.0)
6
6
 
7
7
  GEM
@@ -26,7 +26,7 @@ GEM
26
26
  ast (~> 2.4.1)
27
27
  rainbow (3.1.1)
28
28
  rake (13.0.6)
29
- rdoc (4.3.0)
29
+ rdoc (6.3.3)
30
30
  regexp_parser (2.7.0)
31
31
  rexml (3.2.5)
32
32
  rspec (3.12.0)
@@ -77,12 +77,11 @@ GEM
77
77
  thor (1.2.1)
78
78
  tty-which (0.5.0)
79
79
  unicode-display_width (2.4.2)
80
- webrick (1.7.0)
81
- yard (0.9.28)
82
- webrick (~> 1.7.0)
80
+ yard (0.9.34)
83
81
 
84
82
  PLATFORMS
85
83
  arm64-darwin-20
84
+ x86_64-linux
86
85
 
87
86
  DEPENDENCIES
88
87
  awesome_print (~> 1.9)
@@ -90,7 +89,7 @@ DEPENDENCIES
90
89
  gem-release (~> 2.2)
91
90
  parse_gemspec-cli (~> 1.0)
92
91
  rake (~> 13.0)
93
- rdoc (~> 4.3)
92
+ rdoc (~> 6.3.1)
94
93
  rspec (~> 3.0)
95
94
  simplecov (~> 0.21)
96
95
  simplecov-console (~> 0.9)
data/Gemfile.lock.orig ADDED
@@ -0,0 +1,107 @@
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 CHANGED
@@ -20,7 +20,6 @@ You no longer need to manually bump the version, it will be incremented when thi
20
20
  #!/bin/bash
21
21
 
22
22
  changelog -u
23
- # scripts/fixreadme.rb
24
23
  changelog | git commit -a -F -
25
24
  git pull
26
25
  git push
@@ -28,8 +28,8 @@ module Snibbets
28
28
  end
29
29
 
30
30
  def best_menu
31
- return 'fzf' if Which.exist?('fzf')
32
- return 'gum' if Which.exist?('gum')
31
+ return 'fzf' if TTY::Which.exist?('fzf')
32
+ return 'gum' if TTY::Which.exist?('gum')
33
33
  'console'
34
34
  end
35
35
 
data/lib/snibbets/menu.rb CHANGED
@@ -113,7 +113,7 @@ module Snibbets
113
113
  return res[line - 1] if line.positive? && line <= res.length
114
114
 
115
115
  warn 'Out of range'
116
- console_menu(res, title)
116
+ return console_menu(res, title, filename, query: query)
117
117
  end
118
118
  rescue Interrupt
119
119
  system('stty', stty_save)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Snibbets
4
- VERSION = '2.0.9'
4
+ VERSION = '2.0.10'
5
5
  end
data/lib/snibbets.rb CHANGED
@@ -36,14 +36,14 @@ module Snibbets
36
36
  class << self
37
37
  # Search the snippets directory for query using find and grep
38
38
  def search(try: 0)
39
- folder = Snibbets.options[:source]
39
+ folder = File.expand_path(Snibbets.options[:source])
40
40
  # start by doing a spotlight search, if that fails, start trying:
41
41
  # First try only search by filenames
42
42
  # Second try search with grep
43
43
  ext = Snibbets.options[:extension] || 'md'
44
44
  cmd = case try
45
45
  when 1
46
- %(find "#{folder}" -iregex '#{@query.rx}' -name '*.#{ext}')
46
+ %(find "#{folder}" -iregex '^#{Regexp.escape(folder)}/#{@query.rx}' -name '*.#{ext}')
47
47
  when 2
48
48
  rg = TTY::Which.which('rg')
49
49
  ag = TTY::Which.which('ag')
@@ -155,7 +155,7 @@ module Snibbets
155
155
 
156
156
  filename ="#{title}.#{exts.join('.')}.#{Snibbets.options[:extension]}"
157
157
 
158
- File.open(File.join(Snibbets.options[:source], filename), 'w') do |f|
158
+ File.open(File.join(File.expand_path(Snibbets.options[:source]), filename), 'w') do |f|
159
159
  f.puts "tags: #{tags.join(', ')}
160
160
 
161
161
  ```
data/snibbets.gemspec CHANGED
@@ -35,7 +35,7 @@ Gem::Specification.new do |spec|
35
35
  spec.add_development_dependency "gem-release", "~> 2.2"
36
36
  spec.add_development_dependency "parse_gemspec-cli", "~> 1.0"
37
37
  spec.add_development_dependency "rake", "~> 13.0"
38
- spec.add_development_dependency 'rdoc', '~> 4.3'
38
+ spec.add_development_dependency 'rdoc', '~> 6.3.1'
39
39
  spec.add_development_dependency 'yard', '~> 0.9', '>= 0.9.26'
40
40
  spec.add_development_dependency "rspec", "~> 3.0"
41
41
  spec.add_development_dependency "simplecov", "~> 0.21"
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.9
4
+ version: 2.0.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brett Terpstra
@@ -86,14 +86,14 @@ dependencies:
86
86
  requirements:
87
87
  - - "~>"
88
88
  - !ruby/object:Gem::Version
89
- version: '4.3'
89
+ version: 6.3.1
90
90
  type: :development
91
91
  prerelease: false
92
92
  version_requirements: !ruby/object:Gem::Requirement
93
93
  requirements:
94
94
  - - "~>"
95
95
  - !ruby/object:Gem::Version
96
- version: '4.3'
96
+ version: 6.3.1
97
97
  - !ruby/object:Gem::Dependency
98
98
  name: yard
99
99
  requirement: !ruby/object:Gem::Requirement
@@ -199,8 +199,10 @@ extra_rdoc_files:
199
199
  - README.md
200
200
  files:
201
201
  - CHANGELOG.md
202
+ - CHANGELOG.md.orig
202
203
  - Gemfile
203
204
  - Gemfile.lock
205
+ - Gemfile.lock.orig
204
206
  - LICENSE.txt
205
207
  - README.md
206
208
  - README.rdoc