yard 0.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.
Potentially problematic release.
This version of yard might be problematic. Click here for more details.
- data/LICENSE.txt +22 -0
 - data/README.pdf +0 -0
 - data/bin/yardoc +73 -0
 - data/bin/yri +4 -0
 - data/lib/code_object.rb +340 -0
 - data/lib/formatter.rb +78 -0
 - data/lib/handlers/all_handlers.rb +2 -0
 - data/lib/handlers/attribute_handler.rb +46 -0
 - data/lib/handlers/class_handler.rb +29 -0
 - data/lib/handlers/class_variable_handler.rb +9 -0
 - data/lib/handlers/code_object_handler.rb +104 -0
 - data/lib/handlers/constant_handler.rb +11 -0
 - data/lib/handlers/exception_handler.rb +20 -0
 - data/lib/handlers/method_handler.rb +27 -0
 - data/lib/handlers/mixin_handler.rb +9 -0
 - data/lib/handlers/module_handler.rb +9 -0
 - data/lib/handlers/visibility_handler.rb +7 -0
 - data/lib/handlers/yield_handler.rb +31 -0
 - data/lib/namespace.rb +98 -0
 - data/lib/quick_doc.rb +104 -0
 - data/lib/ruby_lex.rb +1318 -0
 - data/lib/source_parser.rb +246 -0
 - data/lib/tag_library.rb +162 -0
 - data/lib/tag_type.rb +155 -0
 - data/lib/yard.rb +3 -0
 - data/templates/html_formatter.erb +455 -0
 - data/test/fixtures/docstring.txt +23 -0
 - data/test/fixtures/docstring2.txt +4 -0
 - data/test/test_code_object.rb +66 -0
 - data/test/test_namespace.rb +10 -0
 - metadata +78 -0
 
| 
         @@ -0,0 +1,23 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
             
     | 
| 
      
 2 
     | 
    
         
            +
             
     | 
| 
      
 3 
     | 
    
         
            +
            = Introduction 
         
     | 
| 
      
 4 
     | 
    
         
            +
             
     | 
| 
      
 5 
     | 
    
         
            +
            This is a sample docstring for testing purposes
         
     | 
| 
      
 6 
     | 
    
         
            +
             
     | 
| 
      
 7 
     | 
    
         
            +
              It includes most of the RDoc syntax, though
         
     | 
| 
      
 8 
     | 
    
         
            +
             
     | 
| 
      
 9 
     | 
    
         
            +
            @param normal a normal parameter with no type
         
     | 
| 
      
 10 
     | 
    
         
            +
              
         
     | 
| 
      
 11 
     | 
    
         
            +
              * It shouldn't matter
         
     | 
| 
      
 12 
     | 
    
         
            +
              * What the RDoc data is
         
     | 
| 
      
 13 
     | 
    
         
            +
              
         
     | 
| 
      
 14 
     | 
    
         
            +
            Finally:: It also contains meta data tags:
         
     | 
| 
      
 15 
     | 
    
         
            +
             
     | 
| 
      
 16 
     | 
    
         
            +
            @raise IOError an ioerror if things go wrong
         
     | 
| 
      
 17 
     | 
    
         
            +
            @author Loren Segal
         
     | 
| 
      
 18 
     | 
    
         
            +
            @deprecated
         
     | 
| 
      
 19 
     | 
    
         
            +
            @param [String] obj the first object in the list
         
     | 
| 
      
 20 
     | 
    
         
            +
            @param [String, Array<String>] obj2
         
     | 
| 
      
 21 
     | 
    
         
            +
            @return [Object] it really will
         
     | 
| 
      
 22 
     | 
    
         
            +
                             return anything 
         
     | 
| 
      
 23 
     | 
    
         
            +
                             it wants.
         
     | 
| 
         @@ -0,0 +1,66 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            require "test/unit"
         
     | 
| 
      
 2 
     | 
    
         
            +
            require File.dirname(__FILE__) + '/../lib/code_object'
         
     | 
| 
      
 3 
     | 
    
         
            +
             
     | 
| 
      
 4 
     | 
    
         
            +
            class TestCodeObject < Test::Unit::TestCase
         
     | 
| 
      
 5 
     | 
    
         
            +
              FIXTURES_PATH = File.dirname(__FILE__) + '/fixtures/'
         
     | 
| 
      
 6 
     | 
    
         
            +
              
         
     | 
