spoom 1.7.12 → 1.7.13

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: e5cf816e6ecd86209b75a94d71474288762d94b97da6e6637f2b67bb80c5fcf0
4
- data.tar.gz: fafeb36ec7993a9632dfa0e7c1b47b7e671122e2e0a89358b1c1ab86dd611aca
3
+ metadata.gz: 02432e9390507a5cc9072d83c3eaf7952d430fdb4329cf5e33e969513d21f58b
4
+ data.tar.gz: 693d74660c7aa1faad796f5a948bb06302c1b8d62dc3855665ea1125cb0ee1fd
5
5
  SHA512:
6
- metadata.gz: a28c07c9f9ddbd22a754d6f4619696d6a82caa6f8b355dd99fc90b27c42c14b8bbb4377e433ad593b7133fffe8397fa929c75e9d309dd9499a7aa105b2126fcb
7
- data.tar.gz: a098d8d9fba5cef4988d5e3e5fdc01493beec8c3ddd3a75e1b78353570872d447ab82f47a83d2cc3192b6f3699a7409f45b848e29d373eee03d273647e0afacf
6
+ metadata.gz: 3f34e8b9207ed4b538ef2ca5450041aa62baede9429d295e4348b68008cfe3df43e7e0f626b6e41e872e808afebeabe34bcd33536c6e6520e053b5b9be43a76d
7
+ data.tar.gz: b4e28008f5529e134664d250bd17f2934ed978045861031d9f4b9e5d13a4e7fbde24b86d07fbeca9e0e4e114a1e6bc07bf599efa4c0e1a5ee7ccfa322c57ab3b
@@ -149,6 +149,7 @@ module Spoom
149
149
 
150
150
  #{Spoom::BundlerHelper.gem_requirement_from_real_bundle("rbs")}
151
151
  #{Spoom::BundlerHelper.gem_requirement_from_real_bundle("tapioca")}
152
+ #{Spoom::BundlerHelper.gem_requirement_from_real_bundle("sorbet-static-and-runtime")}
152
153
 
153
154
  gem "#{spec.name}", path: "#{copy_context.absolute_path}"
154
155
  GEMFILE
@@ -15,7 +15,7 @@ module Spoom
15
15
  config = context.sorbet_config
16
16
  config.allowed_extensions.push(".rb", ".rbi") if config.allowed_extensions.empty?
17
17
 
18
- new_config = config.copy
18
+ new_config = config.dup
19
19
  new_config.allowed_extensions.reject! { |ext| !rbi && ext == ".rbi" }
20
20
  flags = [
21
21
  "--no-config",
@@ -33,6 +33,12 @@ module Spoom
33
33
  if last_arg.is_a?(Prism::SymbolNode) || last_arg.is_a?(Prism::StringNode)
34
34
  @index.reference_method(last_arg.unescaped, send.location)
35
35
  end
36
+ when "dup"
37
+ @index.reference_method("initialize_dup", send.location)
38
+ @index.reference_method("initialize_copy", send.location)
39
+ when "clone"
40
+ @index.reference_method("initialize_clone", send.location)
41
+ @index.reference_method("initialize_copy", send.location)
36
42
  when "method"
37
43
  arg = send.args.first
38
44
  @index.reference_method(arg.unescaped, send.location) if arg.is_a?(Prism::SymbolNode)
@@ -40,14 +40,12 @@ module Spoom
40
40
  @no_stdlib = false #: bool
41
41
  end
42
42
 
43
- #: -> Config
44
- def copy
45
- new_config = Sorbet::Config.new
46
- new_config.paths.concat(@paths)
47
- new_config.ignore.concat(@ignore)
48
- new_config.allowed_extensions.concat(@allowed_extensions)
49
- new_config.no_stdlib = @no_stdlib
50
- new_config
43
+ #: (Config source) -> void
44
+ def initialize_copy(source)
45
+ super
46
+ @paths = @paths.dup
47
+ @ignore = @ignore.dup
48
+ @allowed_extensions = @allowed_extensions.dup
51
49
  end
52
50
 
53
51
  # Returns self as a string of options that can be passed to Sorbet
@@ -107,8 +105,8 @@ module Spoom
107
105
  when /^--dir=/
108
106
  config.paths << parse_option(line)
109
107
  next
110
- when /^--no-stdlib$/
111
- config.no_stdlib = true
108
+ when /^--no-stdlib(=|$)/
109
+ config.no_stdlib = parse_bool_option(line)
112
110
  next
113
111
  when /^--.*=/
114
112
  next
@@ -143,6 +141,17 @@ module Spoom
143
141
  def parse_option(line)
144
142
  T.must(line.split("=").last).strip
145
143
  end
144
+
145
+ #: (String line) -> bool
146
+ def parse_bool_option(line)
147
+ return true unless line.include?("=") # `--foo` is equivalent to `--foo=true`
148
+
149
+ case parse_option(line)
150
+ when "true", "True", "t", "T", "1" then true
151
+ when "false", "False", "f", "F", "0" then false
152
+ else raise ArgumentError, "invalid boolean value: #{parse_option(line).inspect}"
153
+ end
154
+ end
146
155
  end
147
156
  end
148
157
  end
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.7.12"
5
+ VERSION = "1.7.13"
6
6
  end
data/rbi/spoom.rbi CHANGED
@@ -2603,10 +2603,6 @@ class Spoom::Sorbet::Config
2603
2603
 
2604
2604
  def allowed_extensions; end
2605
2605
  def allowed_extensions=(_arg0); end
2606
-
2607
- sig { returns(::Spoom::Sorbet::Config) }
2608
- def copy; end
2609
-
2610
2606
  def ignore; end
2611
2607
  def ignore=(_arg0); end
2612
2608
 
@@ -2623,6 +2619,11 @@ class Spoom::Sorbet::Config
2623
2619
 
2624
2620
  def paths=(_arg0); end
2625
2621
 
2622
+ private
2623
+
2624
+ sig { params(source: ::Spoom::Sorbet::Config).void }
2625
+ def initialize_copy(source); end
2626
+
2626
2627
  class << self
2627
2628
  sig { params(sorbet_config_path: ::String).returns(::Spoom::Sorbet::Config) }
2628
2629
  def parse_file(sorbet_config_path); end
@@ -2632,6 +2633,9 @@ class Spoom::Sorbet::Config
2632
2633
 
2633
2634
  private
2634
2635
 
2636
+ sig { params(line: ::String).returns(T::Boolean) }
2637
+ def parse_bool_option(line); end
2638
+
2635
2639
  sig { params(line: ::String).returns(::String) }
2636
2640
  def parse_option(line); end
2637
2641
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: spoom
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.7.12
4
+ version: 1.7.13
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alexandre Terrasa
@@ -43,14 +43,14 @@ dependencies:
43
43
  requirements:
44
44
  - - "~>"
45
45
  - !ruby/object:Gem::Version
46
- version: 13.3.0
46
+ version: 13.4.2
47
47
  type: :development
48
48
  prerelease: false
49
49
  version_requirements: !ruby/object:Gem::Requirement
50
50
  requirements:
51
51
  - - "~>"
52
52
  - !ruby/object:Gem::Version
53
- version: 13.3.0
53
+ version: 13.4.2
54
54
  - !ruby/object:Gem::Dependency
55
55
  name: erubi
56
56
  requirement: !ruby/object:Gem::Requirement