Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Update examples

  • Loading branch information...
commit face1dbe69e3d953c2c2f4c02f6ba0c66f3aa416 1 parent 1f884ad
@lsegal authored
Showing with 14 additions and 1 deletion.
  1. +13 −0 deprecated/example_code.rb
  2. +1 −1  doctest/doctest.rb
View
13 deprecated/example_code.rb
@@ -0,0 +1,13 @@
+class MyClass
+ def mymethod
+ end
+
+ # @deprecated Use {#mymethod} instead.
+ def my_old_method
+ end
+end
+
+if $0 == __FILE__
+ require 'yard'
+ YARD::CLI::Yardoc.run(File.basename(__FILE__))
+end
View
2  doctest/doctest.rb
@@ -10,7 +10,7 @@ def run_examples(object)
ex.gsub!('#=>', '=>')
hash = instance_eval("{ #{ex} }")
if hash.keys.first != hash.values.first
- puts "Incorrect @example in ('#{path}':#{object.line}):"
+ puts "Incorrect @example (##{exnum}) in ('#{path}':#{object.line}):"
puts "\tExpecting '#{hash.values[0]}', got '#{hash.keys[0]}'"
end
rescue => e
Please sign in to comment.
Something went wrong with that request. Please try again.