@@ -4240,6 +4240,9 @@ class Namespace::Foo
42404240 # Method bar
42414241 #
42424242 # This method does something really important
4243+ #
4244+ # @param a [String]
4245+ # @return [void]
42434246 sig { params(a: ::String).void }
42444247 def bar(a); end
42454248
@@ -4256,30 +4259,33 @@ def no_yard_docs_but_sig; end
42564259
42574260 def no_yard_docs_nor_sig; end
42584261
4262+ # @deprecated Do not use me!
42594263 # Method only_docs
42604264 #
42614265 # This method only has documentation
4262- #
4263- # @deprecated Do not use me!
42644266 def only_docs(a); end
42654267
42664268 class << self
42674269 # Method baz
42684270 #
42694271 # This is a singleton method
42704272 #
4271- # @deprecated Use something else instead of this method because
4272- # it uses a library that is no longer supported in Ruby 1.9.
4273- # The new method accepts the same parameters.
4273+ # @param t [Integer, String]
4274+ # @return [void]
42744275 # @example My example
42754276 # a = "hello world"
42764277 # a.reverse
4278+ # @deprecated Use something else instead of this method because
4279+ # it uses a library that is no longer supported in Ruby 1.9.
4280+ # The new method accepts the same parameters.
42774281 sig { params(t: ::Integer).void }
42784282 def baz(t); end
42794283
42804284 # Method something
42814285 #
42824286 # This is another singleton method
4287+ #
4288+ # @return [void]
42834289 sig { void }
42844290 def something; end
42854291 end
@@ -4578,8 +4584,6 @@ class BasicFoo < ::BasicObject
45784584 def foo; end
45794585 end
45804586
4581- # @abstract It cannot be directly instantiated. Subclasses must implement the `abstract` methods below.
4582- #
45834587 # pkg:gem/#{ DEFAULT_GEM_NAME } #lib/foo.rb:11
45844588 class Baz
45854589 abstract!
@@ -4803,7 +4807,7 @@ def qux; end
48034807 assert_equal ( output , compile )
48044808 end
48054809
4806- it "sorts YARD tags stably by tag_name and name " do
4810+ it "keeps YARD tags in the original order " do
48074811 add_ruby_file ( "foo.rb" , <<~RUBY )
48084812 class Foo
48094813 # Method with multiple parameters
@@ -4819,12 +4823,11 @@ def multi_param_method(zebra, alpha, beta); end
48194823 output = template ( <<~RBI )
48204824 class Foo
48214825 # Method with multiple parameters
4822- #
4823- # @param alpha [Integer] first parameter alphabetically
4824- # @param beta [Boolean] middle parameter alphabetically
4826+ # @return [String] the result
48254827 # @param zebra [String] last parameter alphabetically
48264828 # @raise [ArgumentError] when params are invalid
4827- # @return [String] the result
4829+ # @param alpha [Integer] first parameter alphabetically
4830+ # @param beta [Boolean] middle parameter alphabetically
48284831 def multi_param_method(zebra, alpha, beta); end
48294832 end
48304833 RBI
0 commit comments