{"action":"created","issue":{"url":"https://api.github.com/repos/egonSchiele/contracts.ruby/issues/77","labels_url":"https://api.github.com/repos/egonSchiele/contracts.ruby/issues/77/labels{/name}","comments_url":"https://api.github.com/repos/egonSchiele/contracts.ruby/issues/77/comments","events_url":"https://api.github.com/repos/egonSchiele/contracts.ruby/issues/77/events","html_url":"https://github.com/egonSchiele/contracts.ruby/issues/77","id":56581833,"number":77,"title":"Constant scoping issues","user":{"login":"kliuless","id":307761,"avatar_url":"https://avatars.githubusercontent.com/u/307761?v=3","gravatar_id":"","url":"https://api.github.com/users/kliuless","html_url":"https://github.com/kliuless","followers_url":"https://api.github.com/users/kliuless/followers","following_url":"https://api.github.com/users/kliuless/following{/other_user}","gists_url":"https://api.github.com/users/kliuless/gists{/gist_id}","starred_url":"https://api.github.com/users/kliuless/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kliuless/subscriptions","organizations_url":"https://api.github.com/users/kliuless/orgs","repos_url":"https://api.github.com/users/kliuless/repos","events_url":"https://api.github.com/users/kliuless/events{/privacy}","received_events_url":"https://api.github.com/users/kliuless/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-02-04T20:21:13Z","updated_at":"2015-02-04T20:32:14Z","closed_at":null,"body":"This looks like a very promising lib, but I get `NameError`'s when a contract is violated.\r\nI'm on ruby 2.1.2.\r\n\r\nUsing the version from rubygems.org (0.5), I get this error:\r\n\r\n    contracts-0.5/lib/contracts.rb:134:in `failure_msg': uninitialized constant Contract::Support (NameError)\r\n\r\nUsing master (26de665a), I get this error:\r\n\r\n    lib/contracts.rb:247:in `call_with': uninitialized constant Contract::Func (NameError)\r\n\r\nIt looks like the `Contract` class is trying to access constants inside `Contracts` (plural) without specifying the scope via `::`. Is there a stable version I can use?\r\n\r\nAlso, I think it would be helpful to have tags & branches for each release so it's easier to view changes between releases."},"comment":{"url":"https://api.github.com/repos/egonSchiele/contracts.ruby/issues/comments/72932955","html_url":"https://github.com/egonSchiele/contracts.ruby/issues/77#issuecomment-72932955","issue_url":"https://api.github.com/repos/egonSchiele/contracts.ruby/issues/77","id":72932955,"user":{"login":"waterlink","id":609046,"avatar_url":"https://avatars.githubusercontent.com/u/609046?v=3","gravatar_id":"","url":"https://api.github.com/users/waterlink","html_url":"https://github.com/waterlink","followers_url":"https://api.github.com/users/waterlink/followers","following_url":"https://api.github.com/users/waterlink/following{/other_user}","gists_url":"https://api.github.com/users/waterlink/gists{/gist_id}","starred_url":"https://api.github.com/users/waterlink/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/waterlink/subscriptions","organizations_url":"https://api.github.com/users/waterlink/orgs","repos_url":"https://api.github.com/users/waterlink/repos","events_url":"https://api.github.com/users/waterlink/events{/privacy}","received_events_url":"https://api.github.com/users/waterlink/received_events","type":"User","site_admin":false},"created_at":"2015-02-04T20:32:14Z","updated_at":"2015-02-04T20:32:14Z","body":"You can try `0.4`. Should work, because `Contract::Support` was introduced after it. You are right about tags though.\r\n\r\nAre you using any heavy framework, like `Rails` or something similar?\r\n\r\nCan you provide a failing example, along these lines, it will be very helpful:\r\n\r\n```ruby\r\nrequire \"contracts\"\r\n\r\nclass MyExample\r\n  # .. do definitions with contracts ..\r\nend\r\n\r\n# .. misuse MyExample, so that it fails to make a contract violation\r\n```\r\n\r\nIf it is not failing in such a simple setup, then I will probably need some more info on your setup."}}