ridgepole 0.8.1 → 0.8.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 0a3e5a9549db69b5028a0f9a8bc7cff951a3617ca7eced3c6be06f31bc373f4e
4
- data.tar.gz: 756a16fecffa1a8c0f62a3f0a5d58a142377ca99509106865354ae6b8676317f
3
+ metadata.gz: 57ca4e6b9d4ac5f62c434e2cd3116f13b77e308666beb4e7e242def292d25957
4
+ data.tar.gz: 3cb9d7fb9e6949b9627ddb23219b5dbe7a7e34168e00fcf0cb073fd123b90e36
5
5
  SHA512:
6
- metadata.gz: 6441491b72d7dcdfad0e74e58bfd6a950d3ed7876e9060e5812b86b013ddae9cd69d65f86ac1d7d32f4b046d0c1e2e126deade4ef891ab25954b4683d13bd32d
7
- data.tar.gz: f30396aead19b62e243a2b135a27a2313ebbd05d429803ea8e0ee38c841f6729801a211cfa57e6d8f9b59fbef834f23d43d73d4f1684455bee19210f8eecce0e
6
+ metadata.gz: 9ba1cab03cb73b791fc28bf52985dd7caef619694fad6fc0ab9b22eedc53791da70050d6c77b4017019708dade6387777836c427dc080c9dace6690ac83a1a3b
7
+ data.tar.gz: 3f8446b608a6bdc86095aa3639bd3e57bcebdf423c858edf3f12613e98a6674be7bf210ec6443d0964189143cae3f5af4223a36cda705e8c0bf3ddaf44026fab
data/README.md CHANGED
@@ -103,6 +103,8 @@ It defines DB schema using [Rails DSL](http://guides.rubyonrails.org/migrations.
103
103
  * Support Rails 6.0
104
104
  * `>= 0.8.1`
105
105
  * Drop tables in an order considering foreign key constraints ([pull#284](https://github.com/winebarrel/ridgepole/pull/284))
106
+ * `>= 0.8.2`
107
+ * Support `postgres://` schema ([pull#285](https://github.com/winebarrel/ridgepole/pull/285))
106
108
  </details>
107
109
 
108
110
  ## Installation
@@ -69,8 +69,11 @@ module Ridgepole
69
69
  {}
70
70
  end
71
71
 
72
+ adapter = uri.scheme
73
+ adapter = 'postgresql' if adapter == 'postgres'
74
+
72
75
  query_hash.merge(
73
- 'adapter' => uri.scheme,
76
+ 'adapter' => adapter,
74
77
  'username' => CGI.unescape(uri.user),
75
78
  'password' => uri.password ? CGI.unescape(uri.password) : nil,
76
79
  'host' => uri.host,
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Ridgepole
4
- VERSION = '0.8.1'
4
+ VERSION = '0.8.2'
5
5
  end
@@ -125,6 +125,19 @@ describe Ridgepole::Config do
125
125
  }
126
126
  end
127
127
 
128
+ context 'when passed Heroku style DATABASE_URL' do
129
+ let(:config) { 'postgres://root:pass@127.0.0.1:5432/blog' }
130
+ let(:env) { 'development' }
131
+
132
+ it {
133
+ expect(subject['adapter']).to eq 'postgresql'
134
+ expect(subject['database']).to eq 'blog'
135
+ expect(subject['username']).to eq 'root'
136
+ expect(subject['password']).to eq 'pass'
137
+ expect(subject['port']).to eq 5432
138
+ }
139
+ end
140
+
128
141
  context 'when passed DATABASE_URL from ENV' do
129
142
  let(:config) { 'env:DATABASE_URL' }
130
143
  let(:env) { 'development' }
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ridgepole
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.1
4
+ version: 0.8.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Genki Sugawara
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-09-10 00:00:00.000000000 Z
11
+ date: 2019-09-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activerecord
@@ -442,7 +442,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
442
442
  - !ruby/object:Gem::Version
443
443
  version: '0'
444
444
  requirements: []
445
- rubygems_version: 3.0.3
445
+ rubygems_version: 3.0.4
446
446
  signing_key:
447
447
  specification_version: 4
448
448
  summary: Ridgepole is a tool to manage DB schema.