| 
      
 7 
     | 
    
         
            +
              def setup
         
     | 
| 
      
 8 
     | 
    
         
            +
                @doc = YARD::CodeObject.new('node', 'module') do |obj|
         
     | 
| 
      
 9 
     | 
    
         
            +
                  obj.attach_docstring read_fixture('docstring.txt')
         
     | 
| 
      
 10 
     | 
    
         
            +
                end
         
     | 
| 
      
 11 
     | 
    
         
            +
              end
         
     | 
| 
      
 12 
     | 
    
         
            +
              
         
     | 
| 
      
 13 
     | 
    
         
            +
              def test_return
         
     | 
| 
      
 14 
     | 
    
         
            +
                @doc = YARD::CodeObject.new('node', 'method') do |obj|
         
     | 
| 
      
 15 
     | 
    
         
            +
                  obj.attach_docstring read_fixture('docstring2.txt')
         
     | 
| 
      
 16 
     | 
    
         
            +
                end
         
     | 
| 
      
 17 
     | 
    
         
            +
                assert @doc.has_tag?("return")
         
     | 
| 
      
 18 
     | 
    
         
            +
              end
         
     | 
| 
      
 19 
     | 
    
         
            +
              
         
     | 
| 
      
 20 
     | 
    
         
            +
              def test_source
         
     | 
| 
      
 21 
     | 
    
         
            +
                assert_equal 'node', @doc.name
         
     | 
| 
      
 22 
     | 
    
         
            +
                assert_equal '#node', @doc.path
         
     | 
| 
      
 23 
     | 
    
         
            +
              end
         
     | 
| 
      
 24 
     | 
    
         
            +
              
         
     | 
| 
      
 25 
     | 
    
         
            +
              def test_docstring
         
     | 
| 
      
 26 
     | 
    
         
            +
                assert_no_match /@param/, @doc.docstring
         
     | 
| 
      
 27 
     | 
    
         
            +
              end
         
     | 
| 
      
 28 
     | 
    
         
            +
              
         
     | 
| 
      
 29 
     | 
    
         
            +
              def test_tags
         
     | 
| 
      
 30 
     | 
    
         
            +
                assert_equal 3, @doc.tags("param").size
         
     | 
| 
      
 31 
     | 
    
         
            +
              end
         
     | 
| 
      
 32 
     | 
    
         
            +
              
         
     | 
| 
      
 33 
     | 
    
         
            +
              def test_has_tag
         
     | 
| 
      
 34 
     | 
    
         
            +
                assert @doc.has_tag?("deprecated")
         
     | 
| 
      
 35 
     | 
    
         
            +
                assert !@doc.has_tag?("notdefined")
         
     | 
| 
      
 36 
     | 
    
         
            +
              end
         
     | 
| 
      
 37 
     | 
    
         
            +
              
         
     | 
| 
      
 38 
     | 
    
         
            +
              def test_tag
         
     | 
| 
      
 39 
     | 
    
         
            +
                assert_equal "Loren Segal", @doc.tag("author").text
         
     | 
| 
      
 40 
     | 
    
         
            +
              end
         
     | 
| 
      
 41 
     | 
    
         
            +
              
         
     | 
| 
      
 42 
     | 
    
         
            +
              def test_tag_definition_on_multiple_lines
         
     | 
| 
      
 43 
     | 
    
         
            +
                assert_equal "it really will return anything it wants.", @doc.tag("return").text
         
     | 
| 
      
 44 
     | 
    
         
            +
              end
         
     | 
| 
      
 45 
     | 
    
         
            +
              
         
     | 
| 
      
 46 
     | 
    
         
            +
              def test_typed_tag
         
     | 
| 
      
 47 
     | 
    
         
            +
                assert 2, @doc.tags("param").last.types.size
         
     | 
| 
      
 48 
     | 
    
         
            +
                assert_equal ["String", "Array<String>"], @doc.tags("param").last.types
         
     | 
| 
      
 49 
     | 
    
         
            +
                assert_equal "String", @doc.tags("param")[1].type
         
     | 
| 
      
 50 
     | 
    
         
            +
                assert_equal [], @doc.tag("param").types
         
     | 
| 
      
 51 
     | 
    
         
            +
              end
         
     | 
| 
      
 52 
     | 
    
         
            +
              
         
     | 
