spoom 1.4.1 → 1.5.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: 37744936fdd46ee10ee1bc3e85950a6028e78dc5c2c01b7a9308a478f19bd98a
4
- data.tar.gz: 5f92d0f181c1fa1191a808dc550bbb8a17b5f1f299586c1233bfd210c00faf0a
3
+ metadata.gz: ff274fd4bbf10a58317e281a8e570908fc9827ff74799cb2380d3b90f032240e
4
+ data.tar.gz: 16d95b8b1311eade324cbd6086b7f4fd2a30a760478582571cc6f88768a593d5
5
5
  SHA512:
6
- metadata.gz: dad03df8edb54fa5cc4f798b1654e22940d91bc063b2d7be3721d9b7bc1e97c0654589b78f632d4c7272e06fa4f85baab6d713f330da7de6c14b62d3b4e38caf
7
- data.tar.gz: c8c98e4fe0dd941ee9c9f4d9cdd77fc37686a455fa5d0e849bfab9dceac3ea5ef5bbbde3282e144159df611225790c19d3df29b2fd5b2d995378a5f53809b3f6
6
+ metadata.gz: 90b22051252521cf38c3ed26a4e728526e57e190f0f1cd8aca1f2574f9f6219f608f28905ab4fb6dca1d54e04834182e470f9da779d664f205d269fb6ac4c0e4
7
+ data.tar.gz: 3aa88be0f3edb8f2cc32d89e76ff83833f295204d3739424c6ea35dbe48db4df41a325771f840451b6bea1ed5e329ee2efaefd2c503a76ee483590f751a3017a
@@ -186,7 +186,7 @@ module Spoom
186
186
  if dry && command
187
187
  say("\nRun `#{command}` to bump #{files_count > 1 ? "them" : "it"}")
188
188
  elsif dry
189
- say("\nRun `spoom bump --from #{from} --to #{to}` locally then `commit the changes` and `push them`")
189
+ say("\nRun `spoom srb bump --from #{from} --to #{to}` locally then `commit the changes` and `push them`")
190
190
  end
191
191
  end
192
192
 
@@ -58,9 +58,9 @@ module Spoom
58
58
  # Get `gem` version from the `Gemfile.lock` content
59
59
  #
60
60
  # Returns `nil` if `gem` cannot be found in the Gemfile.
61
- sig { params(gem: String).returns(T.nilable(String)) }
61
+ sig { params(gem: String).returns(T.nilable(Gem::Version)) }
62
62
  def gem_version_from_gemfile_lock(gem)
63
- gemfile_lock_specs[gem]&.version&.to_s
63
+ gemfile_lock_specs[gem]&.version
64
64
  end
65
65
  end
66
66
  end
@@ -70,8 +70,8 @@ module Spoom
70
70
  end
71
71
  end
72
72
 
73
- snapshot.version_static = context.gem_version_from_gemfile_lock("sorbet-static")
74
- snapshot.version_runtime = context.gem_version_from_gemfile_lock("sorbet-runtime")
73
+ snapshot.version_static = context.gem_version_from_gemfile_lock("sorbet-static").to_s
74
+ snapshot.version_runtime = context.gem_version_from_gemfile_lock("sorbet-runtime").to_s
75
75
 
76
76
  files = context.srb_files(with_config: new_config)
77
77
  snapshot.rbi_files = files.count { |file| file.end_with?(".rbi") }
@@ -8,28 +8,20 @@ module Spoom
8
8
  extend T::Sig
9
9
 
10
10
  ignore_classes_named(/Test$/)
11
- ignore_classes_inheriting_from("Minitest::Test")
12
11
 
13
- MINITEST_METHODS = T.let(
14
- Set.new([
15
- "after_all",
16
- "around",
17
- "around_all",
18
- "before_all",
19
- "setup",
20
- "teardown",
21
- ]),
22
- T::Set[String],
12
+ ignore_methods_named(
13
+ "after_all",
14
+ "around",
15
+ "around_all",
16
+ "before_all",
17
+ "setup",
18
+ "teardown",
23
19
  )
24
20
 
25
21
  sig { override.params(definition: Model::Method).void }
26
22
  def on_define_method(definition)
27
- return unless definition.name.start_with?("test_") || MINITEST_METHODS.include?(definition.name)
28
-
29
- owner = definition.owner
30
- return unless owner.is_a?(Model::Class)
31
-
32
- @index.ignore(definition) if ignored_subclass?(owner)
23
+ file = definition.location.file
24
+ @index.ignore(definition) if file.match?(%r{test/.*test\.rb$}) && definition.name.match?(/^test_/)
33
25
  end
34
26
 
35
27
  sig { override.params(send: Send).void }
@@ -34,6 +34,9 @@ module Spoom
34
34
  if last_arg.is_a?(Prism::SymbolNode) || last_arg.is_a?(Prism::StringNode)
35
35
  @index.reference_method(last_arg.unescaped, send.location)
36
36
  end
37
+ when "method"
38
+ arg = send.args.first
39
+ @index.reference_method(arg.unescaped, send.location) if arg.is_a?(Prism::SymbolNode)
37
40
  end
38
41
  end
39
42
 
@@ -6,7 +6,7 @@ require_relative "sigils"
6
6
  module Spoom
7
7
  module Sorbet
8
8
  module MetricsParser
9
- DEFAULT_PREFIX = "ruby_typer.unknown.."
9
+ DEFAULT_PREFIX = "ruby_typer.unknown."
10
10
 
11
11
  class << self
12
12
  extend T::Sig
data/lib/spoom/version.rb CHANGED
@@ -2,5 +2,5 @@
2
2
  # frozen_string_literal: true
3
3
 
4
4
  module Spoom
5
- VERSION = "1.4.1"
5
+ VERSION = "1.5.0"
6
6
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: spoom
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.4.1
4
+ version: 1.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alexandre Terrasa
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-07-29 00:00:00.000000000 Z
11
+ date: 2024-09-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -233,7 +233,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
233
233
  - !ruby/object:Gem::Version
234
234
  version: '0'
235
235
  requirements: []
236
- rubygems_version: 3.5.16
236
+ rubygems_version: 3.5.18
237
237
  signing_key:
238
238
  specification_version: 4
239
239
  summary: Useful tools for Sorbet enthusiasts.