orthoses-yard 0.2.0 → 0.3.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: 4360149f5950080699830fd17881758b818f6b02df358056975744cb3f883e47
4
- data.tar.gz: 877833515ad18d0e39f04a7526a055eacbc5bd92d6b3404363a747f67cb38edb
3
+ metadata.gz: b2f6b90fd20646f14534289bd4b876eb0faf8cb4a2d422d442bcbcefd07b2069
4
+ data.tar.gz: e7283f8f85defc5ac290310d35a8a248c47fd87ef09f54c2dd65e352373bc881
5
5
  SHA512:
6
- metadata.gz: a20fe50f64fd4b0bef16fe325b80a539a6fe3424cbaab57a42e6f20a290c3497d519f629a5509ee181493d05019f10fa1dda10f85bdb7c44ef4fced8c0283d84
7
- data.tar.gz: 87ea6a5128e5a37635e6f294f8fb1c96491bcd672cfce54f4682982727943f69e037fa683283800cc3fd62d8198671969817d040f34cce5210450f0a20499fc1
6
+ metadata.gz: 1796d238fbfa72d260fce28cf167ca6b0d595bc6b65faa0295e5416bd17aeec384303f8395b5aa5e3c9f8c9587ffb48cbb0a7654301ceb004be457a349a5d34b
7
+ data.tar.gz: 27a5c5c9dcfdd9d51834aa57c875c1e3600ed1a3841a930b199286624e843054a98653ff9f6e8af397fb46792136735283df49f5ed4aed4411feb14cad3b5f38
data/Gemfile.lock CHANGED
@@ -1,64 +1,74 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- orthoses-yard (0.2.0)
5
- orthoses (~> 1.3.0)
4
+ orthoses-yard (0.3.0)
5
+ orthoses (>= 1.3.0, < 2.0)
6
6
  yard
7
7
 
8
8
  GEM
9
9
  remote: https://rubygems.org/
10
10
  specs:
11
- activesupport (7.0.4)
11
+ activesupport (7.0.4.3)
12
12
  concurrent-ruby (~> 1.0, >= 1.0.2)
13
13
  i18n (>= 1.6, < 2)
14
14
  minitest (>= 5.1)
15
15
  tzinfo (~> 2.0)
16
16
  ast (2.4.2)
17
- concurrent-ruby (1.1.10)
18
- debug (1.6.2)
19
- irb (>= 1.3.6)
17
+ concurrent-ruby (1.2.2)
18
+ csv (3.2.6)
19
+ debug (1.7.1)
20
+ irb (>= 1.5.0)
20
21
  reline (>= 0.3.1)
21
22
  ffi (1.15.5)
23
+ fileutils (1.7.0)
22
24
  i18n (1.12.0)
23
25
  concurrent-ruby (~> 1.0)
24
- io-console (0.5.11)
25
- irb (1.4.2)
26
+ io-console (0.6.0)
27
+ irb (1.6.3)
26
28
  reline (>= 0.3.0)
27
- language_server-protocol (3.17.0.1)
28
- listen (3.7.1)
29
+ json (2.6.3)
30
+ language_server-protocol (3.17.0.3)
31
+ listen (3.8.0)
29
32
  rb-fsevent (~> 0.10, >= 0.10.3)
30
33
  rb-inotify (~> 0.9, >= 0.9.10)
31
- minitest (5.16.3)
32
- orthoses (1.3.0)
33
- rbs (~> 2.0)
34
+ logger (1.5.3)
35
+ minitest (5.18.0)
36
+ orthoses (1.6.0)
37
+ rbs (~> 3.0)
34
38
  parallel (1.22.1)
35
- parser (3.1.2.1)
39
+ parser (3.2.1.1)
36
40
  ast (~> 2.4.1)
37
41
  rainbow (3.1.1)
38
42
  rake (13.0.6)
39
43
  rb-fsevent (0.11.2)
40
44
  rb-inotify (0.10.1)
41
45
  ffi (~> 1.0)
42
- rbs (2.7.0)
43
- reline (0.3.1)
46
+ rbs (3.0.4)
47
+ reline (0.3.2)
44
48
  io-console (~> 0.5)