| 
      
 53 
     | 
    
         
            +
              def test_named_tag
         
     | 
| 
      
 54 
     | 
    
         
            +
                assert_equal "normal", @doc.tags("param")[0].name
         
     | 
| 
      
 55 
     | 
    
         
            +
                assert_equal "obj", @doc.tags("param")[1].name
         
     | 
| 
      
 56 
     | 
    
         
            +
                assert_equal "obj2", @doc.tags("param")[2].name
         
     | 
| 
      
 57 
     | 
    
         
            +
                
         
     | 
| 
      
 58 
     | 
    
         
            +
                assert_equal "IOError", @doc.tag("raise").name
         
     | 
| 
      
 59 
     | 
    
         
            +
                assert_match "if things go wrong", @doc.tag("raise").text
         
     | 
| 
      
 60 
     | 
    
         
            +
              end
         
     | 
| 
      
 61 
     | 
    
         
            +
              
         
     | 
| 
      
 62 
     | 
    
         
            +
              protected
         
     | 
| 
      
 63 
     | 
    
         
            +
                def read_fixture(file)
         
     | 
| 
      
 64 
     | 
    
         
            +
                  IO.read(File.join(FIXTURES_PATH, file))
         
     | 
| 
      
 65 
     | 
    
         
            +
                end
         
     | 
| 
      
 66 
     | 
    
         
            +
            end
         
     | 
    
        metadata
    ADDED
    
    | 
         @@ -0,0 +1,78 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            --- !ruby/object:Gem::Specification 
         
     | 
| 
      
 2 
     | 
    
         
            +
            rubygems_version: 0.9.2
         
     | 
| 
      
 3 
     | 
    
         
            +
            specification_version: 1
         
     | 
| 
      
 4 
     | 
    
         
            +
            name: yard
         
     | 
| 
      
 5 
     | 
    
         
            +
            version: !ruby/object:Gem::Version 
         
     | 
| 
      
 6 
     | 
    
         
            +
              version: 0.2.0
         
     | 
| 
      
 7 
     | 
    
         
            +
            date: 2007-03-01 00:00:00 -05:00
         
     | 
| 
      
 8 
     | 
    
         
            +
            summary: A documentation tool for consistent and usable documentation in Ruby.
         
     | 
| 
      
 9 
     | 
    
         
            +
            require_paths: 
         
     | 
| 
      
 10 
     | 
    
         
            +
            - lib
         
     | 
| 
      
 11 
     | 
    
         
            +
            email: lsegal@soen.ca
         
     | 
| 
      
 12 
     | 
    
         
            +
            homepage: http://yard.soen.ca
         
     | 
| 
      
 13 
     | 
    
         
            +
            rubyforge_project: 
         
     | 
| 
      
 14 
     | 
    
         
            +
            description: 
         
     | 
| 
      
 15 
     | 
    
         
            +
            autorequire: 
         
     | 
| 
      
 16 
     | 
    
         
            +
            default_executable: 
         
     | 
| 
      
 17 
     | 
    
         
            +
            bindir: bin
         
     | 
| 
      
 18 
     | 
    
         
            +
            has_rdoc: false
         
     | 
| 
      
 19 
     | 
    
         
            +
            required_ruby_version: !ruby/object:Gem::Version::Requirement 
         
     | 
| 
      
 20 
     | 
    
         
            +
              requirements: 
         
     | 
| 
      
 21 
     | 
    
         
            +
              - - ">"
         
     | 
| 
      
 22 
     | 
    
         
            +
                - !ruby/object:Gem::Version 
         
     | 
| 
      
 23 
     | 
    
         
            +
                  version: 0.0.0
         
     | 
| 
      
 24 
     | 
    
         
            +
              version: 
         
     | 
| 
      
 25 
     | 
    
         
            +
            platform: ruby
         
     | 
| 
      
 26 
     | 
    
         
            +
            signing_key: 
         
     | 
| 
      
 27 
     | 
    
         
            +
            cert_chain: 
         
     | 
| 
      
 28 
     | 
    
         
            +
            post_install_message: 
         
     | 
| 
      
 29 
     | 
    
         
            +
            authors: 
         
     | 
| 
      
 30 
     | 
    
         
            +
            - Loren Segal
         
     | 
| 
      
 31 
     | 
    
         
            +
            files: 
         
     | 
| 
      
 32 
     | 
    
         
            +
            - bin/yardoc
         
     | 
