yard 0.9.28 → 0.9.37

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.
Files changed (90) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +71 -0
  3. data/LEGAL +29 -1
  4. data/README.md +8 -1
  5. data/docs/Tags.md +1 -1
  6. data/docs/WhatsNew.md +2 -2
  7. data/lib/yard/autoload.rb +3 -1
  8. data/lib/yard/cli/command.rb +1 -1
  9. data/lib/yard/cli/yardoc.rb +1 -1
  10. data/lib/yard/code_objects/base.rb +5 -1
  11. data/lib/yard/code_objects/macro_object.rb +0 -1
  12. data/lib/yard/docstring_parser.rb +1 -2
  13. data/lib/yard/handlers/processor.rb +0 -1
  14. data/lib/yard/handlers/ruby/attribute_handler.rb +1 -1
  15. data/lib/yard/handlers/ruby/legacy/attribute_handler.rb +1 -1
  16. data/lib/yard/handlers/ruby/mixin_handler.rb +13 -6
  17. data/lib/yard/handlers/ruby/visibility_handler.rb +13 -1
  18. data/lib/yard/i18n/locale.rb +1 -1
  19. data/lib/yard/i18n/message.rb +2 -2
  20. data/lib/yard/i18n/messages.rb +1 -1
  21. data/lib/yard/i18n/pot_generator.rb +1 -1
  22. data/lib/yard/logging.rb +116 -61
  23. data/lib/yard/open_struct.rb +67 -0
  24. data/lib/yard/options.rb +1 -1
  25. data/lib/yard/parser/ruby/legacy/ruby_lex.rb +19 -4
  26. data/lib/yard/parser/ruby/ruby_parser.rb +8 -2
  27. data/lib/yard/parser/source_parser.rb +4 -5
  28. data/lib/yard/registry_resolver.rb +2 -1
  29. data/lib/yard/server/commands/base.rb +1 -1
  30. data/lib/yard/server/commands/library_command.rb +8 -8
  31. data/lib/yard/server/commands/static_file_helpers.rb +1 -2
  32. data/lib/yard/server/http_utils.rb +512 -0
  33. data/lib/yard/server/rack_adapter.rb +13 -5
  34. data/lib/yard/tags/default_factory.rb +1 -0
  35. data/lib/yard/tags/directives.rb +0 -1
  36. data/lib/yard/tags/tag.rb +3 -2
  37. data/lib/yard/tags/types_explainer.rb +1 -1
  38. data/lib/yard/templates/engine.rb +0 -1
  39. data/lib/yard/templates/helpers/html_helper.rb +1 -1
  40. data/lib/yard/templates/template_options.rb +0 -1
  41. data/lib/yard/version.rb +1 -1
  42. data/po/ja.po +19 -19
  43. data/templates/default/fulldoc/html/css/full_list.css +3 -3
  44. data/templates/default/fulldoc/html/css/style.css +6 -0
  45. data/templates/default/fulldoc/html/frames.erb +9 -4
  46. data/templates/default/fulldoc/html/full_list.erb +5 -2
  47. data/templates/default/fulldoc/html/js/app.js +294 -264
  48. data/templates/default/fulldoc/html/js/full_list.js +30 -4
  49. data/templates/default/fulldoc/html/setup.rb +10 -2
  50. data/templates/default/onefile/html/headers.erb +2 -0
  51. data/templates/default/tags/html/example.erb +2 -2
  52. data/templates/default/tags/html/option.erb +1 -1
  53. metadata +6 -55
  54. data/.dockerignore +0 -2
  55. data/.gitattributes +0 -4
  56. data/.github/FUNDING.yml +0 -3
  57. data/.github/ISSUE_TEMPLATE.md +0 -33
  58. data/.github/PULL_REQUEST_TEMPLATE.md +0 -12
  59. data/.github/workflows/ci.yml +0 -30
  60. data/.github/workflows/gem.yml +0 -19
  61. data/.gitignore +0 -14
  62. data/.rspec +0 -2
  63. data/.rubocop.yml +0 -112
  64. data/CODE_OF_CONDUCT.md +0 -15
  65. data/CONTRIBUTING.md +0 -140
  66. data/Dockerfile.samus +0 -28
  67. data/Gemfile +0 -34
  68. data/Rakefile +0 -36
  69. data/SECURITY.md +0 -26
  70. data/benchmarks/builtins_vs_eval.rb +0 -24
  71. data/benchmarks/concat_vs_join.rb +0 -13
  72. data/benchmarks/erb_vs_erubis.rb +0 -54
  73. data/benchmarks/format_args.rb +0 -47
  74. data/benchmarks/generation.rb +0 -38
  75. data/benchmarks/marshal_vs_dbm.rb +0 -64
  76. data/benchmarks/parsing.rb +0 -46
  77. data/benchmarks/pathname_vs_string.rb +0 -51
  78. data/benchmarks/rdoc_vs_yardoc.rb +0 -11
  79. data/benchmarks/registry_store_types.rb +0 -49
  80. data/benchmarks/ri_vs_yri.rb +0 -19
  81. data/benchmarks/ripper_parser.rb +0 -13
  82. data/benchmarks/splat_vs_flatten.rb +0 -13
  83. data/benchmarks/template_erb.rb +0 -23
  84. data/benchmarks/template_format.rb +0 -7
  85. data/benchmarks/template_profile.rb +0 -18
  86. data/benchmarks/yri_cache.rb +0 -20
  87. data/samus.json +0 -49
  88. data/tasks/prepare_tag.rake +0 -45
  89. data/tasks/update_error_map.rake +0 -53
  90. data/yard.gemspec +0 -25
