docscribe 1.0.0 → 1.2.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 +4 -4
- data/README.md +692 -180
- data/exe/docscribe +2 -74
- data/lib/docscribe/cli/config_builder.rb +62 -0
- data/lib/docscribe/cli/init.rb +58 -0
- data/lib/docscribe/cli/options.rb +204 -0
- data/lib/docscribe/cli/run.rb +415 -0
- data/lib/docscribe/cli.rb +31 -0
- data/lib/docscribe/config/defaults.rb +71 -0
- data/lib/docscribe/config/emit.rb +126 -0
- data/lib/docscribe/config/filtering.rb +160 -0
- data/lib/docscribe/config/loader.rb +59 -0
- data/lib/docscribe/config/rbs.rb +51 -0
- data/lib/docscribe/config/sorbet.rb +87 -0
- data/lib/docscribe/config/sorting.rb +23 -0
- data/lib/docscribe/config/template.rb +176 -0
- data/lib/docscribe/config/utils.rb +102 -0
- data/lib/docscribe/config.rb +20 -230
- data/lib/docscribe/infer/ast_walk.rb +28 -0
- data/lib/docscribe/infer/constants.rb +11 -0
- data/lib/docscribe/infer/literals.rb +55 -0
- data/lib/docscribe/infer/names.rb +43 -0
- data/lib/docscribe/infer/params.rb +62 -0
- data/lib/docscribe/infer/raises.rb +68 -0
- data/lib/docscribe/infer/returns.rb +171 -0
- data/lib/docscribe/infer.rb +110 -259
- data/lib/docscribe/inline_rewriter/collector.rb +845 -0
- data/lib/docscribe/inline_rewriter/doc_block.rb +383 -0
- data/lib/docscribe/inline_rewriter/doc_builder.rb +605 -0
- data/lib/docscribe/inline_rewriter/source_helpers.rb +228 -0
- data/lib/docscribe/inline_rewriter/tag_sorter.rb +244 -0
- data/lib/docscribe/inline_rewriter.rb +604 -425
- data/lib/docscribe/parsing.rb +120 -0
- data/lib/docscribe/types/provider_chain.rb +37 -0
- data/lib/docscribe/types/rbs/provider.rb +213 -0
- data/lib/docscribe/types/rbs/type_formatter.rb +132 -0
- data/lib/docscribe/types/signature.rb +65 -0
- data/lib/docscribe/types/sorbet/base_provider.rb +217 -0
- data/lib/docscribe/types/sorbet/rbi_provider.rb +35 -0
- data/lib/docscribe/types/sorbet/source_provider.rb +25 -0
- data/lib/docscribe/version.rb +1 -1
- data/lib/docscribe.rb +1 -0
- metadata +85 -17
- data/.rspec +0 -3
- data/.rubocop.yml +0 -11
- data/.rubocop_todo.yml +0 -73
- data/CODE_OF_CONDUCT.md +0 -84
- data/Gemfile +0 -6
- data/Gemfile.lock +0 -73
- data/Rakefile +0 -12
- data/rakelib/docs.rake +0 -73
- data/stingray_docs_internal.gemspec +0 -41
data/Gemfile.lock
DELETED
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
PATH
|
|
2
|
-
remote: .
|
|
3
|
-
specs:
|
|
4
|
-
docscribe (1.0.0)
|
|
5
|
-
parser (>= 3.0)
|
|
6
|
-
|
|
7
|
-
GEM
|
|
8
|
-
remote: https://rubygems.org/
|
|
9
|
-
specs:
|
|
10
|
-
ast (2.4.3)
|
|
11
|
-
diff-lcs (1.6.2)
|
|
12
|
-
json (2.16.0)
|
|
13
|
-
language_server-protocol (3.17.0.5)
|
|
14
|
-
lint_roller (1.1.0)
|
|
15
|
-
parallel (1.27.0)
|
|
16
|
-
parser (3.3.10.0)
|
|
17
|
-
ast (~> 2.4.1)
|
|
18
|
-
racc
|
|
19
|
-
prism (1.6.0)
|
|
20
|
-
racc (1.8.1)
|
|
21
|
-
rainbow (3.1.1)
|
|
22
|
-
rake (13.3.1)
|
|
23
|
-
regexp_parser (2.11.3)
|
|
24
|
-
rspec (3.13.2)
|
|
25
|
-
rspec-core (~> 3.13.0)
|
|
26
|
-
rspec-expectations (~> 3.13.0)
|
|
27
|
-
rspec-mocks (~> 3.13.0)
|
|
28
|
-
rspec-core (3.13.6)
|
|
29
|
-
rspec-support (~> 3.13.0)
|
|
30
|
-
rspec-expectations (3.13.5)
|
|
31
|
-
diff-lcs (>= 1.2.0, < 2.0)
|
|
32
|
-
rspec-support (~> 3.13.0)
|
|
33
|
-
rspec-mocks (3.13.7)
|
|
34
|
-
diff-lcs (>= 1.2.0, < 2.0)
|
|
35
|
-
rspec-support (~> 3.13.0)
|
|
36
|
-
rspec-support (3.13.6)
|
|
37
|
-
rubocop (1.81.7)
|
|
38
|
-
json (~> 2.3)
|
|
39
|
-
language_server-protocol (~> 3.17.0.2)
|
|
40
|
-
lint_roller (~> 1.1.0)
|
|
41
|
-
parallel (~> 1.10)
|
|
42
|
-
parser (>= 3.3.0.2)
|
|
43
|
-
rainbow (>= 2.2.2, < 4.0)
|
|
44
|
-
regexp_parser (>= 2.9.3, < 3.0)
|
|
45
|
-
rubocop-ast (>= 1.47.1, < 2.0)
|
|
46
|
-
ruby-progressbar (~> 1.7)
|
|
47
|
-
unicode-display_width (>= 2.4.0, < 4.0)
|
|
48
|
-
rubocop-ast (1.48.0)
|
|
49
|
-
parser (>= 3.3.7.2)
|
|
50
|
-
prism (~> 1.4)
|
|
51
|
-
rubocop-sorted_methods_by_call (1.1.2)
|
|
52
|
-
lint_roller
|
|
53
|
-
rubocop (>= 1.72.0)
|
|
54
|
-
ruby-progressbar (1.13.0)
|
|
55
|
-
unicode-display_width (3.2.0)
|
|
56
|
-
unicode-emoji (~> 4.1)
|
|
57
|
-
unicode-emoji (4.1.0)
|
|
58
|
-
yard (0.9.37)
|
|
59
|
-
|
|
60
|
-
PLATFORMS
|
|
61
|
-
ruby
|
|
62
|
-
x86_64-linux
|
|
63
|
-
|
|
64
|
-
DEPENDENCIES
|
|
65
|
-
docscribe!
|
|
66
|
-
rake
|
|
67
|
-
rspec (~> 3.0)
|
|
68
|
-
rubocop
|
|
69
|
-
rubocop-sorted_methods_by_call
|
|
70
|
-
yard (>= 0.9.34)
|
|
71
|
-
|
|
72
|
-
BUNDLED WITH
|
|
73
|
-
2.5.9
|
data/Rakefile
DELETED
data/rakelib/docs.rake
DELETED
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
require 'English'
|
|
4
|
-
require 'yard'
|
|
5
|
-
require 'fileutils'
|
|
6
|
-
|
|
7
|
-
GEM_NAME = Bundler.load_gemspec(Dir.glob('*.gemspec').first).name
|
|
8
|
-
DOCS_REPO_NAME = "#{GEM_NAME}_docs".freeze
|
|
9
|
-
DOCS_REPO_PATH = "../#{DOCS_REPO_NAME}".freeze
|
|
10
|
-
|
|
11
|
-
namespace :docs do # rubocop:disable Metrics/BlockLength
|
|
12
|
-
desc 'Generate new docs and push them to repo'
|
|
13
|
-
task generate: :clean do
|
|
14
|
-
puts 'Generating docs...'
|
|
15
|
-
YARD::CLI::Yardoc.run
|
|
16
|
-
puts 'OK!'
|
|
17
|
-
end
|
|
18
|
-
|
|
19
|
-
desc 'Clean existing docs'
|
|
20
|
-
task :clean do
|
|
21
|
-
if File.directory?('doc')
|
|
22
|
-
FileUtils.rm_rf('doc')
|
|
23
|
-
puts 'Cleaned existing docs directory'
|
|
24
|
-
end
|
|
25
|
-
end
|
|
26
|
-
|
|
27
|
-
desc 'Pushes docs to github'
|
|
28
|
-
task push: :generate do
|
|
29
|
-
unless File.directory?(DOCS_REPO_PATH)
|
|
30
|
-
puts "Error: Docs repo not found at #{DOCS_REPO_PATH}"
|
|
31
|
-
puts 'Please clone the docs repo first:'
|
|
32
|
-
puts " git clone git@github.com:unurgunite/#{DOCS_REPO_NAME}.git #{DOCS_REPO_PATH}"
|
|
33
|
-
exit 1
|
|
34
|
-
end
|
|
35
|
-
|
|
36
|
-
puts "Copying docs to #{DOCS_REPO_PATH}..."
|
|
37
|
-
FileUtils.mkdir_p('doc') unless File.directory?('doc')
|
|
38
|
-
FileUtils.cp_r('doc/.', DOCS_REPO_PATH)
|
|
39
|
-
|
|
40
|
-
puts 'Changing dir...'
|
|
41
|
-
Dir.chdir(DOCS_REPO_PATH) do
|
|
42
|
-
puts 'Checking git status...'
|
|
43
|
-
status_output = `git status --porcelain`
|
|
44
|
-
|
|
45
|
-
if status_output.strip.empty?
|
|
46
|
-
puts 'No changes to commit'
|
|
47
|
-
else
|
|
48
|
-
puts 'Committing git changes...'
|
|
49
|
-
puts `git add .`
|
|
50
|
-
commit_result = `git commit -m "Update docs for #{GEM_NAME} #{Time.now.utc.strftime('%Y-%m-%d %H:%M:%S UTC')}"`
|
|
51
|
-
puts commit_result
|
|
52
|
-
|
|
53
|
-
if $CHILD_STATUS.success?
|
|
54
|
-
puts 'Pushing to GitHub...'
|
|
55
|
-
push_result = `git push origin master 2>&1`
|
|
56
|
-
puts push_result
|
|
57
|
-
if $CHILD_STATUS.success?
|
|
58
|
-
puts 'Docs successfully pushed!'
|
|
59
|
-
else
|
|
60
|
-
puts 'Push failed!'
|
|
61
|
-
exit 1
|
|
62
|
-
end
|
|
63
|
-
else
|
|
64
|
-
puts 'Commit failed!'
|
|
65
|
-
exit 1
|
|
66
|
-
end
|
|
67
|
-
end
|
|
68
|
-
end
|
|
69
|
-
end
|
|
70
|
-
|
|
71
|
-
desc 'Generate and push docs in one command'
|
|
72
|
-
task deploy: :push
|
|
73
|
-
end
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
require_relative 'lib/docscribe/version'
|
|
4
|
-
|
|
5
|
-
Gem::Specification.new do |spec|
|
|
6
|
-
spec.name = 'docscribe'
|
|
7
|
-
spec.version = Docscribe::VERSION
|
|
8
|
-
spec.authors = ['unurgunite']
|
|
9
|
-
spec.email = ['senpaiguru1488@gmail.com']
|
|
10
|
-
|
|
11
|
-
spec.summary = 'Autogenerate documentation for Ruby code with YARD syntax.'
|
|
12
|
-
spec.homepage = 'https://github.com/unurgunite/docscribe'
|
|
13
|
-
spec.required_ruby_version = '>= 3.0'
|
|
14
|
-
|
|
15
|
-
spec.metadata['homepage_uri'] = spec.homepage
|
|
16
|
-
spec.metadata['source_code_uri'] = 'https://github.com/unurgunite/docscribe'
|
|
17
|
-
spec.metadata['changelog_uri'] = 'https://github.com/unurgunite/docscribe/blob/master/CHANGELOG.md'
|
|
18
|
-
spec.metadata['rubygems_mfa_required'] = 'true'
|
|
19
|
-
|
|
20
|
-
# Specify which files should be added to the gem when it is released.
|
|
21
|
-
# The `git ls-files -z` loads the files in the RubyGem that have been added into git.
|
|
22
|
-
spec.files = Dir.chdir(__dir__) do
|
|
23
|
-
`git ls-files -z`.split("\x0").reject do |f|
|
|
24
|
-
(File.expand_path(f) == __FILE__) || f.start_with?(*%w[bin/ test/ spec/ features/ .git .circleci appveyor])
|
|
25
|
-
end
|
|
26
|
-
end
|
|
27
|
-
spec.bindir = 'exe'
|
|
28
|
-
spec.executables = spec.files.grep(%r{\Aexe/}) { |f| File.basename(f) }
|
|
29
|
-
spec.require_paths = ['lib']
|
|
30
|
-
|
|
31
|
-
# Uncomment to register a new dependency of your gem
|
|
32
|
-
spec.add_dependency 'parser', '>= 3.0'
|
|
33
|
-
spec.add_development_dependency 'rake'
|
|
34
|
-
spec.add_development_dependency 'rspec', '~> 3.0'
|
|
35
|
-
spec.add_development_dependency 'rubocop'
|
|
36
|
-
spec.add_development_dependency 'rubocop-sorted_methods_by_call'
|
|
37
|
-
spec.add_development_dependency 'yard', '>= 0.9.34'
|
|
38
|
-
|
|
39
|
-
# For more information and examples about making a new gem, check out our
|
|
40
|
-
# guide at: https://bundler.io/guides/creating_gem.html
|
|
41
|
-
end
|