| 
      
 33 
     | 
    
         
            +
            - bin/yri
         
     | 
| 
      
 34 
     | 
    
         
            +
            - lib/code_object.rb
         
     | 
| 
      
 35 
     | 
    
         
            +
            - lib/formatter.rb
         
     | 
| 
      
 36 
     | 
    
         
            +
            - lib/handlers
         
     | 
| 
      
 37 
     | 
    
         
            +
            - lib/namespace.rb
         
     | 
| 
      
 38 
     | 
    
         
            +
            - lib/quick_doc.rb
         
     | 
| 
      
 39 
     | 
    
         
            +
            - lib/ruby_lex.rb
         
     | 
| 
      
 40 
     | 
    
         
            +
            - lib/source_parser.rb
         
     | 
| 
      
 41 
     | 
    
         
            +
            - lib/tag_library.rb
         
     | 
| 
      
 42 
     | 
    
         
            +
            - lib/tag_type.rb
         
     | 
| 
      
 43 
     | 
    
         
            +
            - lib/yard.rb
         
     | 
| 
      
 44 
     | 
    
         
            +
            - lib/handlers/all_handlers.rb
         
     | 
| 
      
 45 
     | 
    
         
            +
            - lib/handlers/attribute_handler.rb
         
     | 
| 
      
 46 
     | 
    
         
            +
            - lib/handlers/class_handler.rb
         
     | 
| 
      
 47 
     | 
    
         
            +
            - lib/handlers/class_variable_handler.rb
         
     | 
| 
      
 48 
     | 
    
         
            +
            - lib/handlers/code_object_handler.rb
         
     | 
| 
      
 49 
     | 
    
         
            +
            - lib/handlers/constant_handler.rb
         
     | 
| 
      
 50 
     | 
    
         
            +
            - lib/handlers/exception_handler.rb
         
     | 
| 
      
 51 
     | 
    
         
            +
            - lib/handlers/method_handler.rb
         
     | 
| 
      
 52 
     | 
    
         
            +
            - lib/handlers/mixin_handler.rb
         
     | 
| 
      
 53 
     | 
    
         
            +
            - lib/handlers/module_handler.rb
         
     | 
| 
      
 54 
     | 
    
         
            +
            - lib/handlers/visibility_handler.rb
         
     | 
| 
      
 55 
     | 
    
         
            +
            - lib/handlers/yield_handler.rb
         
     | 
| 
      
 56 
     | 
    
         
            +
            - test/fixtures
         
     | 
| 
      
 57 
     | 
    
         
            +
            - test/test_code_object.rb
         
     | 
| 
      
 58 
     | 
    
         
            +
            - test/test_namespace.rb
         
     | 
| 
      
 59 
     | 
    
         
            +
            - test/fixtures/docstring.txt
         
     | 
| 
      
 60 
     | 
    
         
            +
            - test/fixtures/docstring2.txt
         
     | 
| 
      
 61 
     | 
    
         
            +
            - templates/html_formatter.erb
         
     | 
| 
      
 62 
     | 
    
         
            +
            - LICENSE.txt
         
     | 
| 
      
 63 
     | 
    
         
            +
            - README.pdf
         
     | 
| 
      
 64 
     | 
    
         
            +
            test_files: []
         
     | 
| 
      
 65 
     | 
    
         
            +
             
     | 
| 
      
 66 
     | 
    
         
            +
            rdoc_options: []
         
     | 
| 
      
 67 
     | 
    
         
            +
             
     | 
| 
      
 68 
     | 
    
         
            +
            extra_rdoc_files: []
         
     | 
| 
      
 69 
     | 
    
         
            +
             
     | 
| 
      
 70 
     | 
    
         
            +
            executables: 
         
     | 
| 
      
 71 
     | 
    
         
            +
            - yardoc
         
     | 
| 
      
 72 
     | 
    
         
            +
            - yri
         
     | 
| 
      
 73 
     | 
    
         
            +
            extensions: []
         
     | 
| 
      
 74 
     | 
    
         
            +
             
     | 
| 
      
 75 
     | 
    
         
            +
            requirements: []
         
     | 
| 
      
 76 
     | 
    
         
            +
             
     | 
| 
      
 77 
     | 
    
         
            +
            dependencies: []
         
     | 
| 
      
 78 
     | 
    
         
            +
             
     |