ruby-lsp-shoulda-context 0.3.3 → 0.4.0
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8112ca7fa20b49f281d1b3b89975e7cab08adbdc93d753daaa0b275423adff19
|
4
|
+
data.tar.gz: 7a175a8727300cc49bedf73b82e7263330262e319a8df36083215b4deed11f23
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 443dcb56b9542410765f47fc3a22d7135fa09ad71abb6e9d2308eee42566b5854c16564abc2f515e4e0433be5e830d1de5ff18c25b41e6612f6d3991129139dc
|
7
|
+
data.tar.gz: 1d9353e3befef9ee4b5f9e7f11cca6e44034fd8cd64c2af0250bacd7716b1113f7eaba9985003a909038c7d2dbddcac021fa5041eb26506c777776a9cdb72833
|
@@ -11,11 +11,12 @@ module RubyLsp
|
|
11
11
|
|
12
12
|
BASE_COMMAND = T.let(
|
13
13
|
begin
|
14
|
+
cmd = File.exist?(File.join(Dir.pwd, "bin", "rails")) ? "bin/rails test" : "ruby -ITest"
|
14
15
|
Bundler.with_original_env { Bundler.default_lockfile }
|
15
|
-
"bundle exec
|
16
|
+
"bundle exec #{cmd}"
|
16
17
|
rescue Bundler::GemfileNotFound
|
17
|
-
|
18
|
-
end
|
18
|
+
cmd
|
19
|
+
end,
|
19
20
|
String,
|
20
21
|
)
|
21
22
|
|
@@ -97,7 +98,7 @@ module RubyLsp
|
|
97
98
|
add_test_code_lens(
|
98
99
|
node,
|
99
100
|
name: class_name,
|
100
|
-
kind: :
|
101
|
+
kind: :class,
|
101
102
|
)
|
102
103
|
end
|
103
104
|
|
@@ -147,7 +148,13 @@ module RubyLsp
|
|
147
148
|
def add_test_code_lens(node, name:, kind:)
|
148
149
|
return unless DependencyDetector.instance.dependencies.include?(REQUIRED_LIBRARY)
|
149
150
|
|
150
|
-
|
151
|
+
if kind == :class
|
152
|
+
pattern = "#{@class_name}Test"
|
153
|
+
kind = :group
|
154
|
+
else
|
155
|
+
pattern = @pattern.strip
|
156
|
+
end
|
157
|
+
command = "#{@base_command} #{@path} --name \"/#{pattern}/\""
|
151
158
|
|
152
159
|
grouping_data = { group_id: @group_id_stack.last, kind: kind }
|
153
160
|
grouping_data[:id] = @group_id if kind == :group
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ruby-lsp-shoulda-context
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Domingo Edwards
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-02-
|
11
|
+
date: 2024-02-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: ruby-lsp
|