{"action":"created","comment":{"url":"https://api.github.com/repos/sinatra/sinatra/pulls/comments/26786140","id":26786140,"diff_hunk":"@@ -1834,7 +1834,7 @@ def self.force_encoding(data, *) data end\n \n     reset!\n \n-    set :environment, (ENV['RACK_ENV'] || :development).to_sym\n+    set :environment, (ENV['SINATRA_ENV'] || :development).to_sym","path":"lib/sinatra/base.rb","position":5,"original_position":5,"commit_id":"07cd7b1e79f0a95e19260c2475eb129cb83e9d01","original_commit_id":"07cd7b1e79f0a95e19260c2475eb129cb83e9d01","user":{"login":"gshutler","id":81344,"avatar_url":"https://avatars.githubusercontent.com/u/81344?v=3","gravatar_id":"","url":"https://api.github.com/users/gshutler","html_url":"https://github.com/gshutler","followers_url":"https://api.github.com/users/gshutler/followers","following_url":"https://api.github.com/users/gshutler/following{/other_user}","gists_url":"https://api.github.com/users/gshutler/gists{/gist_id}","starred_url":"https://api.github.com/users/gshutler/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gshutler/subscriptions","organizations_url":"https://api.github.com/users/gshutler/orgs","repos_url":"https://api.github.com/users/gshutler/repos","events_url":"https://api.github.com/users/gshutler/events{/privacy}","received_events_url":"https://api.github.com/users/gshutler/received_events","type":"User","site_admin":false},"body":"I agree with the idea of this change but perhaps there's a middle ground as this would currently be a significant breaking change as it stands:\r\n\r\n```ruby\r\nset :environment, (ENV['SINATRA_ENV'] || ENV['RACK_ENV'] || :development).to_sym\r\n```\r\n\r\nThen the use of `RACK_ENV` could be deprecated and checking it removed in the next major version.","created_at":"2015-03-19T18:53:39Z","updated_at":"2015-03-19T18:53:39Z","html_url":"https://github.com/sinatra/sinatra/pull/984#discussion_r26786140","pull_request_url":"https://api.github.com/repos/sinatra/sinatra/pulls/984","_links":{"self":{"href":"https://api.github.com/repos/sinatra/sinatra/pulls/comments/26786140"},"html":{"href":"https://github.com/sinatra/sinatra/pull/984#discussion_r26786140"},"pull_request":{"href":"https://api.github.com/repos/sinatra/sinatra/pulls/984"}}},"pull_request":{"url":"https://api.github.com/repos/sinatra/sinatra/pulls/984","id":31552861,"html_url":"https://github.com/sinatra/sinatra/pull/984","diff_url":"https://github.com/sinatra/sinatra/pull/984.diff","patch_url":"https://github.com/sinatra/sinatra/pull/984.patch","issue_url":"https://api.github.com/repos/sinatra/sinatra/issues/984","number":984,"state":"open","locked":false,"title":"Introduce SINATRA_ENV and remove RACK_ENV","user":{"login":"dmathieu","id":9347,"avatar_url":"https://avatars.githubusercontent.com/u/9347?v=3","gravatar_id":"","url":"https://api.github.com/users/dmathieu","html_url":"https://github.com/dmathieu","followers_url":"https://api.github.com/users/dmathieu/followers","following_url":"https://api.github.com/users/dmathieu/following{/other_user}","gists_url":"https://api.github.com/users/dmathieu/gists{/gist_id}","starred_url":"https://api.github.com/users/dmathieu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dmathieu/subscriptions","organizations_url":"https://api.github.com/users/dmathieu/orgs","repos_url":"https://api.github.com/users/dmathieu/repos","events_url":"https://api.github.com/users/dmathieu/events{/privacy}","received_events_url":"https://api.github.com/users/dmathieu/received_events","type":"User","site_admin":false},"body":"`RACK_ENV` should not be used with values other than `deveploment` and `deployment`. Therefore, it can't be used to check for `production environment.\r\n\r\nSee http://www.hezmatt.org/~mpalmer/blog/2013/10/13/rack_env-its-not-for-you.html\r\n\r\nIn fact, it can even cause some issues if your app is using unicorn, as they're including internal rack middlewares relying on `RACK_ENV` to have the `deployment` value.\r\nSee https://github.com/defunkt/unicorn/blob/master/lib/unicorn.rb#L56-L79\r\n\r\nRack itself does that too.\r\nhttps://github.com/rack/rack/blob/4e4ab39b0508aa3e59f5d7e53696ef6ae7c220ed/lib/rack/server.rb#L228\r\n\r\nThis removes using `RACK_ENV`, and replaces it with `SINATRA_ENV`.\r\nSince it's a major changes, it should be merged in the Sinatra 2.0 branch. I'm not seeing anything of the kind, so feel free to stall this until there's discussion about it.","created_at":"2015-03-19T18:38:37Z","updated_at":"2015-03-19T18:53:39Z","closed_at":null,"merged_at":null,"merge_commit_sha":"ee3bc92f5bcc421ee608d1716d3d6f931d0d1496","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/sinatra/sinatra/pulls/984/commits","review_comments_url":"https://api.github.com/repos/sinatra/sinatra/pulls/984/comments","review_comment_url":"https://api.github.com/repos/sinatra/sinatra/pulls/comments{/number}","comments_url":"https://api.github.com/repos/sinatra/sinatra/issues/984/comments","statuses_url":"https://api.github.com/repos/sinatra/sinatra/statuses/07cd7b1e79f0a95e19260c2475eb129cb83e9d01","head":{"label":"dmathieu:sinatra_env","ref":"sinatra_env","sha":"07cd7b1e79f0a95e19260c2475eb129cb83e9d01","user":{"login":"dmathieu","id":9347,"avatar_url":"https://avatars.githubusercontent.com/u/9347?v=3","gravatar_id":"","url":"https://api.github.com/users/dmathieu","html_url":"https://github.com/dmathieu","followers_url":"https://api.github.com/users/dmathieu/followers","following_url":"https://api.github.com/users/dmathieu/following{/other_user}","gists_url":"https://api.github.com/users/dmathieu/gists{/gist_id}","starred_url":"https://api.github.com/users/dmathieu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dmathieu/subscriptions","organizations_url":"https://api.github.com/users/dmathieu/orgs","repos_url":"https://api.github.com/users/dmathieu/repos","events_url":"https://api.github.com/users/dmathieu/events{/privacy}","received_events_url":"https://api.github.com/users/dmathieu/received_events","type":"User","site_admin":false},"repo":{"id":32539458,"name":"sinatra","full_name":"dmathieu/sinatra","owner":{"login":"dmathieu","id":9347,"avatar_url":"https://avatars.githubusercontent.com/u/9347?v=3","gravatar_id":"","url":"https://api.github.com/users/dmathieu","html_url":"https://github.com/dmathieu","followers_url":"https://api.github.com/users/dmathieu/followers","following_url":"https://api.github.com/users/dmathieu/following{/other_user}","gists_url":"https://api.github.com/users/dmathieu/gists{/gist_id}","starred_url":"https://api.github.com/users/dmathieu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dmathieu/subscriptions","organizations_url":"https://api.github.com/users/dmathieu/orgs","repos_url":"https://api.github.com/users/dmathieu/repos","events_url":"https://api.github.com/users/dmathieu/events{/privacy}","received_events_url":"https://api.github.com/users/dmathieu/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/dmathieu/sinatra","description":"Classy web-development dressed in a DSL (official / canonical repo)","fork":true,"url":"https://api.github.com/repos/dmathieu/sinatra","forks_url":"https://api.github.com/repos/dmathieu/sinatra/forks","keys_url":"https://api.github.com/repos/dmathieu/sinatra/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dmathieu/sinatra/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dmathieu/sinatra/teams","hooks_url":"https://api.github.com/repos/dmathieu/sinatra/hooks","issue_events_url":"https://api.github.com/repos/dmathieu/sinatra/issues/events{/number}","events_url":"https://api.github.com/repos/dmathieu/sinatra/events","assignees_url":"https://api.github.com/repos/dmathieu/sinatra/assignees{/user}","branches_url":"https://api.github.com/repos/dmathieu/sinatra/branches{/branch}","tags_url":"https://api.github.com/repos/dmathieu/sinatra/tags","blobs_url":"https://api.github.com/repos/dmathieu/sinatra/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dmathieu/sinatra/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dmathieu/sinatra/git/refs{/sha}","trees_url":"https://api.github.com/repos/dmathieu/sinatra/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dmathieu/sinatra/statuses/{sha}","languages_url":"https://api.github.com/repos/dmathieu/sinatra/languages","stargazers_url":"https://api.github.com/repos/dmathieu/sinatra/stargazers","contributors_url":"https://api.github.com/repos/dmathieu/sinatra/contributors","subscribers_url":"https://api.github.com/repos/dmathieu/sinatra/subscribers","subscription_url":"https://api.github.com/repos/dmathieu/sinatra/subscription","commits_url":"https://api.github.com/repos/dmathieu/sinatra/commits{/sha}","git_commits_url":"https://api.github.com/repos/dmathieu/sinatra/git/commits{/sha}","comments_url":"https://api.github.com/repos/dmathieu/sinatra/comments{/number}","issue_comment_url":"https://api.github.com/repos/dmathieu/sinatra/issues/comments{/number}","contents_url":"https://api.github.com/repos/dmathieu/sinatra/contents/{+path}","compare_url":"https://api.github.com/repos/dmathieu/sinatra/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dmathieu/sinatra/merges","archive_url":"https://api.github.com/repos/dmathieu/sinatra/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dmathieu/sinatra/downloads","issues_url":"https://api.github.com/repos/dmathieu/sinatra/issues{/number}","pulls_url":"https://api.github.com/repos/dmathieu/sinatra/pulls{/number}","milestones_url":"https://api.github.com/repos/dmathieu/sinatra/milestones{/number}","notifications_url":"https://api.github.com/repos/dmathieu/sinatra/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dmathieu/sinatra/labels{/name}","releases_url":"https://api.github.com/repos/dmathieu/sinatra/releases{/id}","created_at":"2015-03-19T18:34:26Z","updated_at":"2015-03-19T18:34:28Z","pushed_at":"2015-03-19T18:36:41Z","git_url":"git://github.com/dmathieu/sinatra.git","ssh_url":"git@github.com:dmathieu/sinatra.git","clone_url":"https://github.com/dmathieu/sinatra.git","svn_url":"https://github.com/dmathieu/sinatra","homepage":"http://www.sinatrarb.com/","size":12615,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":false,"has_downloads":true,"has_wiki":false,"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":"sinatra:master","ref":"master","sha":"911d95a6b0e4671c7ecc4d1cbdb4eba65a178bfe","user":{"login":"sinatra","id":8312,"avatar_url":"https://avatars.githubusercontent.com/u/8312?v=3","gravatar_id":"","url":"https://api.github.com/users/sinatra","html_url":"https://github.com/sinatra","followers_url":"https://api.github.com/users/sinatra/followers","following_url":"https://api.github.com/users/sinatra/following{/other_user}","gists_url":"https://api.github.com/users/sinatra/gists{/gist_id}","starred_url":"https://api.github.com/users/sinatra/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sinatra/subscriptions","organizations_url":"https://api.github.com/users/sinatra/orgs","repos_url":"https://api.github.com/users/sinatra/repos","events_url":"https://api.github.com/users/sinatra/events{/privacy}","received_events_url":"https://api.github.com/users/sinatra/received_events","type":"Organization","site_admin":false},"repo":{"id":106995,"name":"sinatra","full_name":"sinatra/sinatra","owner":{"login":"sinatra","id":8312,"avatar_url":"https://avatars.githubusercontent.com/u/8312?v=3","gravatar_id":"","url":"https://api.github.com/users/sinatra","html_url":"https://github.com/sinatra","followers_url":"https://api.github.com/users/sinatra/followers","following_url":"https://api.github.com/users/sinatra/following{/other_user}","gists_url":"https://api.github.com/users/sinatra/gists{/gist_id}","starred_url":"https://api.github.com/users/sinatra/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sinatra/subscriptions","organizations_url":"https://api.github.com/users/sinatra/orgs","repos_url":"https://api.github.com/users/sinatra/repos","events_url":"https://api.github.com/users/sinatra/events{/privacy}","received_events_url":"https://api.github.com/users/sinatra/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/sinatra/sinatra","description":"Classy web-development dressed in a DSL (official / canonical repo)","fork":true,"url":"https://api.github.com/repos/sinatra/sinatra","forks_url":"https://api.github.com/repos/sinatra/sinatra/forks","keys_url":"https://api.github.com/repos/sinatra/sinatra/keys{/key_id}","collaborators_url":"https://api.github.com/repos/sinatra/sinatra/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/sinatra/sinatra/teams","hooks_url":"https://api.github.com/repos/sinatra/sinatra/hooks","issue_events_url":"https://api.github.com/repos/sinatra/sinatra/issues/events{/number}","events_url":"https://api.github.com/repos/sinatra/sinatra/events","assignees_url":"https://api.github.com/repos/sinatra/sinatra/assignees{/user}","branches_url":"https://api.github.com/repos/sinatra/sinatra/branches{/branch}","tags_url":"https://api.github.com/repos/sinatra/sinatra/tags","blobs_url":"https://api.github.com/repos/sinatra/sinatra/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/sinatra/sinatra/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/sinatra/sinatra/git/refs{/sha}","trees_url":"https://api.github.com/repos/sinatra/sinatra/git/trees{/sha}","statuses_url":"https://api.github.com/repos/sinatra/sinatra/statuses/{sha}","languages_url":"https://api.github.com/repos/sinatra/sinatra/languages","stargazers_url":"https://api.github.com/repos/sinatra/sinatra/stargazers","contributors_url":"https://api.github.com/repos/sinatra/sinatra/contributors","subscribers_url":"https://api.github.com/repos/sinatra/sinatra/subscribers","subscription_url":"https://api.github.com/repos/sinatra/sinatra/subscription","commits_url":"https://api.github.com/repos/sinatra/sinatra/commits{/sha}","git_commits_url":"https://api.github.com/repos/sinatra/sinatra/git/commits{/sha}","comments_url":"https://api.github.com/repos/sinatra/sinatra/comments{/number}","issue_comment_url":"https://api.github.com/repos/sinatra/sinatra/issues/comments{/number}","contents_url":"https://api.github.com/repos/sinatra/sinatra/contents/{+path}","compare_url":"https://api.github.com/repos/sinatra/sinatra/compare/{base}...{head}","merges_url":"https://api.github.com/repos/sinatra/sinatra/merges","archive_url":"https://api.github.com/repos/sinatra/sinatra/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/sinatra/sinatra/downloads","issues_url":"https://api.github.com/repos/sinatra/sinatra/issues{/number}","pulls_url":"https://api.github.com/repos/sinatra/sinatra/pulls{/number}","milestones_url":"https://api.github.com/repos/sinatra/sinatra/milestones{/number}","notifications_url":"https://api.github.com/repos/sinatra/sinatra/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/sinatra/sinatra/labels{/name}","releases_url":"https://api.github.com/repos/sinatra/sinatra/releases{/id}","created_at":"2009-01-14T01:27:30Z","updated_at":"2015-03-19T17:01:40Z","pushed_at":"2015-03-18T02:17:50Z","git_url":"git://github.com/sinatra/sinatra.git","ssh_url":"git@github.com:sinatra/sinatra.git","clone_url":"https://github.com/sinatra/sinatra.git","svn_url":"https://github.com/sinatra/sinatra","homepage":"http://www.sinatrarb.com/","size":12615,"stargazers_count":6778,"watchers_count":6778,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":1067,"mirror_url":null,"open_issues_count":30,"forks":1067,"open_issues":30,"watchers":6778,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/sinatra/sinatra/pulls/984"},"html":{"href":"https://github.com/sinatra/sinatra/pull/984"},"issue":{"href":"https://api.github.com/repos/sinatra/sinatra/issues/984"},"comments":{"href":"https://api.github.com/repos/sinatra/sinatra/issues/984/comments"},"review_comments":{"href":"https://api.github.com/repos/sinatra/sinatra/pulls/984/comments"},"review_comment":{"href":"https://api.github.com/repos/sinatra/sinatra/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/sinatra/sinatra/pulls/984/commits"},"statuses":{"href":"https://api.github.com/repos/sinatra/sinatra/statuses/07cd7b1e79f0a95e19260c2475eb129cb83e9d01"}}}}