{"action":"created","comment":{"url":"https://api.github.com/repos/thoughtbot/climate_control/pulls/comments/38217551","id":38217551,"diff_hunk":"@@ -33,10 +33,24 @@ def run_block\n       @block.call\n     end\n \n+    def stringify_boolean(value)\n+      return value.to_s if [true, false].include?(value)\n+      value\n+    end\n+\n+    def stringify_number(value)\n+      return value.to_s if value.is_a?(Numeric)\n+      value\n+    end\n+\n+    def stringify_value(value)\n+      stringify_number(stringify_boolean(value))\n+    end\n+\n     def copy_overrides_to_environment\n       @environment_overrides.each do |key, value|\n         begin\n-          @env[key] = value\n+          @env[key] = stringify_value(value)","path":"lib/climate_control/modifier.rb","position":22,"original_position":22,"commit_id":"620a2b10b0a1ea5597fff7758e71fa8c7ea8b5ac","original_commit_id":"620a2b10b0a1ea5597fff7758e71fa8c7ea8b5ac","user":{"login":"jakecraige","id":3799709,"avatar_url":"https://avatars.githubusercontent.com/u/3799709?v=3","gravatar_id":"","url":"https://api.github.com/users/jakecraige","html_url":"https://github.com/jakecraige","followers_url":"https://api.github.com/users/jakecraige/followers","following_url":"https://api.github.com/users/jakecraige/following{/other_user}","gists_url":"https://api.github.com/users/jakecraige/gists{/gist_id}","starred_url":"https://api.github.com/users/jakecraige/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jakecraige/subscriptions","organizations_url":"https://api.github.com/users/jakecraige/orgs","repos_url":"https://api.github.com/users/jakecraige/repos","events_url":"https://api.github.com/users/jakecraige/events{/privacy}","received_events_url":"https://api.github.com/users/jakecraige/received_events","type":"User","site_admin":false},"body":"Thoughts on doing `value.to_s` here? This should accomplish the same thing without any of the `stringify_` methods you defined. It also allows you to pass in whatever you want as long as you define a `to_s` method.","created_at":"2015-08-28T16:27:07Z","updated_at":"2015-08-28T16:27:07Z","html_url":"https://github.com/thoughtbot/climate_control/pull/16#discussion_r38217551","pull_request_url":"https://api.github.com/repos/thoughtbot/climate_control/pulls/16","_links":{"self":{"href":"https://api.github.com/repos/thoughtbot/climate_control/pulls/comments/38217551"},"html":{"href":"https://github.com/thoughtbot/climate_control/pull/16#discussion_r38217551"},"pull_request":{"href":"https://api.github.com/repos/thoughtbot/climate_control/pulls/16"}}},"pull_request":{"url":"https://api.github.com/repos/thoughtbot/climate_control/pulls/16","id":41084655,"html_url":"https://github.com/thoughtbot/climate_control/pull/16","diff_url":"https://github.com/thoughtbot/climate_control/pull/16.diff","patch_url":"https://github.com/thoughtbot/climate_control/pull/16.patch","issue_url":"https://api.github.com/repos/thoughtbot/climate_control/issues/16","number":16,"state":"open","locked":false,"title":"Added support for auto-converting booleans and numbers as strings.","user":{"login":"bkuhlmann","id":50245,"avatar_url":"https://avatars.githubusercontent.com/u/50245?v=3","gravatar_id":"","url":"https://api.github.com/users/bkuhlmann","html_url":"https://github.com/bkuhlmann","followers_url":"https://api.github.com/users/bkuhlmann/followers","following_url":"https://api.github.com/users/bkuhlmann/following{/other_user}","gists_url":"https://api.github.com/users/bkuhlmann/gists{/gist_id}","starred_url":"https://api.github.com/users/bkuhlmann/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bkuhlmann/subscriptions","organizations_url":"https://api.github.com/users/bkuhlmann/orgs","repos_url":"https://api.github.com/users/bkuhlmann/repos","events_url":"https://api.github.com/users/bkuhlmann/events{/privacy}","received_events_url":"https://api.github.com/users/bkuhlmann/received_events","type":"User","site_admin":false},"body":"- Aids the development process by accepting and converting boolean\r\n  and/or numeric values as strings for safe storage within the ENV.\r\n- Without this conversion support, the following exception is thrown:\r\n  \"NoMethodError: undefined method `keys' for nil:NilClass\". This\r\n  makes for a confusing debugging process as it is not intuitive\r\n  that the error stems from the Climate Control gem.\r\n- Alternative solutions for consideration:\r\n    - Convert ALL values to strings (i.e. String(value)). This\r\n      would mean the \"raises when the value cannot be assigned properly\"\r\n      spec might not be necessary.\r\n    - Don't do any conversion and raise exceptions instead.\r\n    - Allow for conversion but print warnings that code should be\r\n      cleaned up to not use booleans or numerics.","created_at":"2015-07-29T03:44:26Z","updated_at":"2015-08-28T16:27:07Z","closed_at":null,"merged_at":null,"merge_commit_sha":"0445f100e5aa6811791e587ac5bdcf3520534e84","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/thoughtbot/climate_control/pulls/16/commits","review_comments_url":"https://api.github.com/repos/thoughtbot/climate_control/pulls/16/comments","review_comment_url":"https://api.github.com/repos/thoughtbot/climate_control/pulls/comments{/number}","comments_url":"https://api.github.com/repos/thoughtbot/climate_control/issues/16/comments","statuses_url":"https://api.github.com/repos/thoughtbot/climate_control/statuses/620a2b10b0a1ea5597fff7758e71fa8c7ea8b5ac","head":{"label":"bkuhlmann:boolean_and_numeric_conversion","ref":"boolean_and_numeric_conversion","sha":"620a2b10b0a1ea5597fff7758e71fa8c7ea8b5ac","user":{"login":"bkuhlmann","id":50245,"avatar_url":"https://avatars.githubusercontent.com/u/50245?v=3","gravatar_id":"","url":"https://api.github.com/users/bkuhlmann","html_url":"https://github.com/bkuhlmann","followers_url":"https://api.github.com/users/bkuhlmann/followers","following_url":"https://api.github.com/users/bkuhlmann/following{/other_user}","gists_url":"https://api.github.com/users/bkuhlmann/gists{/gist_id}","starred_url":"https://api.github.com/users/bkuhlmann/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bkuhlmann/subscriptions","organizations_url":"https://api.github.com/users/bkuhlmann/orgs","repos_url":"https://api.github.com/users/bkuhlmann/repos","events_url":"https://api.github.com/users/bkuhlmann/events{/privacy}","received_events_url":"https://api.github.com/users/bkuhlmann/received_events","type":"User","site_admin":false},"repo":{"id":39869231,"name":"climate_control","full_name":"bkuhlmann/climate_control","owner":{"login":"bkuhlmann","id":50245,"avatar_url":"https://avatars.githubusercontent.com/u/50245?v=3","gravatar_id":"","url":"https://api.github.com/users/bkuhlmann","html_url":"https://github.com/bkuhlmann","followers_url":"https://api.github.com/users/bkuhlmann/followers","following_url":"https://api.github.com/users/bkuhlmann/following{/other_user}","gists_url":"https://api.github.com/users/bkuhlmann/gists{/gist_id}","starred_url":"https://api.github.com/users/bkuhlmann/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bkuhlmann/subscriptions","organizations_url":"https://api.github.com/users/bkuhlmann/orgs","repos_url":"https://api.github.com/users/bkuhlmann/repos","events_url":"https://api.github.com/users/bkuhlmann/events{/privacy}","received_events_url":"https://api.github.com/users/bkuhlmann/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/bkuhlmann/climate_control","description":"Modify your ENV","fork":true,"url":"https://api.github.com/repos/bkuhlmann/climate_control","forks_url":"https://api.github.com/repos/bkuhlmann/climate_control/forks","keys_url":"https://api.github.com/repos/bkuhlmann/climate_control/keys{/key_id}","collaborators_url":"https://api.github.com/repos/bkuhlmann/climate_control/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/bkuhlmann/climate_control/teams","hooks_url":"https://api.github.com/repos/bkuhlmann/climate_control/hooks","issue_events_url":"https://api.github.com/repos/bkuhlmann/climate_control/issues/events{/number}","events_url":"https://api.github.com/repos/bkuhlmann/climate_control/events","assignees_url":"https://api.github.com/repos/bkuhlmann/climate_control/assignees{/user}","branches_url":"https://api.github.com/repos/bkuhlmann/climate_control/branches{/branch}","tags_url":"https://api.github.com/repos/bkuhlmann/climate_control/tags","blobs_url":"https://api.github.com/repos/bkuhlmann/climate_control/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/bkuhlmann/climate_control/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/bkuhlmann/climate_control/git/refs{/sha}","trees_url":"https://api.github.com/repos/bkuhlmann/climate_control/git/trees{/sha}","statuses_url":"https://api.github.com/repos/bkuhlmann/climate_control/statuses/{sha}","languages_url":"https://api.github.com/repos/bkuhlmann/climate_control/languages","stargazers_url":"https://api.github.com/repos/bkuhlmann/climate_control/stargazers","contributors_url":"https://api.github.com/repos/bkuhlmann/climate_control/contributors","subscribers_url":"https://api.github.com/repos/bkuhlmann/climate_control/subscribers","subscription_url":"https://api.github.com/repos/bkuhlmann/climate_control/subscription","commits_url":"https://api.github.com/repos/bkuhlmann/climate_control/commits{/sha}","git_commits_url":"https://api.github.com/repos/bkuhlmann/climate_control/git/commits{/sha}","comments_url":"https://api.github.com/repos/bkuhlmann/climate_control/comments{/number}","issue_comment_url":"https://api.github.com/repos/bkuhlmann/climate_control/issues/comments{/number}","contents_url":"https://api.github.com/repos/bkuhlmann/climate_control/contents/{+path}","compare_url":"https://api.github.com/repos/bkuhlmann/climate_control/compare/{base}...{head}","merges_url":"https://api.github.com/repos/bkuhlmann/climate_control/merges","archive_url":"https://api.github.com/repos/bkuhlmann/climate_control/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/bkuhlmann/climate_control/downloads","issues_url":"https://api.github.com/repos/bkuhlmann/climate_control/issues{/number}","pulls_url":"https://api.github.com/repos/bkuhlmann/climate_control/pulls{/number}","milestones_url":"https://api.github.com/repos/bkuhlmann/climate_control/milestones{/number}","notifications_url":"https://api.github.com/repos/bkuhlmann/climate_control/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/bkuhlmann/climate_control/labels{/name}","releases_url":"https://api.github.com/repos/bkuhlmann/climate_control/releases{/id}","created_at":"2015-07-29T02:39:44Z","updated_at":"2015-07-29T02:39:44Z","pushed_at":"2015-07-29T03:43:24Z","git_url":"git://github.com/bkuhlmann/climate_control.git","ssh_url":"git@github.com:bkuhlmann/climate_control.git","clone_url":"https://github.com/bkuhlmann/climate_control.git","svn_url":"https://github.com/bkuhlmann/climate_control","homepage":"https://robots.thoughtbot.com","size":102,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"thoughtbot:master","ref":"master","sha":"1dfb22331d3d07e1f4c753afc8960f21e28ecbe6","user":{"login":"thoughtbot","id":6183,"avatar_url":"https://avatars.githubusercontent.com/u/6183?v=3","gravatar_id":"","url":"https://api.github.com/users/thoughtbot","html_url":"https://github.com/thoughtbot","followers_url":"https://api.github.com/users/thoughtbot/followers","following_url":"https://api.github.com/users/thoughtbot/following{/other_user}","gists_url":"https://api.github.com/users/thoughtbot/gists{/gist_id}","starred_url":"https://api.github.com/users/thoughtbot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thoughtbot/subscriptions","organizations_url":"https://api.github.com/users/thoughtbot/orgs","repos_url":"https://api.github.com/users/thoughtbot/repos","events_url":"https://api.github.com/users/thoughtbot/events{/privacy}","received_events_url":"https://api.github.com/users/thoughtbot/received_events","type":"Organization","site_admin":false},"repo":{"id":6905846,"name":"climate_control","full_name":"thoughtbot/climate_control","owner":{"login":"thoughtbot","id":6183,"avatar_url":"https://avatars.githubusercontent.com/u/6183?v=3","gravatar_id":"","url":"https://api.github.com/users/thoughtbot","html_url":"https://github.com/thoughtbot","followers_url":"https://api.github.com/users/thoughtbot/followers","following_url":"https://api.github.com/users/thoughtbot/following{/other_user}","gists_url":"https://api.github.com/users/thoughtbot/gists{/gist_id}","starred_url":"https://api.github.com/users/thoughtbot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thoughtbot/subscriptions","organizations_url":"https://api.github.com/users/thoughtbot/orgs","repos_url":"https://api.github.com/users/thoughtbot/repos","events_url":"https://api.github.com/users/thoughtbot/events{/privacy}","received_events_url":"https://api.github.com/users/thoughtbot/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/thoughtbot/climate_control","description":"Modify your ENV","fork":false,"url":"https://api.github.com/repos/thoughtbot/climate_control","forks_url":"https://api.github.com/repos/thoughtbot/climate_control/forks","keys_url":"https://api.github.com/repos/thoughtbot/climate_control/keys{/key_id}","collaborators_url":"https://api.github.com/repos/thoughtbot/climate_control/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/thoughtbot/climate_control/teams","hooks_url":"https://api.github.com/repos/thoughtbot/climate_control/hooks","issue_events_url":"https://api.github.com/repos/thoughtbot/climate_control/issues/events{/number}","events_url":"https://api.github.com/repos/thoughtbot/climate_control/events","assignees_url":"https://api.github.com/repos/thoughtbot/climate_control/assignees{/user}","branches_url":"https://api.github.com/repos/thoughtbot/climate_control/branches{/branch}","tags_url":"https://api.github.com/repos/thoughtbot/climate_control/tags","blobs_url":"https://api.github.com/repos/thoughtbot/climate_control/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/thoughtbot/climate_control/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/thoughtbot/climate_control/git/refs{/sha}","trees_url":"https://api.github.com/repos/thoughtbot/climate_control/git/trees{/sha}","statuses_url":"https://api.github.com/repos/thoughtbot/climate_control/statuses/{sha}","languages_url":"https://api.github.com/repos/thoughtbot/climate_control/languages","stargazers_url":"https://api.github.com/repos/thoughtbot/climate_control/stargazers","contributors_url":"https://api.github.com/repos/thoughtbot/climate_control/contributors","subscribers_url":"https://api.github.com/repos/thoughtbot/climate_control/subscribers","subscription_url":"https://api.github.com/repos/thoughtbot/climate_control/subscription","commits_url":"https://api.github.com/repos/thoughtbot/climate_control/commits{/sha}","git_commits_url":"https://api.github.com/repos/thoughtbot/climate_control/git/commits{/sha}","comments_url":"https://api.github.com/repos/thoughtbot/climate_control/comments{/number}","issue_comment_url":"https://api.github.com/repos/thoughtbot/climate_control/issues/comments{/number}","contents_url":"https://api.github.com/repos/thoughtbot/climate_control/contents/{+path}","compare_url":"https://api.github.com/repos/thoughtbot/climate_control/compare/{base}...{head}","merges_url":"https://api.github.com/repos/thoughtbot/climate_control/merges","archive_url":"https://api.github.com/repos/thoughtbot/climate_control/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/thoughtbot/climate_control/downloads","issues_url":"https://api.github.com/repos/thoughtbot/climate_control/issues{/number}","pulls_url":"https://api.github.com/repos/thoughtbot/climate_control/pulls{/number}","milestones_url":"https://api.github.com/repos/thoughtbot/climate_control/milestones{/number}","notifications_url":"https://api.github.com/repos/thoughtbot/climate_control/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/thoughtbot/climate_control/labels{/name}","releases_url":"https://api.github.com/repos/thoughtbot/climate_control/releases{/id}","created_at":"2012-11-28T16:56:21Z","updated_at":"2015-08-24T08:31:44Z","pushed_at":"2015-07-29T03:44:27Z","git_url":"git://github.com/thoughtbot/climate_control.git","ssh_url":"git@github.com:thoughtbot/climate_control.git","clone_url":"https://github.com/thoughtbot/climate_control.git","svn_url":"https://github.com/thoughtbot/climate_control","homepage":"https://robots.thoughtbot.com","size":280,"stargazers_count":94,"watchers_count":94,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":5,"mirror_url":null,"open_issues_count":3,"forks":5,"open_issues":3,"watchers":94,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/thoughtbot/climate_control/pulls/16"},"html":{"href":"https://github.com/thoughtbot/climate_control/pull/16"},"issue":{"href":"https://api.github.com/repos/thoughtbot/climate_control/issues/16"},"comments":{"href":"https://api.github.com/repos/thoughtbot/climate_control/issues/16/comments"},"review_comments":{"href":"https://api.github.com/repos/thoughtbot/climate_control/pulls/16/comments"},"review_comment":{"href":"https://api.github.com/repos/thoughtbot/climate_control/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/thoughtbot/climate_control/pulls/16/commits"},"statuses":{"href":"https://api.github.com/repos/thoughtbot/climate_control/statuses/620a2b10b0a1ea5597fff7758e71fa8c7ea8b5ac"}}}}