45
- rgot (1.1.0)
46
- securerandom (0.2.0)
47
- steep (1.2.0)
49
+ rgot (1.3.0)
50
+ securerandom (0.2.2)
51
+ steep (1.3.0)
48
52
  activesupport (>= 5.1)
53
+ csv (>= 3.0.9)
54
+ fileutils (>= 1.1.0)
55
+ json (>= 2.1.0)
49
56
  language_server-protocol (>= 3.15, < 4.0)
50
57
  listen (~> 3.0)
58
+ logger (>= 1.3.0)
51
59
  parallel (>= 1.0.0)
52
60
  parser (>= 3.1)
53
61
  rainbow (>= 2.2.2, < 4.0)
54
- rbs (>= 2.7.0)
62
+ rbs (>= 2.8.0)
55
63
  securerandom (>= 0.1)
64
+ strscan (>= 1.0.0)
56
65
  terminal-table (>= 2, < 4)
66
+ strscan (3.0.6)
57
67
  terminal-table (3.0.2)
58
68
  unicode-display_width (>= 1.1.1, < 3)
59
- tzinfo (2.0.5)
69
+ tzinfo (2.0.6)
60
70
  concurrent-ruby (~> 1.0)
61
- unicode-display_width (2.3.0)
71
+ unicode-display_width (2.4.2)
62
72
  webrick (1.7.0)
63
73
  yard (0.9.28)
64
74
  webrick (~> 1.7.0)
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Orthoses
4
4
  class YARD
5
- VERSION = "0.2.0"
5
+ VERSION = "0.3.0"
6
6
  end
7
7
  end
@@ -116,8 +116,6 @@ module Orthoses
116
116
  required_keywords = {}
117
117
  optional_keywords = {}
118
118
  rest_keywords = nil
119
- yield_params = []
120
- yield_return = nil
121
119
 
122
120
  requireds = required_positionals
123
121
 
@@ -21,7 +21,7 @@ Gem::Specification.new do |spec|
21
21
  spec.files = Dir.chdir(File.expand_path(__dir__)) do
22
22
  `git ls-files -z`.split("\x0").reject do |f|
23
23
  next true if (f == __FILE__)
24
- next true if f.match?(%r{\A(?:bin|known_sig)/}) # dir
24
+ next true if f.match?(%r{\A(?:bin|known_sig|examples)/}) # dir
25
25
  next true if f.match?(%r{\A\.(?:git)}) # git
26
26
  next true if f.match?(%r{\A(?:rbs_collection|Steepfile|Rakefile)}) # top file
27
27
  next true if f.match?(%r{_test\.rb\z}) # test
@@ -32,6 +32,6 @@ Gem::Specification.new do |spec|
32
32
  spec.executables = spec.files.grep(%r{\Aexe/}) { |f| File.basename(f) }
33
33
  spec.require_paths = ["lib"]
34
34
 
35
- spec.add_dependency "orthoses", "~> 1.3.0"
35
+ spec.add_dependency "orthoses", ">= 1.3.0", "< 2.0"
36
36
  spec.add_dependency "yard"
37
37
  end
metadata CHANGED
@@ -1,29 +1,35 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: orthoses-yard
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - ksss
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-10-12 00:00:00.000000000 Z
11
+ date: 2023-03-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: orthoses
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - "~>"
17
+ - - ">="
18
18
  - !ruby/object:Gem::Version
19
19
  version: 1.3.0
20
+ - - "<"
21
+ - !ruby/object:Gem::Version
22
+ version: '2.0'
20
23
  type: :runtime
21
24
  prerelease: false
22
25
  version_requirements: !ruby/object:Gem::Requirement
23
26
  requirements:
24
- - - "~>"
27
+ - - ">="
25
28
  - !ruby/object:Gem::Version
26
29
  version: 1.3.0
30
+ - - "<"
31
+ - !ruby/object:Gem::Version
32
+ version: '2.0'
27
33
  - !ruby/object:Gem::Dependency
28
34
  name: yard
29
35
  requirement: !ruby/object:Gem::Requirement
@@ -50,17 +56,6 @@ files:
50
56
  - Gemfile.lock
51
57
  - LICENSE.txt
52
58
  - README.md