@@ -1,45 +0,0 @@
1
- require 'json'
2
- require 'tempfile'
3
-
4
- namespace :release do
5
- desc 'Updates repository and tags VERSION=X.Y.Z'
6
- task :tag do
7
- restore_file = Tempfile.new
8
- restore_file.close
9
- at_exit { restore_file.unlink }
10
-
11
- version = ENV['VERSION']
12
- build_path = File.expand_path(File.join(`gem which samus`.strip, '..', '..', 'commands', 'build'))
13
- samus_contents = File.read(File.join(__dir__, '..', 'samus.json'))
14
- samus_json = JSON.parse(samus_contents.gsub('$version', version))
15
-
16
- samus_json['actions'].each do |action|
17
- env = {
18
- '_VERSION' => version,
19
- '__ORIG_BRANCH' => `git rev-parse --abbrev-ref HEAD`.strip,
20
- '__RESTORE_FILE' => restore_file.path,
21
- }
22
- (action['arguments'] || {}).each {|k, v| env["_#{k.upcase}"] = v }
23
- cmd = [File.join(build_path, action['action']), *action['files']]
24
- puts "[C] #{action['action']} #{(action['files'] || []).join(' ')}"
25
- output = ""
26
- IO.popen(env, cmd) {|io| output = io.read }
27
- status = $?
28
- unless status.success?
29
- puts "[F] Last command failed with: #{status.to_i}"
30
- puts output
31
- exit(status.to_i)
32
- end
33
- end
34
-
35
- puts ""
36
- puts "Tag v#{version} created. To publish, type the following:"
37
- puts ""
38
- puts " bundle exec rake release:push VERSION=#{version}"
39
- end
40
-
41
- desc 'Pushes the main branch and tag for VERSION=X.Y.Z'
42
- task :push do
43
- sh "git push main v#{ENV['VERSION']}"
44
- end
45
- end
@@ -1,53 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- # Script to generate the Error class name map in:
4
- # lib/yard/handlers/c/base.rb
5
-
6
- require 'open-uri'
7
- require 'stringio'
8
-
9
- desc 'Update the error class names map'
10
- task :update_error_map do
11
-
12
- ERROR_C_URL = 'https://raw.githubusercontent.com/ruby/ruby/master/error.c'
13
-
14
- INIT_MATCH = /void\s+Init_Exception\(void\)\s*\{(.+?)^\}/m
15
- NAME_MATCH = /(\w+)\s*=\s*rb_define_class\("([^"]+)"/
16
-
17
- $stderr.puts "Downloading #{ERROR_C_URL} ..."
18
- content = open(ERROR_C_URL) { |io| io.read }
19
-
20
- $stderr.puts "Extracting class names ..."
21
- init_source = content.match(INIT_MATCH).captures.first
22
- map = init_source.scan(NAME_MATCH).sort_by { |key, value| key }
23
-
24
- $stderr.puts "Generating new lookup table ..."
25
- indent = ' ' * 4
26
- source = StringIO.new
27
- source.puts "#{indent}ERROR_CLASS_NAMES = {"
28
- map.each do |variable, name|
29
- source.puts "#{indent} '#{variable}' => '#{name}',"
30
- end
31
- source.puts "#{indent}}"
32
-
33
- $stderr.puts source.string
34
-
35
- $stderr.puts "Patching 'lib/yard/handlers/c/base.rb' ..."
36
- CLASS_NAME_MAP_MATCH = /^\s+ERROR_CLASS_NAMES = {[^}]+}/
37
-
38
- PROJECT_PATH = File.expand_path('..', __dir__)
39
- C_BASE_HANDLER = File.join(PROJECT_PATH, 'lib/yard/handlers/c/base.rb')
40
-
41
- File.open(C_BASE_HANDLER, 'r+') { |file|
42
- content = file.read
43
- # .rstrip is added to avoid adding new empty lines due to the new lines
44
- # added by `.puts` when building the string.
45
- content.gsub!(CLASS_NAME_MAP_MATCH, source.string.rstrip)
46
- file.rewind
47
- file.truncate(0)
48
- file.write(content)
49
- }
50
-
51
- $stderr.puts "Done!"
52
-
53
- end
data/yard.gemspec DELETED
@@ -1,25 +0,0 @@
1
- # frozen_string_literal: true
2
- require File.expand_path('../lib/yard/version', __FILE__)
3
-
4
- Gem::Specification.new do |s|
5
- s.name = "yard"
6
- s.summary = "Documentation tool for consistent and usable documentation in Ruby."
7
- s.description = <<-eof
8
- YARD is a documentation generation tool for the Ruby programming language.
9
- It enables the user to generate consistent, usable documentation that can be
10
- exported to a number of formats very easily, and also supports extending for
11
- custom Ruby constructs such as custom class level definitions.
12
- eof
13
- s.version = YARD::VERSION
14
- s.author = "Loren Segal"
15
- s.email = "lsegal@soen.ca"
16
- s.homepage = "http://yardoc.org"
17
- s.platform = Gem::Platform::RUBY
18
- s.files = `git ls-files`.strip.split(/\s+/).reject {|f| f.match(%r{^spec/}) }
19
- s.require_paths = ['lib']
20
- s.executables = ['yard', 'yardoc', 'yri']
21
- s.license = 'MIT' if s.respond_to?(:license=)
22
- s.metadata['yard.run'] = 'yri'
23
-
24
- s.add_runtime_dependency 'webrick', '~> 1.7.0'
25
- end