yard-solargraph 0.1.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 ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: a9d1e63061dcae191ddffb63bc9cd123b8e09942de0148e20f07a7b8b9d3182a
4
+ data.tar.gz: dae371b094921e14a8c1a0f2cf4d213130308af4dc750bbe510e79f28da1d87f
5
+ SHA512:
6
+ metadata.gz: 0f276a1be7a2cb0aac13c590d5cbfc5dd763c7cbd3e67ba0ef4d38ee5f78c051d8db5f88add9a10c5f70ed13974aee6672357c042c2d6d7c4778bd22f01066c9
7
+ data.tar.gz: 4d813c22ce648e82869eb32715487b8fed9a1d099eca81aab3a19762b0675558f5e6d581c192136a2863d780d40529b883db05de9e4dda2aae6579f7e7ea7a5c
data/.rspec ADDED
@@ -0,0 +1,3 @@
1
+ --format documentation
2
+ --color
3
+ --require spec_helper
data/CHANGELOG.md ADDED
@@ -0,0 +1,2 @@
1
+ # 0.1.0 - February 26, 2025
2
+ - First release
data/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2017-2023 by Fred Snyder for Castwide Technologies
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,84 @@
1
+ # yard-solargraph
2
+
3
+ A YARD extension for documenting Solargraph tags.
4
+
5
+ ## Installation
6
+
7
+ Install the gem and add to the application's Gemfile by executing:
8
+
9
+ ```bash
10
+ bundle add yard-solargraph
11
+ ```
12
+
13
+ If bundler is not being used to manage dependencies, install the gem by executing:
14
+
15
+ ```bash
16
+ gem install yard-solargraph
17
+ ```
18
+
19
+ ## Usage
20
+
21
+ To include the plugin when you generate yardocs from the command line:
22
+
23
+ yardoc --plugin yard-solargraph
24
+
25
+ To ensure that the plugin gets included when generating yardocs for gems:
26
+
27
+ 1. Add yard-solargraph to your gemspec
28
+ 2. Create a `.yardopts` file in your gem's root directory with the `plugin` option:
29
+ ```
30
+ --plugin yard-solargraph
31
+ ```
32
+
33
+ ## Additional Tags
34
+
35
+ The plugin adds two tags to your YARD documentation: `@generic` and `@yieldreceiver`.
36
+
37
+ ### @generic
38
+
39
+ Use the `@generic` tag to reference parametrized types.
40
+
41
+ ```ruby
42
+ # @generic T
43
+ class Example
44
+ # @param [generic<T>]
45
+ def initialize value
46
+ @value = value
47
+ end
48
+
49
+ # @return [generic<T>]
50
+ attr_reader :value
51
+ end
52
+
53
+ # @return [Example<String>]
54
+ def string_example
55
+ Example.new('test')
56
+ end
57
+
58
+ string_example.value # => Solargraph will infer that #value returns a String
59
+ ```
60
+
61
+ ### @yieldreceiver
62
+
63
+ Use the `@yieldreceiver` tag to document the type of receiver that a method will use to evaluate a block.
64
+
65
+ ```ruby
66
+ # @yieldreceiver [Array]
67
+ def eval_in_array &block
68
+ [].instance_eval &block
69
+ end
70
+
71
+ eval_in_array do
72
+ length # => Solargraph will infer that this is an Array#length call
73
+ end
74
+ ```
75
+
76
+ ## Development
77
+
78
+ After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
79
+
80
+ To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and the created tag, and push the `.gem` file to [rubygems.org](https://rubygems.org).
81
+
82
+ ## Contributing
83
+
84
+ Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/yard-solargraph.
data/Rakefile ADDED
@@ -0,0 +1,8 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "bundler/gem_tasks"
4
+ require "rspec/core/rake_task"
5
+
6
+ RSpec::Core::RakeTask.new(:spec)
7
+
8
+ task default: :spec
@@ -0,0 +1,7 @@
1
+ # frozen_string_literal: true
2
+
3
+ module YARD
4
+ module Solargraph
5
+ VERSION = "0.1.0"
6
+ end
7
+ end
@@ -0,0 +1,34 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'yard'
4
+ require_relative "solargraph/version"
5
+
6
+ module YARD
7
+ module Solargraph
8
+ # Define a @yieldreceiver tag for documenting the receiver of a block
9
+ #
10
+ # @example
11
+ # # @yieldreceiver [Array] An array will evaluate the block
12
+ # def add5_block(&block) [].instance_eval(&block) end
13
+ #
14
+ YARD::Tags::Library.define_tag('Yield Receiver', :yieldreceiver, :with_types)
15
+
16
+ # Define a @generic tag for documenting generic classes
17
+ #
18
+ # @example
19
+ # # @generic T
20
+ # class Example
21
+ # # @return [generic<T>]
22
+ # attr_reader :value
23
+ # end
24
+ #
25
+ # # @return [Example<String>]
26
+ # def string_example; end
27
+ #
28
+ # string_example.value # => String
29
+ #
30
+ YARD::Tags::Library.define_tag('Generics', :generic, :with_types_and_name)
31
+
32
+ YARD::Tags::Library.visible_tags.push :yieldreceiver, :generic
33
+ end
34
+ end
@@ -0,0 +1,3 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'yard/solargraph'
metadata ADDED
@@ -0,0 +1,108 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: yard-solargraph
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - Fred Snyder
8
+ autorequire:
9
+ bindir: exe
10
+ cert_chain: []
11
+ date: 2025-02-26 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: yard
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '0.9'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '0.9'
27
+ - !ruby/object:Gem::Dependency
28
+ name: rake
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '13.2'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '13.2'
41
+ - !ruby/object:Gem::Dependency
42
+ name: rspec
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: '3.5'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: '3.5'
55
+ - !ruby/object:Gem::Dependency
56
+ name: simplecov
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - "~>"
60
+ - !ruby/object:Gem::Version
61
+ version: '0.14'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - "~>"
67
+ - !ruby/object:Gem::Version
68
+ version: '0.14'
69
+ description:
70
+ email:
71
+ - fsnyder@castwide.com
72
+ executables: []
73
+ extensions: []
74
+ extra_rdoc_files: []
75
+ files:
76
+ - ".rspec"
77
+ - CHANGELOG.md
78
+ - LICENSE
79
+ - README.md
80
+ - Rakefile
81
+ - lib/yard-solargraph.rb
82
+ - lib/yard/solargraph.rb
83
+ - lib/yard/solargraph/version.rb
84
+ homepage: https://solargraph.org
85
+ licenses: []
86
+ metadata:
87
+ homepage_uri: https://solargraph.org
88
+ source_code_uri: https://github.com/castwide/yard-solargraph
89
+ post_install_message:
90
+ rdoc_options: []
91
+ require_paths:
92
+ - lib
93
+ required_ruby_version: !ruby/object:Gem::Requirement
94
+ requirements:
95
+ - - ">="
96
+ - !ruby/object:Gem::Version
97
+ version: '2.6'
98
+ required_rubygems_version: !ruby/object:Gem::Requirement
99
+ requirements:
100
+ - - ">="
101
+ - !ruby/object:Gem::Version
102
+ version: '0'
103
+ requirements: []
104
+ rubygems_version: 3.3.7
105
+ signing_key:
106
+ specification_version: 4
107
+ summary: A YARD extension for documenting Solargraph tags.
108
+ test_files: []