{"action":"created","comment":{"url":"https://api.github.com/repos/sgruhier/capistrano-db-tasks/pulls/comments/39109465","id":39109465,"diff_hunk":"@@ -106,8 +106,13 @@ def dump_cmd_ignore_data_tables_opts\n   class Remote < Base\n     def initialize(cap_instance)\n       super(cap_instance)\n-      @config = @cap.capture(\"cat #{@cap.current_path}/config/database.yml\")\n-      @config = YAML.load(ERB.new(@config).result)[@cap.fetch(:rails_env).to_s]\n+      @cap.within @cap.current_path do\n+        @cap.with rails_env: @cap.fetch(:rails_env) do\n+          @config = @cap.capture(:rails, 'runner \"puts Rails.application.config.database_configuration[Rails.env].to_yaml\"', '2>/dev/null')\n+          @config.gsub!(/.*\\-\\-\\-/m, '---') # Remove all bundler and rails initialization errors\n+        end","path":"lib/capistrano-db-tasks/database.rb","position":10,"original_position":10,"commit_id":"b0f174e463ba338db8741663db8a95d9652fd980","original_commit_id":"b0f174e463ba338db8741663db8a95d9652fd980","user":{"login":"numbata","id":82400,"avatar_url":"https://avatars.githubusercontent.com/u/82400?v=3","gravatar_id":"","url":"https://api.github.com/users/numbata","html_url":"https://github.com/numbata","followers_url":"https://api.github.com/users/numbata/followers","following_url":"https://api.github.com/users/numbata/following{/other_user}","gists_url":"https://api.github.com/users/numbata/gists{/gist_id}","starred_url":"https://api.github.com/users/numbata/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/numbata/subscriptions","organizations_url":"https://api.github.com/users/numbata/orgs","repos_url":"https://api.github.com/users/numbata/repos","events_url":"https://api.github.com/users/numbata/events{/privacy}","received_events_url":"https://api.github.com/users/numbata/received_events","type":"User","site_admin":false},"body":"Errors, warnings and notices like:\r\n\r\n>    Don't run Bundler as root. Bundler can ask for sudo if it is needed, and installing your bundle as root will break this application for all non-root users on this machine.\r\n\r\nor\r\n\r\n>    Your Gemfile lists the gem X (>= 0) more than once.\r\n>    You should probably keep only one of them.\r\n>    While it's not a problem now, it could cause errors if you change the version of just one of them later.\r\n\r\nwhich captured with database configuration and breaks the config yaml.","created_at":"2015-09-09T23:23:41Z","updated_at":"2015-09-09T23:23:41Z","html_url":"https://github.com/sgruhier/capistrano-db-tasks/pull/70#discussion_r39109465","pull_request_url":"https://api.github.com/repos/sgruhier/capistrano-db-tasks/pulls/70","_links":{"self":{"href":"https://api.github.com/repos/sgruhier/capistrano-db-tasks/pulls/comments/39109465"},"html":{"href":"https://github.com/sgruhier/capistrano-db-tasks/pull/70#discussion_r39109465"},"pull_request":{"href":"https://api.github.com/repos/sgruhier/capistrano-db-tasks/pulls/70"}}},"pull_request":{"url":"https://api.github.com/repos/sgruhier/capistrano-db-tasks/pulls/70","id":44605298,"html_url":"https://github.com/sgruhier/capistrano-db-tasks/pull/70","diff_url":"https://github.com/sgruhier/capistrano-db-tasks/pull/70.diff","patch_url":"https://github.com/sgruhier/capistrano-db-tasks/pull/70.patch","issue_url":"https://api.github.com/repos/sgruhier/capistrano-db-tasks/issues/70","number":70,"state":"open","locked":false,"title":"issue #54 Add support of ENV['DATABASE_URL']","user":{"login":"numbata","id":82400,"avatar_url":"https://avatars.githubusercontent.com/u/82400?v=3","gravatar_id":"","url":"https://api.github.com/users/numbata","html_url":"https://github.com/numbata","followers_url":"https://api.github.com/users/numbata/followers","following_url":"https://api.github.com/users/numbata/following{/other_user}","gists_url":"https://api.github.com/users/numbata/gists{/gist_id}","starred_url":"https://api.github.com/users/numbata/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/numbata/subscriptions","organizations_url":"https://api.github.com/users/numbata/orgs","repos_url":"https://api.github.com/users/numbata/repos","events_url":"https://api.github.com/users/numbata/events{/privacy}","received_events_url":"https://api.github.com/users/numbata/received_events","type":"User","site_admin":false},"body":"Using `Rails.application.config.database_configuration` to get database configuration instead of `database.yml` file. Works with database configuration from ENV['DATABASE_URL'] also.","created_at":"2015-09-09T21:53:02Z","updated_at":"2015-09-09T23:23:41Z","closed_at":null,"merged_at":null,"merge_commit_sha":"c098ac238eb885cc7d8f57e47b837a10ea8207fb","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/sgruhier/capistrano-db-tasks/pulls/70/commits","review_comments_url":"https://api.github.com/repos/sgruhier/capistrano-db-tasks/pulls/70/comments","review_comment_url":"https://api.github.com/repos/sgruhier/capistrano-db-tasks/pulls/comments{/number}","comments_url":"https://api.github.com/repos/sgruhier/capistrano-db-tasks/issues/70/comments","statuses_url":"https://api.github.com/repos/sgruhier/capistrano-db-tasks/statuses/b0f174e463ba338db8741663db8a95d9652fd980","head":{"label":"numbata:feature/add_support_database_url","ref":"feature/add_support_database_url","sha":"b0f174e463ba338db8741663db8a95d9652fd980","user":{"login":"numbata","id":82400,"avatar_url":"https://avatars.githubusercontent.com/u/82400?v=3","gravatar_id":"","url":"https://api.github.com/users/numbata","html_url":"https://github.com/numbata","followers_url":"https://api.github.com/users/numbata/followers","following_url":"https://api.github.com/users/numbata/following{/other_user}","gists_url":"https://api.github.com/users/numbata/gists{/gist_id}","starred_url":"https://api.github.com/users/numbata/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/numbata/subscriptions","organizations_url":"https://api.github.com/users/numbata/orgs","repos_url":"https://api.github.com/users/numbata/repos","events_url":"https://api.github.com/users/numbata/events{/privacy}","received_events_url":"https://api.github.com/users/numbata/received_events","type":"User","site_admin":false},"repo":{"id":20318284,"name":"capistrano-db-tasks","full_name":"numbata/capistrano-db-tasks","owner":{"login":"numbata","id":82400,"avatar_url":"https://avatars.githubusercontent.com/u/82400?v=3","gravatar_id":"","url":"https://api.github.com/users/numbata","html_url":"https://github.com/numbata","followers_url":"https://api.github.com/users/numbata/followers","following_url":"https://api.github.com/users/numbata/following{/other_user}","gists_url":"https://api.github.com/users/numbata/gists{/gist_id}","starred_url":"https://api.github.com/users/numbata/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/numbata/subscriptions","organizations_url":"https://api.github.com/users/numbata/orgs","repos_url":"https://api.github.com/users/numbata/repos","events_url":"https://api.github.com/users/numbata/events{/privacy}","received_events_url":"https://api.github.com/users/numbata/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/numbata/capistrano-db-tasks","description":"Add capistrano tasks for syncing remote and local database","fork":true,"url":"https://api.github.com/repos/numbata/capistrano-db-tasks","forks_url":"https://api.github.com/repos/numbata/capistrano-db-tasks/forks","keys_url":"https://api.github.com/repos/numbata/capistrano-db-tasks/keys{/key_id}","collaborators_url":"https://api.github.com/repos/numbata/capistrano-db-tasks/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/numbata/capistrano-db-tasks/teams","hooks_url":"https://api.github.com/repos/numbata/capistrano-db-tasks/hooks","issue_events_url":"https://api.github.com/repos/numbata/capistrano-db-tasks/issues/events{/number}","events_url":"https://api.github.com/repos/numbata/capistrano-db-tasks/events","assignees_url":"https://api.github.com/repos/numbata/capistrano-db-tasks/assignees{/user}","branches_url":"https://api.github.com/repos/numbata/capistrano-db-tasks/branches{/branch}","tags_url":"https://api.github.com/repos/numbata/capistrano-db-tasks/tags","blobs_url":"https://api.github.com/repos/numbata/capistrano-db-tasks/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/numbata/capistrano-db-tasks/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/numbata/capistrano-db-tasks/git/refs{/sha}","trees_url":"https://api.github.com/repos/numbata/capistrano-db-tasks/git/trees{/sha}","statuses_url":"https://api.github.com/repos/numbata/capistrano-db-tasks/statuses/{sha}","languages_url":"https://api.github.com/repos/numbata/capistrano-db-tasks/languages","stargazers_url":"https://api.github.com/repos/numbata/capistrano-db-tasks/stargazers","contributors_url":"https://api.github.com/repos/numbata/capistrano-db-tasks/contributors","subscribers_url":"https://api.github.com/repos/numbata/capistrano-db-tasks/subscribers","subscription_url":"https://api.github.com/repos/numbata/capistrano-db-tasks/subscription","commits_url":"https://api.github.com/repos/numbata/capistrano-db-tasks/commits{/sha}","git_commits_url":"https://api.github.com/repos/numbata/capistrano-db-tasks/git/commits{/sha}","comments_url":"https://api.github.com/repos/numbata/capistrano-db-tasks/comments{/number}","issue_comment_url":"https://api.github.com/repos/numbata/capistrano-db-tasks/issues/comments{/number}","contents_url":"https://api.github.com/repos/numbata/capistrano-db-tasks/contents/{+path}","compare_url":"https://api.github.com/repos/numbata/capistrano-db-tasks/compare/{base}...{head}","merges_url":"https://api.github.com/repos/numbata/capistrano-db-tasks/merges","archive_url":"https://api.github.com/repos/numbata/capistrano-db-tasks/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/numbata/capistrano-db-tasks/downloads","issues_url":"https://api.github.com/repos/numbata/capistrano-db-tasks/issues{/number}","pulls_url":"https://api.github.com/repos/numbata/capistrano-db-tasks/pulls{/number}","milestones_url":"https://api.github.com/repos/numbata/capistrano-db-tasks/milestones{/number}","notifications_url":"https://api.github.com/repos/numbata/capistrano-db-tasks/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/numbata/capistrano-db-tasks/labels{/name}","releases_url":"https://api.github.com/repos/numbata/capistrano-db-tasks/releases{/id}","created_at":"2014-05-30T05:31:09Z","updated_at":"2015-04-23T14:21:06Z","pushed_at":"2015-09-09T21:51:18Z","git_url":"git://github.com/numbata/capistrano-db-tasks.git","ssh_url":"git@github.com:numbata/capistrano-db-tasks.git","clone_url":"https://github.com/numbata/capistrano-db-tasks.git","svn_url":"https://github.com/numbata/capistrano-db-tasks","homepage":"","size":235,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2,"mirror_url":null,"open_issues_count":0,"forks":2,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"sgruhier:master","ref":"master","sha":"aa58c21d4483939addb2fe9a0e2369fb1c43e670","user":{"login":"sgruhier","id":3385,"avatar_url":"https://avatars.githubusercontent.com/u/3385?v=3","gravatar_id":"","url":"https://api.github.com/users/sgruhier","html_url":"https://github.com/sgruhier","followers_url":"https://api.github.com/users/sgruhier/followers","following_url":"https://api.github.com/users/sgruhier/following{/other_user}","gists_url":"https://api.github.com/users/sgruhier/gists{/gist_id}","starred_url":"https://api.github.com/users/sgruhier/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sgruhier/subscriptions","organizations_url":"https://api.github.com/users/sgruhier/orgs","repos_url":"https://api.github.com/users/sgruhier/repos","events_url":"https://api.github.com/users/sgruhier/events{/privacy}","received_events_url":"https://api.github.com/users/sgruhier/received_events","type":"User","site_admin":false},"repo":{"id":198614,"name":"capistrano-db-tasks","full_name":"sgruhier/capistrano-db-tasks","owner":{"login":"sgruhier","id":3385,"avatar_url":"https://avatars.githubusercontent.com/u/3385?v=3","gravatar_id":"","url":"https://api.github.com/users/sgruhier","html_url":"https://github.com/sgruhier","followers_url":"https://api.github.com/users/sgruhier/followers","following_url":"https://api.github.com/users/sgruhier/following{/other_user}","gists_url":"https://api.github.com/users/sgruhier/gists{/gist_id}","starred_url":"https://api.github.com/users/sgruhier/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sgruhier/subscriptions","organizations_url":"https://api.github.com/users/sgruhier/orgs","repos_url":"https://api.github.com/users/sgruhier/repos","events_url":"https://api.github.com/users/sgruhier/events{/privacy}","received_events_url":"https://api.github.com/users/sgruhier/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/sgruhier/capistrano-db-tasks","description":"Add capistrano tasks for syncing remote and local database","fork":false,"url":"https://api.github.com/repos/sgruhier/capistrano-db-tasks","forks_url":"https://api.github.com/repos/sgruhier/capistrano-db-tasks/forks","keys_url":"https://api.github.com/repos/sgruhier/capistrano-db-tasks/keys{/key_id}","collaborators_url":"https://api.github.com/repos/sgruhier/capistrano-db-tasks/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/sgruhier/capistrano-db-tasks/teams","hooks_url":"https://api.github.com/repos/sgruhier/capistrano-db-tasks/hooks","issue_events_url":"https://api.github.com/repos/sgruhier/capistrano-db-tasks/issues/events{/number}","events_url":"https://api.github.com/repos/sgruhier/capistrano-db-tasks/events","assignees_url":"https://api.github.com/repos/sgruhier/capistrano-db-tasks/assignees{/user}","branches_url":"https://api.github.com/repos/sgruhier/capistrano-db-tasks/branches{/branch}","tags_url":"https://api.github.com/repos/sgruhier/capistrano-db-tasks/tags","blobs_url":"https://api.github.com/repos/sgruhier/capistrano-db-tasks/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/sgruhier/capistrano-db-tasks/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/sgruhier/capistrano-db-tasks/git/refs{/sha}","trees_url":"https://api.github.com/repos/sgruhier/capistrano-db-tasks/git/trees{/sha}","statuses_url":"https://api.github.com/repos/sgruhier/capistrano-db-tasks/statuses/{sha}","languages_url":"https://api.github.com/repos/sgruhier/capistrano-db-tasks/languages","stargazers_url":"https://api.github.com/repos/sgruhier/capistrano-db-tasks/stargazers","contributors_url":"https://api.github.com/repos/sgruhier/capistrano-db-tasks/contributors","subscribers_url":"https://api.github.com/repos/sgruhier/capistrano-db-tasks/subscribers","subscription_url":"https://api.github.com/repos/sgruhier/capistrano-db-tasks/subscription","commits_url":"https://api.github.com/repos/sgruhier/capistrano-db-tasks/commits{/sha}","git_commits_url":"https://api.github.com/repos/sgruhier/capistrano-db-tasks/git/commits{/sha}","comments_url":"https://api.github.com/repos/sgruhier/capistrano-db-tasks/comments{/number}","issue_comment_url":"https://api.github.com/repos/sgruhier/capistrano-db-tasks/issues/comments{/number}","contents_url":"https://api.github.com/repos/sgruhier/capistrano-db-tasks/contents/{+path}","compare_url":"https://api.github.com/repos/sgruhier/capistrano-db-tasks/compare/{base}...{head}","merges_url":"https://api.github.com/repos/sgruhier/capistrano-db-tasks/merges","archive_url":"https://api.github.com/repos/sgruhier/capistrano-db-tasks/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/sgruhier/capistrano-db-tasks/downloads","issues_url":"https://api.github.com/repos/sgruhier/capistrano-db-tasks/issues{/number}","pulls_url":"https://api.github.com/repos/sgruhier/capistrano-db-tasks/pulls{/number}","milestones_url":"https://api.github.com/repos/sgruhier/capistrano-db-tasks/milestones{/number}","notifications_url":"https://api.github.com/repos/sgruhier/capistrano-db-tasks/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/sgruhier/capistrano-db-tasks/labels{/name}","releases_url":"https://api.github.com/repos/sgruhier/capistrano-db-tasks/releases{/id}","created_at":"2009-05-12T07:34:36Z","updated_at":"2015-09-07T07:38:56Z","pushed_at":"2015-09-09T21:53:02Z","git_url":"git://github.com/sgruhier/capistrano-db-tasks.git","ssh_url":"git@github.com:sgruhier/capistrano-db-tasks.git","clone_url":"https://github.com/sgruhier/capistrano-db-tasks.git","svn_url":"https://github.com/sgruhier/capistrano-db-tasks","homepage":"","size":526,"stargazers_count":211,"watchers_count":211,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":93,"mirror_url":null,"open_issues_count":30,"forks":93,"open_issues":30,"watchers":211,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/sgruhier/capistrano-db-tasks/pulls/70"},"html":{"href":"https://github.com/sgruhier/capistrano-db-tasks/pull/70"},"issue":{"href":"https://api.github.com/repos/sgruhier/capistrano-db-tasks/issues/70"},"comments":{"href":"https://api.github.com/repos/sgruhier/capistrano-db-tasks/issues/70/comments"},"review_comments":{"href":"https://api.github.com/repos/sgruhier/capistrano-db-tasks/pulls/70/comments"},"review_comment":{"href":"https://api.github.com/repos/sgruhier/capistrano-db-tasks/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/sgruhier/capistrano-db-tasks/pulls/70/commits"},"statuses":{"href":"https://api.github.com/repos/sgruhier/capistrano-db-tasks/statuses/b0f174e463ba338db8741663db8a95d9652fd980"}}}}