snibbets 2.0.11 → 2.0.12

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: 5d69fb792808e08bf219cc435fda27458be565afb2b2d16dad8bcf40c4bc4386
4
- data.tar.gz: b798ab66a6928be6d50e160ae8c9a1b6f30042a452ed06de798440f5e6e947c5
3
+ metadata.gz: 730cb0a9e548f9d590fb8eb8088bf279e5848dc7822fd2f7022e0c2c472f31e9
4
+ data.tar.gz: 544dbd0f8de24623ad0c4c4ef56be8ba77bb7b55a2aa6355c39ceaa51fae9519
5
5
  SHA512:
6
- metadata.gz: 1b7b38a0b865c625feb8908a371b2ec76cc36765175abc68bf5956138ad4b60cb39b019aeec7775a4f89e51ce17c61c5b0df8d9b85c0752beb666c9153c9de0f
7
- data.tar.gz: b5f7f8a20cb33d4828c012d35057b8af7adb0fe475d226b83af8b91cb5d2d9e18ef6fe5e3be42104ea7ded67cdf46d4e9f3ce679a1699053ca41467d32e9095a
6
+ metadata.gz: 25175a8f43be5bf5793e1953d570314f558baaa2b2bdb6e7045f2f4e7ae4e081c86033b87f91d567c6f10c9a4ae9ea5e9ceb45117e4a6848a184a35d2e0bc4e9
7
+ data.tar.gz: fb643c8813e3fc6183a484395bc1326d44ebc994615d0b07f9cefc06b5099f40fdbc67b289e6108e54970c751e7f1fda603c3c228607862162d628f11bdd0c96
data/CHANGELOG.md.orig CHANGED
@@ -1,3 +1,13 @@
1
+ ### 2.0.12
2
+
3
+ 2023-04-15 19:28
4
+
5
+ #### FIXED
6
+
7
+ - Lowered minimum ruby version to allow Ruby 2.6
8
+ - Failure to recognize snippet if title is on first line of file
9
+ - Errantly discarding first snippet in file with multiple snippets
10
+
1
11
  ### 2.0.11
2
12
 
3
13
  2023-04-15 19:06
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- snibbets (2.0.11)
4
+ snibbets (2.0.12)
5
5
  tty-which (~> 0.5, >= 0.5.0)
6
6
 
7
7
  GEM
@@ -81,6 +81,7 @@ GEM
81
81
 
82
82
  PLATFORMS
83
83
  arm64-darwin-20
84
+ arm64-darwin-21
84
85
  x86_64-linux
85
86
 
86
87
  DEPENDENCIES
@@ -20,8 +20,8 @@ module Snibbets
20
20
  input = dup
21
21
  lines = input.split(/\n/)
22
22
  loop do
23
- line = lines.shift
24
- next if line =~ /^\s*[A-Z\s]+\w:\s*\S+/i || line =~ /^-{3,}\s*$/
23
+ line = lines[0]
24
+ lines.shift if line =~ /^\s*[A-Z\s]+\w:\s*\S+/i || line =~ /^-{3,}\s*$/
25
25
 
26
26
  break
27
27
  end
@@ -133,7 +133,7 @@ module Snibbets
133
133
  parts = sans_blocks.gsub(/\n{2,}/, "\n\n").split(/^#+/)
134
134
  end
135
135
 
136
- parts.shift if parts.count > 1
136
+ # parts.shift if parts.count > 1
137
137
 
138
138
  parts.each do |part|
139
139
  lines = part.split(/\n/).strip_empty
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Snibbets
4
- VERSION = '2.0.11'
4
+ VERSION = '2.0.12'
5
5
  end
data/lib/snibbets.rb CHANGED
@@ -34,6 +34,10 @@ end
34
34
 
35
35
  module Snibbets
36
36
  class << self
37
+ def change_query(query)
38
+ @query = query
39
+ end
40
+
37
41
  # Search the snippets directory for query using find and grep
38
42
  def search(try: 0)
39
43
  folder = File.expand_path(Snibbets.options[:source])
@@ -270,7 +274,7 @@ module Snibbets
270
274
  else
271
275
  snippets.push({ 'title' => 'All snippets', 'code' => '' })
272
276
 
273
- answer = Snibbets::Menu.menu(snippets, filename: File.basename(filepath, '.md'), title: 'Select snippet', query: @query)
277
+ answer = Menu.menu(snippets, filename: File.basename(filepath, '.md'), title: 'Select snippet', query: @query)
274
278
 
275
279
  if answer['title'] == 'All snippets'
276
280
  snippets.delete_if { |s| s['title'] == 'All snippets'}
data/snibbets.gemspec CHANGED
@@ -12,7 +12,7 @@ Gem::Specification.new do |spec|
12
12
  spec.description = "A plain text code snippet manager"
13
13
  spec.homepage = "https://github.com/ttscoff/snibbets"
14
14
  spec.license = "MIT"
15
- spec.required_ruby_version = ">= 3.0.0"
15
+ spec.required_ruby_version = ">= 2.6.0"
16
16
 
17
17
  spec.metadata["homepage_uri"] = spec.homepage
18
18
  spec.metadata["source_code_uri"] = spec.homepage
metadata CHANGED
@@ -1,11 +1,11 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: snibbets
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.11
4
+ version: 2.0.12
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brett Terpstra
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
  date: 2023-04-16 00:00:00.000000000 Z
@@ -174,22 +174,22 @@ dependencies:
174
174
  name: tty-which
175
175
  requirement: !ruby/object:Gem::Requirement
176
176
  requirements:
177
- - - "~>"
178
- - !ruby/object:Gem::Version
179
- version: '0.5'
180
177
  - - ">="
181
178
  - !ruby/object:Gem::Version
182
179
  version: 0.5.0
180
+ - - "~>"
181
+ - !ruby/object:Gem::Version
182
+ version: '0.5'
183
183
  type: :runtime
184
184
  prerelease: false
185
185
  version_requirements: !ruby/object:Gem::Requirement
186
186
  requirements:
187
- - - "~>"
188
- - !ruby/object:Gem::Version
189
- version: '0.5'
190
187
  - - ">="
191
188
  - !ruby/object:Gem::Version
192
189
  version: 0.5.0
190
+ - - "~>"
191
+ - !ruby/object:Gem::Version
192
+ version: '0.5'
193
193
  description: A plain text code snippet manager
194
194
  email: me@brettterpstra.com
195
195
  executables:
@@ -230,7 +230,7 @@ metadata:
230
230
  bug_tracker_uri: https://github.com/ttscoff/snibbets/issues
231
231
  changelog_uri: https://github.com/ttscoff/snibbets/blob/main/CHANGELOG.md
232
232
  github_repo: git@github.com:ttscoff/snibbets.git
233
- post_install_message:
233
+ post_install_message:
234
234
  rdoc_options:
235
235
  - "--title"
236
236
  - na
@@ -245,15 +245,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
245
245
  requirements:
246
246
  - - ">="
247
247
  - !ruby/object:Gem::Version
248
- version: 3.0.0
248
+ version: 2.6.0
249
249
  required_rubygems_version: !ruby/object:Gem::Requirement
250
250
  requirements:
251
251
  - - ">="
252
252
  - !ruby/object:Gem::Version
253
253
  version: '0'
254
254
  requirements: []
255
- rubygems_version: 3.2.16
256
- signing_key:
255
+ rubygems_version: 3.0.3.1
256
+ signing_key:
257
257
  specification_version: 4
258
258
  summary: Snibbets
259
259
  test_files: []