solargraph-rspec 0.1.0 → 0.1.1

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: b29106f92a5279085cce258a7aabc92070d5452446a8f5a0b9c141d2a3d5a52d
4
- data.tar.gz: a153e3a43ff36c494484ecef9e7ef4f31066b0c002f0c3e16505a3357231591f
3
+ metadata.gz: 46e92fa0735bc1e0b1129ce3c06208969dd8917a28e70286876d7f6307928e8c
4
+ data.tar.gz: 718485f0ea53780cb3ee6d076cb5be112d160d1c39866c91334142d1abff515a
5
5
  SHA512:
6
- metadata.gz: 7c12a1454723f6acfe6bafcb856ff300734d27429d6ee08f053f2c05b30f7ff3885bb595ce14fb360bbfeec1cbf9339938a52cfa2f63874fce4cbd2d6efacbcf
7
- data.tar.gz: 3b81a6a82e580bc0e5ff86a0aeb66d61f6f9c8a8e7191ac0df52a31ac482b9dc774cd10b43d881babf80fdd6e60c93dc87a25a7f72ad296aea6d57743c550055
6
+ metadata.gz: '06580663bc8c5424219a171e4f61121d98d04dfe9048bfaa3595c7717bdd2a88b6dcd5055218cbf2fe3c50f7ade5a148811a7c23b780c86d9f0bae8ea554a236'
7
+ data.tar.gz: 28ea8fe4be4f3402ca3079a747764013d6154adac0b114c2f9f23afe81599b403f0bb024856c3744ce7e8b64f80898eba210962cec68253e0edf25c90f3ce1d6
data/CHANGELOG.md CHANGED
@@ -9,6 +9,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
9
9
 
10
10
  -
11
11
 
12
+ ## [0.1.1] - 2024-05-13
13
+
14
+ ### Removed
15
+ - Removed redundant `active_support` dependency ([Issue #2](https://github.com/lekemula/solargraph-rspec/issues/2))
16
+
17
+ ### Fixed
18
+ - Fixed completions inside `subject` and `subject!` blocks
19
+
12
20
  ## [0.1.0] - 2024-05-11 (First Release 🎉)
13
21
 
14
22
  ### Added
data/README.md CHANGED
@@ -1,5 +1,6 @@
1
- # Solargraph::Rspec - A Solargraph plugin for better RSpec support
1
+ # Solargraph::Rspec - A [Solargraph](https://solargraph.org/) plugin for better [RSpec](https://rspec.info/) support
2
2
 
3
+ [![Gem Version](https://badge.fury.io/rb/solargraph-rspec.svg)](https://badge.fury.io/rb/solargraph-rspec)
3
4
  ![Tests](https://github.com/lekemula/solargraph-rspec/actions/workflows/ruby.yml/badge.svg)
4
5
  [![codecov](https://codecov.io/gh/lekemula/solargraph-rspec/graph/badge.svg?token=FH7ER8ZDPW)](https://codecov.io/gh/lekemula/solargraph-rspec)
5
6
 
@@ -18,6 +18,7 @@ module Solargraph
18
18
  HELPER_MODULES = ['RSpec::Matchers'].freeze
19
19
  HOOK_METHODS = %w[before after around].freeze
20
20
  LET_METHODS = %w[let let!].freeze
21
+ SUBJECT_METHODS = %w[subject subject!].freeze
21
22
  EXAMPLE_METHODS = %w[
22
23
  example
23
24
  it
@@ -34,6 +34,12 @@ module Solargraph
34
34
 
35
35
  yield [] if block_given?
36
36
  end
37
+
38
+ rspec_walker.on_subject do |subject_ast|
39
+ bind_closest_namespace(subject_ast, source_map)
40
+
41
+ yield [] if block_given?
42
+ end
37
43
  end
38
44
 
39
45
  private
@@ -105,9 +105,15 @@ module Solargraph
105
105
  end
106
106
  end
107
107
 
108
- walker.on :send, [nil, :subject] do |ast|
108
+ walker.on :block do |block_ast|
109
+ next if block_ast.children.first.type != :send
110
+
111
+ method_ast = block_ast.children.first
112
+ method_name = method_ast.children[1]
113
+ next unless Rspec::SUBJECT_METHODS.include?(method_name.to_s)
114
+
109
115
  @handlers[:on_subject].each do |handler|
110
- handler.call(ast)
116
+ handler.call(method_ast)
111
117
  end
112
118
  end
113
119
 
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Solargraph
4
4
  module Rspec
5
- VERSION = '0.1.0'
5
+ VERSION = '0.1.1'
6
6
  end
7
7
  end
@@ -2,7 +2,6 @@
2
2
  # frozen_string_literal: true
3
3
 
4
4
  require 'solargraph'
5
- require 'active_support'
6
5
 
7
6
  require_relative 'solargraph/rspec/version'
8
7
  require_relative 'solargraph/rspec/convention'
@@ -28,7 +28,6 @@ Gem::Specification.new do |spec|
28
28
  spec.executables = spec.files.grep(%r{\Aexe/}) { |f| File.basename(f) }
29
29
  spec.require_paths = ['lib']
30
30
 
31
- spec.add_runtime_dependency 'activesupport', '~> 6.0'
32
31
  spec.add_runtime_dependency 'solargraph', '~> 0.49', '>= 0.49.0'
33
32
 
34
33
  # For more information and examples about making a new gem, check out our
metadata CHANGED
@@ -1,29 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: solargraph-rspec
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Lekë Mula
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-05-11 00:00:00.000000000 Z
11
+ date: 2024-05-13 00:00:00.000000000 Z
12
12
  dependencies:
13
- - !ruby/object:Gem::Dependency
14
- name: activesupport
15
- requirement: !ruby/object:Gem::Requirement
16
- requirements:
17
- - - "~>"
18
- - !ruby/object:Gem::Version
19
- version: '6.0'
20
- type: :runtime
21
- prerelease: false
22
- version_requirements: !ruby/object:Gem::Requirement
23
- requirements:
24
- - - "~>"
25
- - !ruby/object:Gem::Version
26
- version: '6.0'
27
13
  - !ruby/object:Gem::Dependency
28
14
  name: solargraph
29
15
  requirement: !ruby/object:Gem::Requirement