travis-config 1.0.0 → 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Gemfile.lock +0 -3
- data/lib/travis/config/heroku/url.rb +8 -2
- data/lib/travis/config/version.rb +1 -1
- data/spec/travis/config/docker_spec.rb +1 -1
- data/spec/travis/config/heroku/amqp_spec.rb +1 -1
- data/spec/travis/config/heroku/database_spec.rb +8 -8
- data/spec/travis/config/heroku/redis_spec.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: abfb4c4846af68b332efa620d539f99364e114a4
|
4
|
+
data.tar.gz: 111c9e64a11eb6331b1bacb9bb565ba634f385ff
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 34744c5d5d60649245b11bc43e51378bfad6189304fb64f6949743723f649e4b52f16e65af8caba5f3762d7df7ab111f58aed6735217a98e726da377619aeafc
|
7
|
+
data.tar.gz: 124924ade87b5a6b4c844a0b806a7b741a5855583a0948d55a59e75de9bb8eff6f20e099625865deca6848cdb49998d84ed4dbe88adddb0e0351c36db2b53812
|
data/Gemfile.lock
CHANGED
@@ -4,7 +4,13 @@ module Travis
|
|
4
4
|
class Config
|
5
5
|
class Heroku
|
6
6
|
module Url
|
7
|
-
Base
|
7
|
+
class Base < Struct.new(:username, :password, :host, :port, :database)
|
8
|
+
def to_h
|
9
|
+
Hash[each_pair.to_a]
|
10
|
+
end
|
11
|
+
end
|
12
|
+
|
13
|
+
Generic = Class.new(Base)
|
8
14
|
Postgres = Class.new(Base)
|
9
15
|
Redis = Class.new(Base)
|
10
16
|
|
@@ -18,7 +24,7 @@ module Travis
|
|
18
24
|
|
19
25
|
class << self
|
20
26
|
def parse(url)
|
21
|
-
return
|
27
|
+
return Generic.new if url.nil? || url.empty?
|
22
28
|
uri = URI.parse(url)
|
23
29
|
const = const_get(camelize(uri.scheme))
|
24
30
|
const.new(uri.user, uri.password, uri.host, uri.port, uri.path[1..-1])
|
@@ -31,7 +31,7 @@ describe Travis::Config::Docker do
|
|
31
31
|
before { ENV['REDIS_PORT'] = 'tcp://172.17.0.7:6379' }
|
32
32
|
|
33
33
|
it 'loads the port to redis.url' do
|
34
|
-
expect(config.redis).to eq({ url: 'tcp://172.17.0.7:6379' })
|
34
|
+
expect(config.redis.to_h).to eq({ url: 'tcp://172.17.0.7:6379' })
|
35
35
|
end
|
36
36
|
end
|
37
37
|
end
|
@@ -6,7 +6,7 @@ describe Travis::Config::Heroku, :Database do
|
|
6
6
|
it 'loads a DATABASE_URL with a port' do
|
7
7
|
ENV['DATABASE_URL'] = 'postgres://username:password@hostname:1234/database'
|
8
8
|
|
9
|
-
expect(config.database).to eq(
|
9
|
+
expect(config.database.to_h).to eq(
|
10
10
|
adapter: 'postgresql',
|
11
11
|
host: 'hostname',
|
12
12
|
port: 1234,
|
@@ -20,7 +20,7 @@ describe Travis::Config::Heroku, :Database do
|
|
20
20
|
it 'loads a DATABASE_URL without a port' do
|
21
21
|
ENV['DATABASE_URL'] = 'postgres://username:password@hostname/database'
|
22
22
|
|
23
|
-
expect(config.database).to eq(
|
23
|
+
expect(config.database.to_h).to eq(
|
24
24
|
adapter: 'postgresql',
|
25
25
|
host: 'hostname',
|
26
26
|
database: 'database',
|
@@ -34,7 +34,7 @@ describe Travis::Config::Heroku, :Database do
|
|
34
34
|
ENV['DATABASE_URL'] = 'postgres://username:password@hostname:1234/database'
|
35
35
|
ENV['DB_POOL'] = '25'
|
36
36
|
|
37
|
-
expect(config.database).to eq(
|
37
|
+
expect(config.database.to_h).to eq(
|
38
38
|
adapter: 'postgresql',
|
39
39
|
host: 'hostname',
|
40
40
|
port: 1234,
|
@@ -50,7 +50,7 @@ describe Travis::Config::Heroku, :Database do
|
|
50
50
|
ENV['DATABASE_URL'] = 'postgres://username:password@hostname:1234/database'
|
51
51
|
ENV['DATABASE_POOL_SIZE'] = '25'
|
52
52
|
|
53
|
-
expect(config.database).to eq(
|
53
|
+
expect(config.database.to_h).to eq(
|
54
54
|
adapter: 'postgresql',
|
55
55
|
host: 'hostname',
|
56
56
|
port: 1234,
|
@@ -65,7 +65,7 @@ describe Travis::Config::Heroku, :Database do
|
|
65
65
|
it 'loads a LOGS_DATABASE_URL with a port' do
|
66
66
|
ENV['LOGS_DATABASE_URL'] = 'postgres://username:password@hostname:1234/logs_database'
|
67
67
|
|
68
|
-
expect(config.logs_database).to eq(
|
68
|
+
expect(config.logs_database.to_h).to eq(
|
69
69
|
adapter: 'postgresql',
|
70
70
|
host: 'hostname',
|
71
71
|
port: 1234,
|
@@ -79,7 +79,7 @@ describe Travis::Config::Heroku, :Database do
|
|
79
79
|
it 'loads a LOGS_DATABASE_URL without a port' do
|
80
80
|
ENV['LOGS_DATABASE_URL'] = 'postgres://username:password@hostname/logs_database'
|
81
81
|
|
82
|
-
expect(config.logs_database).to eq(
|
82
|
+
expect(config.logs_database.to_h).to eq(
|
83
83
|
adapter: 'postgresql',
|
84
84
|
host: 'hostname',
|
85
85
|
database: 'logs_database',
|
@@ -93,7 +93,7 @@ describe Travis::Config::Heroku, :Database do
|
|
93
93
|
ENV['LOGS_DATABASE_URL'] = 'postgres://username:password@hostname:1234/logs_database'
|
94
94
|
ENV['LOGS_DB_POOL'] = '25'
|
95
95
|
|
96
|
-
expect(config.logs_database).to eq(
|
96
|
+
expect(config.logs_database.to_h).to eq(
|
97
97
|
adapter: 'postgresql',
|
98
98
|
host: 'hostname',
|
99
99
|
port: 1234,
|
@@ -109,7 +109,7 @@ describe Travis::Config::Heroku, :Database do
|
|
109
109
|
ENV['LOGS_DATABASE_URL'] = 'postgres://username:password@hostname:1234/logs_database'
|
110
110
|
ENV['LOGS_DATABASE_POOL_SIZE'] = '25'
|
111
111
|
|
112
|
-
expect(config.logs_database).to eq(
|
112
|
+
expect(config.logs_database.to_h).to eq(
|
113
113
|
adapter: 'postgresql',
|
114
114
|
host: 'hostname',
|
115
115
|
port: 1234,
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: travis-config
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Travis CI
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-11-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: hashr
|