travis-config 1.0.5 → 1.0.6

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
  SHA1:
3
- metadata.gz: 56954a8ebdcb05aee502195e9f9bf03a21845f33
4
- data.tar.gz: c4a40cc2df9e9484e893184f3edba2a5482723f1
3
+ metadata.gz: cee7c244fc6b7734354dcc47706c460436680012
4
+ data.tar.gz: b63aa540817d09962adf19b7206d8c1030dba352
5
5
  SHA512:
6
- metadata.gz: 0c2237af5b1c13668ea02b10cbcd8ed422d365f49b942d11567d16c897f6ca48a9124cca56c87483f4a937a263820b345e7ddad4c9ab93ef84bca7803f66feae
7
- data.tar.gz: 5a674fd612ef9005b4b55a8d596e5897004cf47dda0caea9111a9d832a118c6cd6f2ad0367b6f50b607ecb86aded1de14af60dd8ef458014a5b1c08130ec91d3
6
+ metadata.gz: c6190c8ec399f0dc208c4df56f7dc3f50da47942340a7175089af3a32baad678dc51c2d3170e340a37f2cd3c18dee88e2e6b1fbb38637a806d8b67d8d9298a7d
7
+ data.tar.gz: 22d3328345ffd7943ddfcf0ba11dd8f26bae07ab4d37103bca9d3b7fe7c85501643f8ccf2d8465a4d1fb7d488141ba93e7739810841d81fa893f9b8ee35a8385
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- travis-config (1.0.4)
4
+ travis-config (1.0.5)
5
5
  hashr (~> 2.0.0)
6
6
 
7
7
  GEM
@@ -24,7 +24,8 @@ module Travis
24
24
  end
25
25
 
26
26
  def logs_database
27
- Database.new(prefix: 'logs').config
27
+ config = Database.new(prefix: 'logs').config
28
+ config.empty? ? database : config
28
29
  end
29
30
 
30
31
  def amqp
@@ -1,3 +1,3 @@
1
1
  module TravisConfig
2
- VERSION = '1.0.5'
2
+ VERSION = '1.0.6'
3
3
  end
@@ -193,7 +193,22 @@ describe Travis::Config::Heroku, :Database do
193
193
  )
194
194
  end
195
195
 
196
- it 'sets logs_database to nil if no logs db url given' do
196
+ it 'defaults logs_database to database if no other config is given' do
197
+ ENV['DATABASE_URL'] = 'postgres://username:password@hostname:1234/logs_database'
198
+
199
+ expect(config.logs_database.to_h).to eq(
200
+ adapter: 'postgresql',
201
+ host: 'hostname',
202
+ port: 1234,
203
+ database: 'logs_database',
204
+ username: 'username',
205
+ password: 'password',
206
+ encoding: 'unicode',
207
+ variables: { application_name: 'travis-config/specs', statement_timeout: 10_000 }
208
+ )
209
+ end
210
+
211
+ it 'sets logs_database to nil if no DATABASE_URL and no LOGS_DATABASE_URL is given' do
197
212
  expect(config.logs_database).to be_nil
198
213
  end
199
214
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: travis-config
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.5
4
+ version: 1.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Travis CI