{"id":28640776,"url":"https://github.com/pd/yard_types","last_synced_at":"2025-06-12T20:08:23.464Z","repository":{"id":18626568,"uuid":"21832504","full_name":"pd/yard_types","owner":"pd","description":"Parse YARD type strings and type check objects against them","archived":false,"fork":false,"pushed_at":"2015-01-16T00:11:24.000Z","size":256,"stargazers_count":6,"open_issues_count":0,"forks_count":1,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-06-01T22:12:19.340Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pd.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-07-14T19:28:23.000Z","updated_at":"2019-05-06T20:17:59.000Z","dependencies_parsed_at":"2022-08-20T18:20:42.053Z","dependency_job_id":null,"html_url":"https://github.com/pd/yard_types","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/pd/yard_types","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pd%2Fyard_types","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pd%2Fyard_types/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pd%2Fyard_types/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pd%2Fyard_types/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pd","download_url":"https://codeload.github.com/pd/yard_types/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pd%2Fyard_types/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259522118,"owners_count":22870449,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-06-12T20:08:22.900Z","updated_at":"2025-06-12T20:08:23.454Z","avatar_url":"https://github.com/pd.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# yard_types\n\n[![Gem Version](https://badge.fury.io/rb/yard_types.svg)](http://badge.fury.io/rb/yard_types)\n[![Build Status](https://travis-ci.org/pd/yard_types.svg?branch=master)](https://travis-ci.org/pd/yard_types)\n[![Dependency Status](https://gemnasium.com/pd/yard_types.svg)](https://gemnasium.com/pd/yard_types)\n[![Code Climate](https://codeclimate.com/github/pd/yard_types.png)](https://codeclimate.com/github/pd/yard_types)\n[![Coverage Status](https://coveralls.io/repos/pd/yard_types/badge.svg?branch=master)](https://coveralls.io/r/pd/yard_types?branch=master)\n[![Inline docs](http://inch-ci.org/github/pd/yard_types.svg?branch=master)](http://inch-ci.org/github/pd/yard_types)\n\nParse YARD type description strings -- eg `Array\u003c#to_sym\u003e` -- and use the\nresulting types to check type correctness of objects at runtime.\n\n## Installation\nLike everything else these days:\n\n~~~ruby\ngem 'yard_types'\n~~~\n\nNote that the `yard` gem may automatically require anything named `yard_*` or\n`yard-*` on your load path, and attempt to use it as a plugin. You could see\nerrors along the lines of `failed to load plugin yard_types`; this is harmless,\nas best I can tell.\n\n## Usage\nParse a type description string, and test an object against it:\n\n~~~ruby\ntype = YardTypes.parse('#quack') #=\u003e #\u003cYardTypes::TypeConstraint ...\u003e\n\ntype.check(Object.new)\n#=\u003e false\n\nobj = Object.new\ndef obj.quack; 'quack!'; end\ntype.check(obj)\n#=\u003e true\n~~~\n\n## Caveats\nYARD does not officially specify a syntax for its type descriptions; the syntax\nused by its own documentation varies between files. The syntax supported in\nthis gem aims to follow the rules given by the [YARD Type Parser][type-parser].\n\nIn the wild, people seem to use a wide variety of different syntaxes, many of\nwhich are unlikely to be supported right now. If you find any such examples,\nfeel free to file an issue -- or better yet, write a test, implement the feature,\nand send me a pull request.\n\n## Tests\nPretty standard. Just run `rake` or `rspec`.\n\n## Contributing\n\n1. Fork it ( http://github.com/pd/yard_types/fork )\n2. Create your feature branch (`git checkout -b my-new-feature`)\n3. Commit your changes (`git commit -am 'Add some feature'`)\n4. Push to the branch (`git push origin my-new-feature`)\n5. Create new Pull Request\n\n## Credits\nThe bulk of the parser was [written by lsegal](lsegal-parser); unfortunately, it\nwas never released as a gem, and has sat untouched for 5 years. I've only modified\nthe parser to better support `Hash\u003cA, B\u003e` syntax and to use more consistent\nnaming patterns.\n\n[type-parser]: http://yardoc.org/types\n[lsegel-parser]: https://github.com/lsegal/yard-types-parser\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpd%2Fyard_types","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpd%2Fyard_types","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpd%2Fyard_types/lists"}