{"action":"created","comment":{"url":"https://api.github.com/repos/simplybusiness/packer/pulls/comments/189946829","pull_request_review_id":122225006,"id":189946829,"diff_hunk":"@@ -15,12 +15,20 @@ def instance\n     @instance ||= Packer::Instance.new\n   end\n \n+  def rails?\n+    defined? Rails\n+  end\n+\n+  def sinatra?\n+    defined? Sinatra\n+  end\n+\n   delegate :logger, :logger=, :env, to: :instance\n   delegate :compile, :compiler, :manifest, :commands, :config, :dev_server, to: :instance\n   delegate :bootstrap, :clobber, :compile, to: :commands\n end\n \n-require 'packer/version'","path":"lib/packer.rb","position":17,"original_position":17,"commit_id":"bb9180a77d78835ea6550425bf4270c2c05024ae","original_commit_id":"bb9180a77d78835ea6550425bf4270c2c05024ae","user":{"login":"DXTimer","id":17004703,"avatar_url":"https://avatars0.githubusercontent.com/u/17004703?v=4","gravatar_id":"","url":"https://api.github.com/users/DXTimer","html_url":"https://github.com/DXTimer","followers_url":"https://api.github.com/users/DXTimer/followers","following_url":"https://api.github.com/users/DXTimer/following{/other_user}","gists_url":"https://api.github.com/users/DXTimer/gists{/gist_id}","starred_url":"https://api.github.com/users/DXTimer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DXTimer/subscriptions","organizations_url":"https://api.github.com/users/DXTimer/orgs","repos_url":"https://api.github.com/users/DXTimer/repos","events_url":"https://api.github.com/users/DXTimer/events{/privacy}","received_events_url":"https://api.github.com/users/DXTimer/received_events","type":"User","site_admin":false},"body":"Because it is already required in `packer.gemspec` line 6.","created_at":"2018-05-22T15:28:38Z","updated_at":"2018-05-22T15:28:38Z","html_url":"https://github.com/simplybusiness/packer/pull/1#discussion_r189946829","pull_request_url":"https://api.github.com/repos/simplybusiness/packer/pulls/1","author_association":"NONE","_links":{"self":{"href":"https://api.github.com/repos/simplybusiness/packer/pulls/comments/189946829"},"html":{"href":"https://github.com/simplybusiness/packer/pull/1#discussion_r189946829"},"pull_request":{"href":"https://api.github.com/repos/simplybusiness/packer/pulls/1"}},"in_reply_to_id":189944257},"pull_request":{"url":"https://api.github.com/repos/simplybusiness/packer/pulls/1","id":189692316,"html_url":"https://github.com/simplybusiness/packer/pull/1","diff_url":"https://github.com/simplybusiness/packer/pull/1.diff","patch_url":"https://github.com/simplybusiness/packer/pull/1.patch","issue_url":"https://api.github.com/repos/simplybusiness/packer/issues/1","number":1,"state":"open","locked":false,"title":"Use application context for ENV","user":{"login":"DXTimer","id":17004703,"avatar_url":"https://avatars0.githubusercontent.com/u/17004703?v=4","gravatar_id":"","url":"https://api.github.com/users/DXTimer","html_url":"https://github.com/DXTimer","followers_url":"https://api.github.com/users/DXTimer/followers","following_url":"https://api.github.com/users/DXTimer/following{/other_user}","gists_url":"https://api.github.com/users/DXTimer/gists{/gist_id}","starred_url":"https://api.github.com/users/DXTimer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DXTimer/subscriptions","organizations_url":"https://api.github.com/users/DXTimer/orgs","repos_url":"https://api.github.com/users/DXTimer/repos","events_url":"https://api.github.com/users/DXTimer/events{/privacy}","received_events_url":"https://api.github.com/users/DXTimer/received_events","type":"User","site_admin":false},"body":"@lesleh @doryphores \r\n\r\n## What?\r\nSet-up environment based on the application that is currently running. Only application supported are Rails and Sinatra.\r\n\r\n## Why?\r\nSo we do not need to depend on environment variables being set.\r\n\r\n## Implementation\r\n* Provide methods to check in what context the application is running in, this is done by calling `defined? Rails | Sinatra`\r\n* If we are running in Rails we fetch the working directory path through `Rails.root` else if we are in `Sinatra::Base.settings.root || Pathname.new('.')`. __(Would prefer throw an error if `root` hasn't been set for Sinatra)__","created_at":"2018-05-22T14:55:30Z","updated_at":"2018-05-22T15:28:38Z","closed_at":null,"merged_at":null,"merge_commit_sha":"a95a8a85f35168fe3e29f1ef7771f8cccc5fbbf6","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/simplybusiness/packer/pulls/1/commits","review_comments_url":"https://api.github.com/repos/simplybusiness/packer/pulls/1/comments","review_comment_url":"https://api.github.com/repos/simplybusiness/packer/pulls/comments{/number}","comments_url":"https://api.github.com/repos/simplybusiness/packer/issues/1/comments","statuses_url":"https://api.github.com/repos/simplybusiness/packer/statuses/bb9180a77d78835ea6550425bf4270c2c05024ae","head":{"label":"simplybusiness:env_handler","ref":"env_handler","sha":"bb9180a77d78835ea6550425bf4270c2c05024ae","user":{"login":"simplybusiness","id":465825,"avatar_url":"https://avatars3.githubusercontent.com/u/465825?v=4","gravatar_id":"","url":"https://api.github.com/users/simplybusiness","html_url":"https://github.com/simplybusiness","followers_url":"https://api.github.com/users/simplybusiness/followers","following_url":"https://api.github.com/users/simplybusiness/following{/other_user}","gists_url":"https://api.github.com/users/simplybusiness/gists{/gist_id}","starred_url":"https://api.github.com/users/simplybusiness/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/simplybusiness/subscriptions","organizations_url":"https://api.github.com/users/simplybusiness/orgs","repos_url":"https://api.github.com/users/simplybusiness/repos","events_url":"https://api.github.com/users/simplybusiness/events{/privacy}","received_events_url":"https://api.github.com/users/simplybusiness/received_events","type":"Organization","site_admin":false},"repo":{"id":127276642,"name":"packer","full_name":"simplybusiness/packer","owner":{"login":"simplybusiness","id":465825,"avatar_url":"https://avatars3.githubusercontent.com/u/465825?v=4","gravatar_id":"","url":"https://api.github.com/users/simplybusiness","html_url":"https://github.com/simplybusiness","followers_url":"https://api.github.com/users/simplybusiness/followers","following_url":"https://api.github.com/users/simplybusiness/following{/other_user}","gists_url":"https://api.github.com/users/simplybusiness/gists{/gist_id}","starred_url":"https://api.github.com/users/simplybusiness/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/simplybusiness/subscriptions","organizations_url":"https://api.github.com/users/simplybusiness/orgs","repos_url":"https://api.github.com/users/simplybusiness/repos","events_url":"https://api.github.com/users/simplybusiness/events{/privacy}","received_events_url":"https://api.github.com/users/simplybusiness/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/simplybusiness/packer","description":"Library for integrating Webpack into any Rack compliant app","fork":false,"url":"https://api.github.com/repos/simplybusiness/packer","forks_url":"https://api.github.com/repos/simplybusiness/packer/forks","keys_url":"https://api.github.com/repos/simplybusiness/packer/keys{/key_id}","collaborators_url":"https://api.github.com/repos/simplybusiness/packer/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/simplybusiness/packer/teams","hooks_url":"https://api.github.com/repos/simplybusiness/packer/hooks","issue_events_url":"https://api.github.com/repos/simplybusiness/packer/issues/events{/number}","events_url":"https://api.github.com/repos/simplybusiness/packer/events","assignees_url":"https://api.github.com/repos/simplybusiness/packer/assignees{/user}","branches_url":"https://api.github.com/repos/simplybusiness/packer/branches{/branch}","tags_url":"https://api.github.com/repos/simplybusiness/packer/tags","blobs_url":"https://api.github.com/repos/simplybusiness/packer/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/simplybusiness/packer/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/simplybusiness/packer/git/refs{/sha}","trees_url":"https://api.github.com/repos/simplybusiness/packer/git/trees{/sha}","statuses_url":"https://api.github.com/repos/simplybusiness/packer/statuses/{sha}","languages_url":"https://api.github.com/repos/simplybusiness/packer/languages","stargazers_url":"https://api.github.com/repos/simplybusiness/packer/stargazers","contributors_url":"https://api.github.com/repos/simplybusiness/packer/contributors","subscribers_url":"https://api.github.com/repos/simplybusiness/packer/subscribers","subscription_url":"https://api.github.com/repos/simplybusiness/packer/subscription","commits_url":"https://api.github.com/repos/simplybusiness/packer/commits{/sha}","git_commits_url":"https://api.github.com/repos/simplybusiness/packer/git/commits{/sha}","comments_url":"https://api.github.com/repos/simplybusiness/packer/comments{/number}","issue_comment_url":"https://api.github.com/repos/simplybusiness/packer/issues/comments{/number}","contents_url":"https://api.github.com/repos/simplybusiness/packer/contents/{+path}","compare_url":"https://api.github.com/repos/simplybusiness/packer/compare/{base}...{head}","merges_url":"https://api.github.com/repos/simplybusiness/packer/merges","archive_url":"https://api.github.com/repos/simplybusiness/packer/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/simplybusiness/packer/downloads","issues_url":"https://api.github.com/repos/simplybusiness/packer/issues{/number}","pulls_url":"https://api.github.com/repos/simplybusiness/packer/pulls{/number}","milestones_url":"https://api.github.com/repos/simplybusiness/packer/milestones{/number}","notifications_url":"https://api.github.com/repos/simplybusiness/packer/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/simplybusiness/packer/labels{/name}","releases_url":"https://api.github.com/repos/simplybusiness/packer/releases{/id}","deployments_url":"https://api.github.com/repos/simplybusiness/packer/deployments","created_at":"2018-03-29T10:36:12Z","updated_at":"2018-05-21T19:02:00Z","pushed_at":"2018-05-22T15:01:19Z","git_url":"git://github.com/simplybusiness/packer.git","ssh_url":"git@github.com:simplybusiness/packer.git","clone_url":"https://github.com/simplybusiness/packer.git","svn_url":"https://github.com/simplybusiness/packer","homepage":"","size":73,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":1,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit"},"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"simplybusiness:master","ref":"master","sha":"1f2ce6eaccd4545804cdca58dea6f2b6cbdddc77","user":{"login":"simplybusiness","id":465825,"avatar_url":"https://avatars3.githubusercontent.com/u/465825?v=4","gravatar_id":"","url":"https://api.github.com/users/simplybusiness","html_url":"https://github.com/simplybusiness","followers_url":"https://api.github.com/users/simplybusiness/followers","following_url":"https://api.github.com/users/simplybusiness/following{/other_user}","gists_url":"https://api.github.com/users/simplybusiness/gists{/gist_id}","starred_url":"https://api.github.com/users/simplybusiness/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/simplybusiness/subscriptions","organizations_url":"https://api.github.com/users/simplybusiness/orgs","repos_url":"https://api.github.com/users/simplybusiness/repos","events_url":"https://api.github.com/users/simplybusiness/events{/privacy}","received_events_url":"https://api.github.com/users/simplybusiness/received_events","type":"Organization","site_admin":false},"repo":{"id":127276642,"name":"packer","full_name":"simplybusiness/packer","owner":{"login":"simplybusiness","id":465825,"avatar_url":"https://avatars3.githubusercontent.com/u/465825?v=4","gravatar_id":"","url":"https://api.github.com/users/simplybusiness","html_url":"https://github.com/simplybusiness","followers_url":"https://api.github.com/users/simplybusiness/followers","following_url":"https://api.github.com/users/simplybusiness/following{/other_user}","gists_url":"https://api.github.com/users/simplybusiness/gists{/gist_id}","starred_url":"https://api.github.com/users/simplybusiness/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/simplybusiness/subscriptions","organizations_url":"https://api.github.com/users/simplybusiness/orgs","repos_url":"https://api.github.com/users/simplybusiness/repos","events_url":"https://api.github.com/users/simplybusiness/events{/privacy}","received_events_url":"https://api.github.com/users/simplybusiness/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/simplybusiness/packer","description":"Library for integrating Webpack into any Rack compliant app","fork":false,"url":"https://api.github.com/repos/simplybusiness/packer","forks_url":"https://api.github.com/repos/simplybusiness/packer/forks","keys_url":"https://api.github.com/repos/simplybusiness/packer/keys{/key_id}","collaborators_url":"https://api.github.com/repos/simplybusiness/packer/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/simplybusiness/packer/teams","hooks_url":"https://api.github.com/repos/simplybusiness/packer/hooks","issue_events_url":"https://api.github.com/repos/simplybusiness/packer/issues/events{/number}","events_url":"https://api.github.com/repos/simplybusiness/packer/events","assignees_url":"https://api.github.com/repos/simplybusiness/packer/assignees{/user}","branches_url":"https://api.github.com/repos/simplybusiness/packer/branches{/branch}","tags_url":"https://api.github.com/repos/simplybusiness/packer/tags","blobs_url":"https://api.github.com/repos/simplybusiness/packer/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/simplybusiness/packer/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/simplybusiness/packer/git/refs{/sha}","trees_url":"https://api.github.com/repos/simplybusiness/packer/git/trees{/sha}","statuses_url":"https://api.github.com/repos/simplybusiness/packer/statuses/{sha}","languages_url":"https://api.github.com/repos/simplybusiness/packer/languages","stargazers_url":"https://api.github.com/repos/simplybusiness/packer/stargazers","contributors_url":"https://api.github.com/repos/simplybusiness/packer/contributors","subscribers_url":"https://api.github.com/repos/simplybusiness/packer/subscribers","subscription_url":"https://api.github.com/repos/simplybusiness/packer/subscription","commits_url":"https://api.github.com/repos/simplybusiness/packer/commits{/sha}","git_commits_url":"https://api.github.com/repos/simplybusiness/packer/git/commits{/sha}","comments_url":"https://api.github.com/repos/simplybusiness/packer/comments{/number}","issue_comment_url":"https://api.github.com/repos/simplybusiness/packer/issues/comments{/number}","contents_url":"https://api.github.com/repos/simplybusiness/packer/contents/{+path}","compare_url":"https://api.github.com/repos/simplybusiness/packer/compare/{base}...{head}","merges_url":"https://api.github.com/repos/simplybusiness/packer/merges","archive_url":"https://api.github.com/repos/simplybusiness/packer/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/simplybusiness/packer/downloads","issues_url":"https://api.github.com/repos/simplybusiness/packer/issues{/number}","pulls_url":"https://api.github.com/repos/simplybusiness/packer/pulls{/number}","milestones_url":"https://api.github.com/repos/simplybusiness/packer/milestones{/number}","notifications_url":"https://api.github.com/repos/simplybusiness/packer/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/simplybusiness/packer/labels{/name}","releases_url":"https://api.github.com/repos/simplybusiness/packer/releases{/id}","deployments_url":"https://api.github.com/repos/simplybusiness/packer/deployments","created_at":"2018-03-29T10:36:12Z","updated_at":"2018-05-21T19:02:00Z","pushed_at":"2018-05-22T15:01:19Z","git_url":"git://github.com/simplybusiness/packer.git","ssh_url":"git@github.com:simplybusiness/packer.git","clone_url":"https://github.com/simplybusiness/packer.git","svn_url":"https://github.com/simplybusiness/packer","homepage":"","size":73,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":1,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit"},"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/simplybusiness/packer/pulls/1"},"html":{"href":"https://github.com/simplybusiness/packer/pull/1"},"issue":{"href":"https://api.github.com/repos/simplybusiness/packer/issues/1"},"comments":{"href":"https://api.github.com/repos/simplybusiness/packer/issues/1/comments"},"review_comments":{"href":"https://api.github.com/repos/simplybusiness/packer/pulls/1/comments"},"review_comment":{"href":"https://api.github.com/repos/simplybusiness/packer/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/simplybusiness/packer/pulls/1/commits"},"statuses":{"href":"https://api.github.com/repos/simplybusiness/packer/statuses/bb9180a77d78835ea6550425bf4270c2c05024ae"}},"author_association":"NONE"}}
{"actor":{"display_login":"DXTimer"}}