{"action":"created","issue":{"url":"https://api.github.com/repos/k-tsj/power_assert/issues/13","labels_url":"https://api.github.com/repos/k-tsj/power_assert/issues/13/labels{/name}","comments_url":"https://api.github.com/repos/k-tsj/power_assert/issues/13/comments","events_url":"https://api.github.com/repos/k-tsj/power_assert/issues/13/events","html_url":"https://github.com/k-tsj/power_assert/issues/13","id":115827643,"number":13,"title":"mattr_reader: protected method `[]' called for {}:Hash","user":{"login":"akicho8","id":808955,"avatar_url":"https://avatars.githubusercontent.com/u/808955?v=3","gravatar_id":"","url":"https://api.github.com/users/akicho8","html_url":"https://github.com/akicho8","followers_url":"https://api.github.com/users/akicho8/followers","following_url":"https://api.github.com/users/akicho8/following{/other_user}","gists_url":"https://api.github.com/users/akicho8/gists{/gist_id}","starred_url":"https://api.github.com/users/akicho8/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/akicho8/subscriptions","organizations_url":"https://api.github.com/users/akicho8/orgs","repos_url":"https://api.github.com/users/akicho8/repos","events_url":"https://api.github.com/users/akicho8/events{/privacy}","received_events_url":"https://api.github.com/users/akicho8/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-11-09T08:06:40Z","updated_at":"2015-11-09T15:18:12Z","closed_at":"2015-11-09T15:10:36Z","body":"activesupport を利用しているライブラリで rake test すると転けるようになってしまい、原因を追ったところ、次のコードで再現できるところまで絞れました。\r\n\r\n```ruby\r\ngem \"power_assert\", \"0.2.5\"\r\ngem \"activesupport\", \"4.2.4\"\r\n\r\nrequire \"power_assert\"\r\nrequire \"active_support/core_ext/module/attribute_accessors\"\r\nrequire \"active_support/configurable\"\r\n\r\nmodule M\r\n  mattr_reader :x\r\nend\r\n# ~> /usr/local/var/rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/activesupport-4.2.4/lib/active_support/core_ext/module/attribute_accessors.rb:65:in `block in mattr_reader': protected method `[]' called for {}:Hash (NoMethodError)\r\n# ~> \tfrom /usr/local/var/rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/activesupport-4.2.4/lib/active_support/core_ext/module/attribute_accessors.rb:55:in `each'\r\n# ~> \tfrom /usr/local/var/rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/activesupport-4.2.4/lib/active_support/core_ext/module/attribute_accessors.rb:55:in `mattr_reader'\r\n# ~> \tfrom -:9:in `<module:M>'\r\n# ~> \tfrom -:8:in `<main>'\r\n```\r\n\r\nわかっていること\r\n- 0.2.4 だと動く\r\n- require \"active_support/configurable\" を実行しないと動く\r\n- power_assert を active_support/configurable 後に require すると動く\r\n"},"comment":{"url":"https://api.github.com/repos/k-tsj/power_assert/issues/comments/155093110","html_url":"https://github.com/k-tsj/power_assert/issues/13#issuecomment-155093110","issue_url":"https://api.github.com/repos/k-tsj/power_assert/issues/13","id":155093110,"user":{"login":"k-tsj","id":32117,"avatar_url":"https://avatars.githubusercontent.com/u/32117?v=3","gravatar_id":"","url":"https://api.github.com/users/k-tsj","html_url":"https://github.com/k-tsj","followers_url":"https://api.github.com/users/k-tsj/followers","following_url":"https://api.github.com/users/k-tsj/following{/other_user}","gists_url":"https://api.github.com/users/k-tsj/gists{/gist_id}","starred_url":"https://api.github.com/users/k-tsj/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/k-tsj/subscriptions","organizations_url":"https://api.github.com/users/k-tsj/orgs","repos_url":"https://api.github.com/users/k-tsj/repos","events_url":"https://api.github.com/users/k-tsj/events{/privacy}","received_events_url":"https://api.github.com/users/k-tsj/received_events","type":"User","site_admin":false},"created_at":"2015-11-09T15:18:12Z","updated_at":"2015-11-09T15:18:12Z","body":"報告ありがとうございます。\r\n\r\nhttps://bugs.ruby-lang.org/issues/11182 に起因した問題でした。\r\npower_assert 0.2.6で対策をとってみたのでお試しください。\r\n\r\nコンパクトな再現コードを示していただいて助かりました。\r\n"}}