{"action":"created","issue":{"url":"https://api.github.com/repos/jackc/surus/issues/20","labels_url":"https://api.github.com/repos/jackc/surus/issues/20/labels{/name}","comments_url":"https://api.github.com/repos/jackc/surus/issues/20/comments","events_url":"https://api.github.com/repos/jackc/surus/issues/20/events","html_url":"https://github.com/jackc/surus/pull/20","id":116974433,"number":20,"title":"Code styling cleanup + Refactor Serializer","user":{"login":"ddrmanxbxfr","id":445401,"avatar_url":"https://avatars.githubusercontent.com/u/445401?v=3","gravatar_id":"","url":"https://api.github.com/users/ddrmanxbxfr","html_url":"https://github.com/ddrmanxbxfr","followers_url":"https://api.github.com/users/ddrmanxbxfr/followers","following_url":"https://api.github.com/users/ddrmanxbxfr/following{/other_user}","gists_url":"https://api.github.com/users/ddrmanxbxfr/gists{/gist_id}","starred_url":"https://api.github.com/users/ddrmanxbxfr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ddrmanxbxfr/subscriptions","organizations_url":"https://api.github.com/users/ddrmanxbxfr/orgs","repos_url":"https://api.github.com/users/ddrmanxbxfr/repos","events_url":"https://api.github.com/users/ddrmanxbxfr/events{/privacy}","received_events_url":"https://api.github.com/users/ddrmanxbxfr/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2015-11-15T05:31:52Z","updated_at":"2015-11-18T02:51:42Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/jackc/surus/pulls/20","html_url":"https://github.com/jackc/surus/pull/20","diff_url":"https://github.com/jackc/surus/pull/20.diff","patch_url":"https://github.com/jackc/surus/pull/20.patch"},"body":"Hi JackC,\r\n\r\nIn this PR i've made the following improvements :\r\n  1. Add Rubocop to the project and make it 100% fully compliant to the ruby style guide.\r\n  2. Refactor a few methods in lib/surus/hstore/serializer.rb to make it easier to read.\r\n  3. All the string usage only that doesn't involve interpolation are now ' instead of \".\r\n\r\nTests should now be running on both jruby main versions + rubocop run.\r\n\r\nThanks for looking into it!\n\n<!-- Reviewable:start -->\n[<img src=\"https://reviewable.io/review_button.png\" height=40 alt=\"Review on Reviewable\"/>](https://reviewable.io/reviews/jackc/surus/20)\n<!-- Reviewable:end -->\n"},"comment":{"url":"https://api.github.com/repos/jackc/surus/issues/comments/157584116","html_url":"https://github.com/jackc/surus/pull/20#issuecomment-157584116","issue_url":"https://api.github.com/repos/jackc/surus/issues/20","id":157584116,"user":{"login":"ddrmanxbxfr","id":445401,"avatar_url":"https://avatars.githubusercontent.com/u/445401?v=3","gravatar_id":"","url":"https://api.github.com/users/ddrmanxbxfr","html_url":"https://github.com/ddrmanxbxfr","followers_url":"https://api.github.com/users/ddrmanxbxfr/followers","following_url":"https://api.github.com/users/ddrmanxbxfr/following{/other_user}","gists_url":"https://api.github.com/users/ddrmanxbxfr/gists{/gist_id}","starred_url":"https://api.github.com/users/ddrmanxbxfr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ddrmanxbxfr/subscriptions","organizations_url":"https://api.github.com/users/ddrmanxbxfr/orgs","repos_url":"https://api.github.com/users/ddrmanxbxfr/repos","events_url":"https://api.github.com/users/ddrmanxbxfr/events{/privacy}","received_events_url":"https://api.github.com/users/ddrmanxbxfr/received_events","type":"User","site_admin":false},"created_at":"2015-11-18T02:51:42Z","updated_at":"2015-11-18T02:51:42Z","body":"Hi JackC,\r\n\r\nThanks for passing by, Let's go point by point so we can get this through and make some improvements.\r\n\r\n1. This is indeed a nit ! I'm removing it !\r\n2. Yes by default of the ruby style guide, unused variables should be prefixed with something. I didn't mean to trim them on the go as I wasn't sure if it was left for re-enabling the feature later on.  (https://github.com/bbatsov/ruby-style-guide#underscore-unused-vars)\r\n\r\nIf we want to allow the unused variables without triggering warning, we could disable this check in the rubocop.yml and restore the non prefixed variables.\r\n3. No when you use a  kind_of? and .is_a? are synonyms.\r\n\r\nIf you declare a FixNum and compare it with Integer. Both will repond true. See\r\n```\r\n2.2.2 :003 > qq = -12345\r\n => -12345\r\n2.2.2 :004 > qq.is_a? Fixnum\r\n => true\r\n2.2.2 :005 > qq.is_a? Integer\r\n => true\r\n```\r\n\r\nWhat we want to do here is have a strict type check and else use YAML to serialize it.\r\n4. Rubocop pretty much only lints the code. It doesn't reformat it. I'm not aware that a popular tool that uses the ruby style guide for auto formatting exists yet. It would be a really cool project though!\r\nLet's go through it slowly and could use a tool like reviewable to review the code easily.\r\n5. It is some preparation for JRuby compat. Do you want me to revert this change so we only keep the code styling and the small refactors I made in there ?\r\n6. Indeed a nit ! I'm removing it !\r\n\r\n"}}