ripgrep 0.1.2 → 0.1.4
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 +4 -4
- data/.github/workflows/ci.yml +35 -0
- data/.tool-versions +1 -0
- data/README.md +8 -0
- data/lib/ripgrep/client.rb +17 -6
- data/lib/ripgrep/core.rb +4 -0
- data/lib/ripgrep/result.rb +1 -0
- data/lib/ripgrep/version.rb +1 -1
- data/ripgrep.gemspec +1 -1
- metadata +9 -12
- data/.ruby-version +0 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9ba2644f41a9b29af26272966cb2ae9c384d61b2a7edf570a039d270b6929274
|
4
|
+
data.tar.gz: 912cad6018f31c4b2cf81b921318bf431740120670ad04d758ccc41953aed726
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e44755d77bd7878ff258676dca2c091a283aeb05accaf500c9ebb4c41212c5fe95e357ad0a73b65345d58f537fbdcc1f273a422cce9223b6bc1c50db0c210ce4
|
7
|
+
data.tar.gz: 344b7795ba3667cf55a238416f4816ba1b84d6a9973170878f635ee8b4f159bf149a4b50f1680b36c21bab2030a54aa2b461391c811035ea8c1217d1d5272392
|
@@ -0,0 +1,35 @@
|
|
1
|
+
name: CI
|
2
|
+
|
3
|
+
on:
|
4
|
+
push:
|
5
|
+
branches: [ master, main ]
|
6
|
+
pull_request:
|
7
|
+
branches: [ master, main ]
|
8
|
+
|
9
|
+
jobs:
|
10
|
+
test:
|
11
|
+
runs-on: ubuntu-latest
|
12
|
+
|
13
|
+
strategy:
|
14
|
+
matrix:
|
15
|
+
ruby-version: ['3.2', '3.3', '3.4']
|
16
|
+
|
17
|
+
steps:
|
18
|
+
- uses: actions/checkout@v4
|
19
|
+
|
20
|
+
- name: Set up Ruby ${{ matrix.ruby-version }}
|
21
|
+
uses: ruby/setup-ruby@v1
|
22
|
+
with:
|
23
|
+
ruby-version: ${{ matrix.ruby-version }}
|
24
|
+
bundler-cache: true
|
25
|
+
|
26
|
+
- name: Install ripgrep
|
27
|
+
run: |
|
28
|
+
sudo apt-get update
|
29
|
+
sudo apt-get install -y ripgrep
|
30
|
+
|
31
|
+
- name: Verify ripgrep installation
|
32
|
+
run: rg --version
|
33
|
+
|
34
|
+
- name: Run RSpec tests
|
35
|
+
run: bundle exec rspec
|
data/.tool-versions
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
ruby 3.4.5
|
data/README.md
CHANGED
@@ -2,6 +2,14 @@
|
|
2
2
|
|
3
3
|
A Ruby wrapper around [ripgrep](https://github.com/BurntSushi/ripgrep)!
|
4
4
|
|
5
|
+
## Requirements
|
6
|
+
|
7
|
+
- ripgrep (rg) must be installed separately on your system. See the official repository: https://github.com/BurntSushi/ripgrep
|
8
|
+
|
9
|
+
Verified on:
|
10
|
+
- ripgrep 14.1.0
|
11
|
+
- Ruby 3.2, 3.3, 3.4
|
12
|
+
|
5
13
|
## Installation
|
6
14
|
|
7
15
|
Add this line to your application's Gemfile:
|
data/lib/ripgrep/client.rb
CHANGED
@@ -4,7 +4,7 @@ module Ripgrep
|
|
4
4
|
class Client
|
5
5
|
extend Forwardable
|
6
6
|
|
7
|
-
def_delegators Core, :version, :help
|
7
|
+
def_delegators Core, :version, :help, :files
|
8
8
|
|
9
9
|
def initialize(verbose: false)
|
10
10
|
@verbose = verbose
|
@@ -16,12 +16,23 @@ module Ripgrep
|
|
16
16
|
opts = {}
|
17
17
|
end
|
18
18
|
verbose = opts[:verbose].nil? ? @verbose : !!opts[:verbose]
|
19
|
-
cli_options = opts[:options]&.
|
20
|
-
next unless val
|
21
|
-
val = '' if val.is_a? TrueClass
|
22
|
-
val = val.join if val.is_a? Array
|
19
|
+
cli_options = opts[:options]&.flat_map do |key, val|
|
20
|
+
next [] unless val
|
23
21
|
key = key.to_s.tr('_', '-')
|
24
|
-
|
22
|
+
|
23
|
+
if val.is_a? Array
|
24
|
+
# For arrays, create multiple --key=val options
|
25
|
+
val.map { |v| "--#{key}=#{v}" }
|
26
|
+
elsif val.is_a? TrueClass
|
27
|
+
# For true, create --key option without value
|
28
|
+
["--#{key}"]
|
29
|
+
elsif val.is_a? String
|
30
|
+
# For strings, always pass through (empty string becomes --key=)
|
31
|
+
["--#{key}=#{val}"]
|
32
|
+
else
|
33
|
+
# For other values, convert to string
|
34
|
+
["--#{key}=#{val}"]
|
35
|
+
end
|
25
36
|
end&.compact || []
|
26
37
|
puts "cli_options: #{cli_options}" if verbose
|
27
38
|
cli_arguments = cli_options + args
|
data/lib/ripgrep/core.rb
CHANGED
data/lib/ripgrep/result.rb
CHANGED
data/lib/ripgrep/version.rb
CHANGED
data/ripgrep.gemspec
CHANGED
@@ -23,7 +23,7 @@ Gem::Specification.new do |spec|
|
|
23
23
|
spec.require_paths = ["lib"]
|
24
24
|
|
25
25
|
spec.add_development_dependency "bundler", "~> 2.0"
|
26
|
-
spec.add_development_dependency "rake", "
|
26
|
+
spec.add_development_dependency "rake", ">= 12.3.3"
|
27
27
|
spec.add_development_dependency "rspec", "~> 3.0"
|
28
28
|
spec.add_development_dependency "pry"
|
29
29
|
end
|
metadata
CHANGED
@@ -1,14 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ripgrep
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- motoki-shun
|
8
|
-
autorequire:
|
9
8
|
bindir: exe
|
10
9
|
cert_chain: []
|
11
|
-
date:
|
10
|
+
date: 1980-01-02 00:00:00.000000000 Z
|
12
11
|
dependencies:
|
13
12
|
- !ruby/object:Gem::Dependency
|
14
13
|
name: bundler
|
@@ -28,16 +27,16 @@ dependencies:
|
|
28
27
|
name: rake
|
29
28
|
requirement: !ruby/object:Gem::Requirement
|
30
29
|
requirements:
|
31
|
-
- - "
|
30
|
+
- - ">="
|
32
31
|
- !ruby/object:Gem::Version
|
33
|
-
version:
|
32
|
+
version: 12.3.3
|
34
33
|
type: :development
|
35
34
|
prerelease: false
|
36
35
|
version_requirements: !ruby/object:Gem::Requirement
|
37
36
|
requirements:
|
38
|
-
- - "
|
37
|
+
- - ">="
|
39
38
|
- !ruby/object:Gem::Version
|
40
|
-
version:
|
39
|
+
version: 12.3.3
|
41
40
|
- !ruby/object:Gem::Dependency
|
42
41
|
name: rspec
|
43
42
|
requirement: !ruby/object:Gem::Requirement
|
@@ -67,14 +66,14 @@ dependencies:
|
|
67
66
|
- !ruby/object:Gem::Version
|
68
67
|
version: '0'
|
69
68
|
description: A Ruby wrapper around ripgrep!
|
70
|
-
email:
|
71
69
|
executables: []
|
72
70
|
extensions: []
|
73
71
|
extra_rdoc_files: []
|
74
72
|
files:
|
73
|
+
- ".github/workflows/ci.yml"
|
75
74
|
- ".gitignore"
|
76
75
|
- ".rspec"
|
77
|
-
- ".
|
76
|
+
- ".tool-versions"
|
78
77
|
- ".travis.yml"
|
79
78
|
- Gemfile
|
80
79
|
- LICENSE.txt
|
@@ -93,7 +92,6 @@ homepage: https://github.com/shuuuuun/ripgrep-ruby
|
|
93
92
|
licenses:
|
94
93
|
- MIT
|
95
94
|
metadata: {}
|
96
|
-
post_install_message:
|
97
95
|
rdoc_options: []
|
98
96
|
require_paths:
|
99
97
|
- lib
|
@@ -108,8 +106,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
108
106
|
- !ruby/object:Gem::Version
|
109
107
|
version: '0'
|
110
108
|
requirements: []
|
111
|
-
rubygems_version: 3.
|
112
|
-
signing_key:
|
109
|
+
rubygems_version: 3.6.9
|
113
110
|
specification_version: 4
|
114
111
|
summary: A Ruby wrapper around ripgrep!
|
115
112
|
test_files: []
|
data/.ruby-version
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
2.6.3
|