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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: aee4a6bf44828bb44bf30a91dbc9ca7028813495
4
- data.tar.gz: 4db6880197343768cad8e0692fad58741367d198
3
+ metadata.gz: abfb4c4846af68b332efa620d539f99364e114a4
4
+ data.tar.gz: 111c9e64a11eb6331b1bacb9bb565ba634f385ff
5
5
  SHA512:
6
- metadata.gz: 7498ab1b0c1b05c615d01ee2f17efac2cadb44f0bde156cb707fde3a624c1aca7d7170fbc7a54b1024ae3740f0bb90e40e197729d1a6ca32962f835893b1bbc6
7
- data.tar.gz: d992acfaa9b8ace9e80ad07ac363e6d65204dd13dd4678dcee00935b608ea56a1f7b9f6151304939c6dbaae07c64788163728732134fdbc48bbb01b40373c106
6
+ metadata.gz: 34744c5d5d60649245b11bc43e51378bfad6189304fb64f6949743723f649e4b52f16e65af8caba5f3762d7df7ab111f58aed6735217a98e726da377619aeafc
7
+ data.tar.gz: 124924ade87b5a6b4c844a0b806a7b741a5855583a0948d55a59e75de9bb8eff6f20e099625865deca6848cdb49998d84ed4dbe88adddb0e0351c36db2b53812
data/Gemfile.lock CHANGED
@@ -35,6 +35,3 @@ DEPENDENCIES
35
35
  mocha (~> 1.1)
36
36
  rspec (~> 3.0)
37
37
  travis-config!
38
-
39
- BUNDLED WITH
40
- 1.10.6
@@ -4,7 +4,13 @@ module Travis
4
4
  class Config
5
5
  class Heroku
6
6
  module Url
7
- Base = Struct.new(:username, :password, :host, :port, :database)
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 {} if url.nil? || url.empty?
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])
@@ -1,3 +1,3 @@
1
1
  module TravisConfig
2
- VERSION = '1.0.0'
2
+ VERSION = '1.0.1'
3
3
  end
@@ -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, :Amqp do
6
6
  after { ENV.delete('RABBITMQ_URL') }
7
7
 
8
8
  it 'loads a RABBITMQ_URL' do
9
- expect(config.amqp).to eq(
9
+ expect(config.amqp.to_h).to eq(
10
10
  host: 'hostname',
11
11
  port: 1234,
12
12
  vhost: 'vhost',
@@ -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,
@@ -6,6 +6,6 @@ describe Travis::Config::Heroku, :Redis do
6
6
  after { ENV.delete('REDIS_URL') }
7
7
 
8
8
  it 'loads a REDIS_URL' do
9
- expect(config.redis).to eq(url: url)
9
+ expect(config.redis.to_h).to eq(url: url)
10
10
  end
11
11
  end
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.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-10-31 00:00:00.000000000 Z
11
+ date: 2015-11-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: hashr