{"id":17256980,"url":"https://github.com/waterlink/contracts-non_intrusive","last_synced_at":"2025-10-16T07:04:52.017Z","repository":{"id":56843821,"uuid":"42002799","full_name":"waterlink/contracts-non_intrusive","owner":"waterlink","description":"Less intrusive version of Contracts DSL. Allows to use static/dynamic code analysis tools.","archived":false,"fork":false,"pushed_at":"2015-09-06T13:08:48.000Z","size":144,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-01T10:46:55.477Z","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/waterlink.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-09-06T13:03:26.000Z","updated_at":"2015-09-06T13:04:14.000Z","dependencies_parsed_at":"2022-09-05T14:50:58.091Z","dependency_job_id":null,"html_url":"https://github.com/waterlink/contracts-non_intrusive","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/waterlink%2Fcontracts-non_intrusive","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/waterlink%2Fcontracts-non_intrusive/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/waterlink%2Fcontracts-non_intrusive/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/waterlink%2Fcontracts-non_intrusive/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/waterlink","download_url":"https://codeload.github.com/waterlink/contracts-non_intrusive/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245617507,"owners_count":20644830,"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":"2024-10-15T07:16:01.326Z","updated_at":"2025-10-16T07:04:46.976Z","avatar_url":"https://github.com/waterlink.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Contracts::NonIntrusive\n\nLess intrusive version of Contracts DSL. Allows to use static/dynamic code\nanalysis tools.\n\n*NOTE: This is in a proof-of-concept state and doesn't have tests (read:\nquick hack to see if it is possible at all)*\n\n## Installation\n\nAdd this line to your application's Gemfile:\n\n```ruby\ngem 'contracts-non_intrusive'\n```\n\nAnd then execute:\n\n    $ bundle\n\nOr install it yourself as:\n\n    $ gem install contracts-non_intrusive\n\n## Usage\n\nFirst, you should have some version of `contracts.ruby` installed.\n\n```ruby\nrequire \"contracts/non_intrusive\"\nC = Contracts\n\nclass Example\n  include Contracts::NonIntrusive\n\n  Contract(C::Num, C::Num =\u003e C::Num)[:add =\u003e :add__raw]\n  def add__raw(a, b)\n    a + b\n  end\nend\n```\n\n### Singleton methods\n\nThis gem does not support (Yet?) singleton methods, workaround is to use\nsingleton class:\n\n```ruby\nclass Example\n  class \u003c\u003c self\n    include Contracts::NonIntrusive\n\n    Contract(C::Num, C::Num =\u003e C::Num)[:add =\u003e :add__raw]\n    def add__raw(a, b)\n      a + b\n    end\n  end\nend\n```\n\n## Development\n\nAfter checking out the repo, run `bin/setup` to install dependencies. Then, run `bin/console` for an interactive prompt that will allow you to experiment.\n\nTo 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` to create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).\n\n## Contributing\n\n1. Fork it ( https://github.com/waterlink/contracts-non_intrusive/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 a new Pull Request\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwaterlink%2Fcontracts-non_intrusive","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwaterlink%2Fcontracts-non_intrusive","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwaterlink%2Fcontracts-non_intrusive/lists"}