snibbets 2.0.38 → 2.0.39

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: dbd4e4bc29849bd8b02294a6773dde5b729b4cfd36dc0a6abe415857d856f79e
4
- data.tar.gz: 8c998d26d1ca7938ff5275cbc5ba6a0c79f1d035b7b03a702cffc7dff1e91c27
3
+ metadata.gz: ecbc8c54241157725b6bc023b6ae061efb7cea7e107589ecbac0ddbae684c771
4
+ data.tar.gz: 44ca5362a8223dd32d175ed546734e1cfae050aeba9979727834013c80ddc8de
5
5
  SHA512:
6
- metadata.gz: 3e2e1b0d3a082f6cc046f1033447d077a34f563f92e36396650c1c5122205a73314e9bba4fade2739c90bf98ed869d8667d39be08ef0d496fed7fc6644531770
7
- data.tar.gz: 95a9c41d2f5ae6ffeba69946ceaf48c2c0f9f748555f1e8c32c5ed0369c8d4a5c0adf482f9064022a7a72c931fe7f03d2be17814e3b5d1edd31d6e00f369798e
6
+ metadata.gz: f4f1e4fc2032763573c57a9d9f3ce7e3b1abda0a8436d66a5870a389de6bc8253f19bb0c9f1d1a3b5ef1530a34e50e836a52d16966863049a13cfac71afc1ff7
7
+ data.tar.gz: a4f1e41a4bb8857b71e46f3825b666507aa485714f3eff66e4bc020448d804ceace6f5ab938dacade05a8c2b6b92e667facc75b6fac3e23e1bb650bec4a4092e
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- snibbets (2.0.38)
4
+ snibbets (2.0.39)
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
@@ -160,7 +160,7 @@ Snibbet's implementation of Skylighting has limited but better-looking themes, a
160
160
  ### Usage
161
161
 
162
162
  ```
163
- Snibbets v2.0.38
163
+ Snibbets v2.0.39
164
164
 
165
165
  Usage: snibbets [options] query
166
166
  -a, --all If a file contains multiple snippets, output all of them (no menu)
@@ -3,6 +3,10 @@
3
3
  module Snibbets
4
4
  # String helpers
5
5
  class ::String
6
+ def escape_filename
7
+ gsub(%r{/}, ':')
8
+ end
9
+
6
10
  def remove_spotlight_tags
7
11
  words = Shellwords.shellsplit(self)
8
12
  words.delete_if do |word|
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Snibbets
4
- VERSION = '2.0.38'
4
+ VERSION = '2.0.39'
5
5
  end
data/lib/snibbets.rb CHANGED
@@ -183,7 +183,7 @@ module Snibbets
183
183
  exts = langs if exts.empty?
184
184
 
185
185
  filename = "#{title}#{exts.map { |x| ".#{x}" }.join('')}.#{Snibbets.options[:extension]}"
186
- filepath = File.join(File.expand_path(Snibbets.options[:source]), filename)
186
+ filepath = File.join(File.expand_path(Snibbets.options[:source]), filename.escape_filename)
187
187
  File.open(filepath, 'w') do |f|
188
188
  f.puts "tags: #{tags.join(', ')}
189
189
 
@@ -240,7 +240,7 @@ module Snibbets
240
240
  exts = langs if exts.empty?
241
241
 
242
242
  filename = "#{title}#{exts.map { |x| ".#{x}" }.join('')}.#{Snibbets.options[:extension]}"
243
- filepath = File.join(File.expand_path(Snibbets.options[:source]), filename)
243
+ filepath = File.join(File.expand_path(Snibbets.options[:source]), filename.escape_filename)
244
244
 
245
245
  output =<<~EOOUTPUT
246
246
  tags: #{tags.join(', ')}
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.38
4
+ version: 2.0.39
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brett Terpstra
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-08-21 00:00:00.000000000 Z
11
+ date: 2024-09-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -330,7 +330,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
330
330
  - !ruby/object:Gem::Version
331
331
  version: '0'
332
332
  requirements: []
333
- rubygems_version: 3.2.15
333
+ rubygems_version: 3.2.16
334
334
  signing_key:
335
335
  specification_version: 4
336
336
  summary: Snibbets