sord 5.0.1 → 6.0.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: 84021ad2fe6eca96e0b11e2ebc8b41fb7070c9e8bcd32db11e39fafecd463d86
4
- data.tar.gz: a38b1025856359aff335bcac403a563ac1cbe526c2c6edb8ab3d3c6e1088af02
3
+ metadata.gz: 54bd59da2188e5392c6946e2cbd77ce55e1113abc40a2cf880671afe3c22efac
4
+ data.tar.gz: 9671e16277cba3b800d8dc4dcae525384064efd1138575eef441719624ebf45d
5
5
  SHA512:
6
- metadata.gz: 9857df42edf887fc03ba10d21acd9389e6d7d87427424e5881f58eee004fabb0e644cb4bad1c487ce716af712d0208f170f7f6eafd0d6f01bc853cdf3a319ffe
7
- data.tar.gz: 30195da215e3a1dcba962a441e1498733ab410c59e9b6f4eab5f56be524131c0050ec150ce37b616c3d1ce2125d6b85f7cf00fe7b2b0f5a95c5eb99525736c8e
6
+ metadata.gz: f9c0ca7bc3d427367fe069cc415e37a0250ad7c3010ebbfa119dbdd97f98b474da0a7092277f2f45810d376654545b930b3c59a7a537f4132a23ad68352f913d
7
+ data.tar.gz: 8b6ced8d20985ee9faaae5b672ebd90bd4ef00d396938e7db1e6fecf350d817b143db55eca1231782bf2c0bd5605394eac825d8fa612ff7e093fc0f3ce27e14c
data/CHANGELOG.md CHANGED
@@ -3,6 +3,15 @@ All notable changes to this project will be documented in this file.
3
3
 
4
4
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
5
5
 
6
+ ## [6.0.0] - 2023-05-02
7
+ ### Changed
8
+ - **Breaking change**: Now targets RBS 3.0
9
+
10
+ ## [5.1.0] - 2023-05-22
11
+ ### Added
12
+ - Add support for a single `@overload` tag, typically used to describe methods defined outside of
13
+ Ruby. Thanks @ohai!
14
+
6
15
  ## [5.0.1] - 2023-05-02
7
16
  ### Fixed
8
17
  - Use `File#exist?` instead of `File#exists?`, for Ruby 3.2 support. Thanks @matmorel!
@@ -294,6 +294,15 @@ module Sord
294
294
  next
295
295
  end
296
296
 
297
+ # If the method has YARD's "@overload" tags, the information of the
298
+ # first one is merged into meth object
299
+ # NOTE: This code does not handle the second and subsequent @overload tags
300
+ if meth.tag("overload")
301
+ meth.parameters = meth.tag("overload").parameters
302
+ meth.tag("overload").tags.each { |tag| meth.add_tag(tag) }
303
+ meth.docstring += meth.tag("overload").docstring
304
+ end
305
+
297
306
  # Sort parameters
298
307
  meth.parameters.reverse.sort! { |pair1, pair2| sort_params(pair1, pair2) }
299
308
 
data/lib/sord/resolver.rb CHANGED
@@ -22,13 +22,13 @@ module Sord
22
22
  end
23
23
 
24
24
  def self.load_gem_objects(hash)
25
- all_decls = []
25
+ env = RBS::Environment.new
26
26
  begin
27
- RBS::CLI::LibraryOptions.new.loader.load(env: all_decls)
27
+ RBS::CLI::LibraryOptions.new.loader.load(env: env)
28
28
  rescue RBS::Collection::Config::CollectionNotAvailable
29
29
  Sord::Logging.warn("Could not load RBS collection - run rbs collection install for dependencies")
30
30
  end
31
- add_rbs_objects_to_paths(all_decls, hash)
31
+ add_rbs_objects_to_paths(env, hash)
32
32
 
33
33
  gem_paths = Bundler.load.specs.map(&:full_gem_path)
34
34
  gem_paths.each do |path|
@@ -41,13 +41,22 @@ module Sord
41
41
  end
42
42
  end
43
43
 
44
- def self.add_rbs_objects_to_paths(all_decls, names_to_paths, path=[])
44
+ def self.add_rbs_objects_to_paths(env, names_to_paths, path=[])
45
+ case env
46
+ when RBS::Environment
47
+ declarations = env.declarations
48
+ when Array
49
+ declarations = env
50
+ else
51
+ raise TypeError, "env"
52
+ end
53
+
45
54
  klasses = [
46
55
  RBS::AST::Declarations::Module,
47
56
  RBS::AST::Declarations::Class,
48
57
  RBS::AST::Declarations::Constant
49
58
  ]
50
- all_decls.each do |decl|
59
+ declarations.each do |decl|
51
60
  next unless klasses.include?(decl.class)
52
61
  name = decl.name.to_s
53
62
  new_path = path + [name]
data/lib/sord/version.rb CHANGED
@@ -1,4 +1,4 @@
1
1
  # typed: strong
2
2
  module Sord
3
- VERSION = '5.0.1'
3
+ VERSION = '6.0.0'
4
4
  end
data/sord.gemspec CHANGED
@@ -26,7 +26,7 @@ Gem::Specification.new do |spec|
26
26
  spec.add_dependency 'sorbet-runtime'
27
27
  spec.add_dependency 'commander', '~> 4.5'
28
28
  spec.add_dependency 'parlour', '~> 5.0'
29
- spec.add_dependency 'rbs', '~> 2.0'
29
+ spec.add_dependency 'rbs', '~> 3.0'
30
30
 
31
31
  spec.add_development_dependency "bundler", "~> 2.0"
32
32
  spec.add_development_dependency "rake", "~> 13.0"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sord
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.0.1
4
+ version: 6.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Aaron Christiansen
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-05-02 00:00:00.000000000 Z
11
+ date: 2023-05-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: yard
@@ -72,14 +72,14 @@ dependencies:
72
72
  requirements:
73
73
  - - "~>"
74
74
  - !ruby/object:Gem::Version
75
- version: '2.0'
75
+ version: '3.0'
76
76
  type: :runtime
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
80
  - - "~>"
81
81
  - !ruby/object:Gem::Version
82
- version: '2.0'
82
+ version: '3.0'
83
83
  - !ruby/object:Gem::Dependency
84
84
  name: bundler
85
85
  requirement: !ruby/object:Gem::Requirement