53
- - examples/yard/Gemfile
54
- - examples/yard/Gemfile.lock
55
- - examples/yard/Rakefile
56
- - examples/yard/generate.rb
57
- - examples/yard/rbs_collection.lock.yaml
58
- - examples/yard/rbs_collection.yaml
59
- - examples/yard/templates/EXTERNAL_TODO.rbs
60
- - examples/yard/templates/_scripts/test.erb
61
- - examples/yard/templates/_test/Steepfile.erb
62
- - examples/yard/templates/_test/yard.rb
63
- - examples/yard/templates/manifest.yaml.erb
64
59
  - lib/orthoses-yard.rb
65
60
  - lib/orthoses/yard.rb
66
61
  - lib/orthoses/yard/version.rb
@@ -91,7 +86,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
91
86
  - !ruby/object:Gem::Version
92
87
  version: '0'
93
88
  requirements: []
94
- rubygems_version: 3.3.16
89
+ rubygems_version: 3.4.8
95
90
  signing_key:
96
91
  specification_version: 4
97
92
  summary: Orthoses extention for YARD.
@@ -1,10 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- source "https://rubygems.org"
4
-
5
- gem "yard"
6
- gem "orthoses-yard", path: "../../"
7
- gem "rake"
8
- gem "rack"
9
- gem "sord"
10
- gem "debug"
@@ -1,59 +0,0 @@
1
- PATH
2
- remote: ../..
3
- specs:
4
- orthoses-yard (0.1.0)
5
- orthoses (~> 1.2.0)
6
- yard
7
-
8
- GEM
9
- remote: https://rubygems.org/
10
- specs:
11
- ast (2.4.2)
12
- commander (4.6.0)
13
- highline (~> 2.0.0)
14
- debug (1.6.2)
15
- irb (>= 1.3.6)
16
- reline (>= 0.3.1)
17
- highline (2.0.3)
18
- io-console (0.5.11)
19
- irb (1.4.2)
20
- reline (>= 0.3.0)
21
- orthoses (1.2.0)
22
- rbs (~> 2.0)
23
- parlour (5.0.0)
24
- commander (~> 4.5)
25
- parser
26
- rainbow (~> 3.0)
27
- sorbet-runtime (>= 0.5)
28
- parser (3.1.2.1)
29
- ast (~> 2.4.1)
30
- rack (3.0.0)
31
- rainbow (3.1.1)
32
- rake (13.0.6)
33
- rbs (2.7.0)
34
- reline (0.3.1)
35
- io-console (~> 0.5)
36
- sorbet-runtime (0.5.10482)
37
- sord (5.0.0)
38
- commander (~> 4.5)
39
- parlour (~> 5.0)
40
- rbs (~> 2.0)
41
- sorbet-runtime
42
- yard
43
- webrick (1.7.0)
44
- yard (0.9.28)
45
- webrick (~> 1.7.0)
46
-
47
- PLATFORMS
48
- arm64-darwin-21
49
-
50
- DEPENDENCIES
51
- debug
52
- orthoses-yard!
53
- rack
54
- rake
55
- sord
56
- yard
57
-
58
- BUNDLED WITH
59
- 2.3.16
@@ -1,7 +0,0 @@
1
- task :generate do
2
- load 'generate.rb'
3
- end
4
-
5
- task :validate do
6
- sh "rbs -I out validate --silent"
7
- end
@@ -1,81 +0,0 @@
1
- require 'orthoses-yard'
2
- require 'fileutils'
3
- require 'pathname'
4
- require 'erb'
5
-
6
- output_dir = 'out'
7
- FileUtils.rm_rf(output_dir)
8
- Orthoses.logger.level = :warn
9
-
10
- gem_path = Gem::Specification.find_by_name("yard").load_paths.first
11
- notice = "# !!! GENERATED FILE !!!\n# Please see generators/yard-generator/README.md\n"
12
-
13
- Orthoses::Builder.new do
14
- use Orthoses::CreateFileByName,
15
- base_dir: output_dir,
16
- header: notice
17
- use Orthoses::Filter do |name, content|
18
- name.start_with?('YARD') ||
19
- name.start_with?('Ripper') ||
20
- name.start_with?('OpenStruct') ||
21
- name.start_with?('SymbolHash') ||
22
- name.start_with?('Rake') ||
23
- name.start_with?('WEBrick') ||
24
- name.start_with?('RDoc')
25
- end
26
- use Orthoses::Tap do |store|
27
- store['YARD'].header = 'module YARD'
28
- store['YARD::CodeObjects'].header = 'module YARD::CodeObjects'
29
- store['YARD::Handlers'].header = 'module YARD::Handlers'
30
- store['YARD::Handlers::C'].header = 'module YARD::Handlers::C'
31
- store['YARD::Handlers::Common'].header = 'module YARD::Handlers::Common'
32
- store['YARD::Handlers::Ruby'].header = 'module YARD::Handlers::Ruby'
33
- # TODO: support generics
34
- store['YARD::Tags::Library'] << 'def self.labels: () -> SymbolHash'
35
-
36
- # FIXME: YARD's issue?
37
- store['YARD::CLI::YardocOptions'].delete("# @return [Numeric] An index value for rendering sequentially related templates\nattr_accessor index: Numeric")
38
- end
39
- use Orthoses::YARD,
40
- parse: [
41
- "#{gem_path}/yard.rb",
42
- "#{gem_path}/yard/**/*.rb",
43
- ]
44
- use Orthoses::Autoload
45
- run -> {
46
- require 'yard'
47
- YARD::Tags::Library.define_tag("YARD Tag Signature", 'yard.signature'.to_sym, nil)
48
- YARD::Tags::Library.define_tag("YARD Tag", 'yard.tag'.to_sym, :with_types_and_name)
49
- YARD::Tags::Library.define_tag("YARD Directive", 'yard.directive'.to_sym, :with_types_and_name)
50
- }
51
- end.call
52
-
53
- stdlib_dependencies = %w[
54
- set
55
- optparse
56
- logger
57
- monitor
58
- ]
59
-
60
- def erb(template_filename, **vars)
61
- "templates/#{template_filename}.erb"
62
- .then { File.expand_path(_1) }
63
- .then { File.read(_1) }
64
- .then { ERB.new(_1, trim_mode: '<>').result_with_hash(vars) }
65
- end
66
-
67
- out = Pathname(output_dir)
68
- out.join("EXTERNAL_TODO.rbs").write(erb("EXTERNAL_TODO.rbs", notice: notice))
69
- out.join("manifest.yaml").write(erb("manifest.yaml", notice: notice, stdlib_dependencies: stdlib_dependencies))
70
- out.join('_scripts').tap do |scripts|
71
- scripts.mkpath
72
- scripts.join("test").tap do |test|
73
- test.write(erb("_scripts/test", notice: notice, stdlib_dependencies: stdlib_dependencies))
74
- test.chmod(0o755)
75
- end
76
- end
77
- out.join('_test').tap do |test|
78
- test.mkpath
79
- test.join("yard.rb").write(erb("_test/yard.rb", notice: notice))
80
- test.join('Steepfile').write(erb("_test/Steepfile", notice: notice, stdlib_dependencies: stdlib_dependencies))
81
- end
@@ -1,80 +0,0 @@
1
- ---
2
- sources:
3
- - name: ruby/gem_rbs_collection
4
- remote: https://github.com/ruby/gem_rbs_collection.git
5
- revision: main
6
- repo_dir: gems
7
- path: ".gem_rbs_collection"
8
- gems:
9
- - name: rbs
10
- version: 2.7.0
11
- source:
12
- type: rubygems
13
- - name: ast
14
- version: '2.4'
15
- source:
16
- type: git
17
- name: ruby/gem_rbs_collection
18
- revision: 6b07483f37484e2b7df168598b95b0c79be2924f
19
- remote: https://github.com/ruby/gem_rbs_collection.git
20
- repo_dir: gems
21
- - name: io-console
22
- version: '0'
23
- source:
24
- type: stdlib
25
- - name: orthoses
26
- version: 1.2.0
27
- source:
28
- type: rubygems
29
- - name: orthoses-yard
30
- version: 0.1.0
31
- source:
32
- type: rubygems
33
- - name: rack
34
- version: '2.2'
35
- source:
36
- type: git
37
- name: ruby/gem_rbs_collection
38
- revision: 6b07483f37484e2b7df168598b95b0c79be2924f
39
- remote: https://github.com/ruby/gem_rbs_collection.git
40
- repo_dir: gems
41
- - name: rainbow
42
- version: '3.0'
43
- source:
44
- type: git
45
- name: ruby/gem_rbs_collection
46
- revision: 6b07483f37484e2b7df168598b95b0c79be2924f
47
- remote: https://github.com/ruby/gem_rbs_collection.git
48
- repo_dir: gems
49
- - name: logger
50
- version: '0'
51
- source:
52
- type: stdlib
53
- - name: set
54
- version: '0'
55
- source:
56
- type: stdlib
57
- - name: pathname
58
- version: '0'
59
- source:
60
- type: stdlib
61
- - name: json
62
- version: '0'
63
- source:
64
- type: stdlib
65
- - name: optparse
66
- version: '0'
67
- source:
68
- type: stdlib
69
- - name: tsort
70
- version: '0'
71
- source:
72
- type: stdlib
73
- - name: rdoc
74
- version: '0'
75
- source:
76
- type: stdlib
77
- - name: monitor
78
- version: '0'
79
- source:
80
- type: stdlib
@@ -1,12 +0,0 @@
1
- # Download sources
2
- sources:
3
- - name: ruby/gem_rbs_collection
4
- remote: https://github.com/ruby/gem_rbs_collection.git
5
- revision: main
6
- repo_dir: gems
7
-
8
- # A directory to install the downloaded RBSs
9
- path: .gem_rbs_collection
10
-
11
- gems:
12
- - name: rbs
@@ -1,30 +0,0 @@
1
- # It is a temporary definition of a type definition
2
- # for which the library RBS does not currently exist.
3
- # Once the library RBS is defined and included in rbs_collection.lock.yaml,
4
- # the duplicate type definitions in this file should be removed.
5
-
6
- class OpenStruct
7
- end
8
-
9
- class Ripper
10
- end
11
-
12
- module Rake
13
- class TaskLib
14
- end
15
- end
16
-
17
-
18
- module WEBrick
19
- module HTTPServlet
20
- class AbstractServlet
21
- end
22
- end
23
- end
24
-
25
- module RDoc
26
- module Markup
27
- class ToHtml
28
- end
29
- end
30
- end
@@ -1,20 +0,0 @@
1
- #!/usr/bin/env bash
2
-
3
- # Exit command with non-zero status code, Output logs of every command executed, Treat unset variables as an error when substituting.
4
- set -eou pipefail
5
- # Internal Field Separator - Linux shell variable
6
- IFS=$'
7
- '
8
- # Print shell input lines
9
- set -v
10
-
11
- # Set RBS_DIR variable to change directory to execute type checks using `steep check`
12
- RBS_DIR=$(cd $(dirname $0)/..; pwd)
13
- # Set REPO_DIR variable to validate RBS files added to the corresponding folder
14
- REPO_DIR=$(cd $(dirname $0)/../../..; pwd)
15
- # Validate RBS files, using the bundler environment present
16
- bundle exec rbs --repo $REPO_DIR -r yard:0.9 <%= stdlib_dependencies.map { "-r #{_1}" }.join(' ') %> -r rack:2.2.2 validate --silent
17
-
18
- cd ${RBS_DIR}/_test
19
- # Run type checks
20
- bundle exec steep check
@@ -1,17 +0,0 @@
1
- D = Steep::Diagnostic
2
-
3
- target :test do
4
- check "."
5
- signature '.'
6
-
7
- repo_path "../../../"
8
-
9
- <% stdlib_dependencies.each do |stdlib| %>
10
- library "<%= stdlib %>"
11
- <% end %>
12
-
13
- library "yard:0.9"
14
- library "rack:2.2.2"
15
-
16
- configure_code_diagnostics(D::Ruby.all_error)
17
- end
@@ -1,6 +0,0 @@
1
- require 'yard'
2
-
3
- YARD::Registry.root.children.each do |child|
4
- child.name(false)
5
- child.docstring.all
6
- end
@@ -1,4 +0,0 @@
1
- dependencies:
2
- <% stdlib_dependencies.each do |stdlib| %>
3
- - <%= stdlib %>
4
- <% end %>