context_grep 0.3.0 → 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 86a3e25d8dad634fca9c8be38197f010b2e5f7da79fa46b10ae69c997b125c7e
4
- data.tar.gz: ee785480697fb08af1e14136645b4ef1c5d4bedd6f97ec3ec7430cf46545356e
3
+ metadata.gz: 17b7ea8cd656122a5dc3579b326995903dacab636b8f2d2604209e0db596c365
4
+ data.tar.gz: 3145d19a41d87394dfad101e43c9cf6c22c1ebd2e360f6af4755772da40eceb4
5
5
  SHA512:
6
- metadata.gz: fc53dfb8a429f22c2f5726f897d63e63ffa1742da7f67e32d9eab56101caf043f3526fde19a2c8d598a2ee597f9771ca9b0f405441657849cb2f79c6a6942ffe
7
- data.tar.gz: 901039c3e85e39ca4bf62e5cca9b036f6c39883bbada7a132cf6d94262d0bbef59673c46171770f83739a95bfed687f982c0a100d84229f06c5a67bdfb684e50
6
+ metadata.gz: c2e46c65ba0811f6717eae5579930925168b4198d95c606baf171dc2c05afc1748fe1a5df30317a9c1b57a213f0c943549d5f438a88fe0cc06c86b682d422514
7
+ data.tar.gz: 9ca3c5de2a2b7dd585182b48371d037603a5b3af15b472c020047667dcd8a7c27c715450c56bbe041a6850d5743328a1f21503cc7945839c802ce4414f608ed6
data/context_grep.gemspec CHANGED
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |spec|
2
2
  spec.name = "context_grep"
3
- spec.version = "0.3.0"
3
+ spec.version = "0.4.0"
4
4
  spec.summary = "grep results with syntactic parent chains"
5
5
 
6
6
  spec.author = "Victor Maslov aka Nakilon"
data/lib/context_grep.rb CHANGED
@@ -3,11 +3,12 @@ require "pathname" # undefined method `Pathname' for TreeSitter:Module (NoMetho
3
3
  require "tree_stand"
4
4
  ::TreeStand.config.parser_path = ::File.expand_path "~/.context_grep"
5
5
 
6
+ require "shellwords"
6
7
  require "fileutils"
7
8
  ZIP_FILENAME = ::File.join ::TreeStand.config.parser_path, "temp.zip"
8
9
  def ContextGrep what, where = "."
9
10
 
10
- `#{system("rg --version >/dev/null 2>&1") ? "rg -n" : "grep -nrI"} #{what} #{where} 2>/dev/null`
11
+ `#{system("rg --version >/dev/null 2>&1") ? "rg -n" : "grep -nrI"} #{::Shellwords.shelljoin [what, where]} 2>/dev/null`
11
12
  .scan(/^([^:]+):(\d+):/).group_by(&:first).map do |file, group|
12
13
  lang = ::Linguist::FileBlob.new(file).language
13
14
  next ::STDERR.puts "unsupported grammar #{lang} at #{file}" unless ts_name = {
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: context_grep
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Victor Maslov aka Nakilon
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir:
10
10
  - exe
11
11
  cert_chain: []
12
- date: 2026-04-03 00:00:00.000000000 Z
12
+ date: 2026-06-05 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: github-linguist