platform_sh 0.2.2 → 0.2.3

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: c426d4b7936a31a7512f561ec49fff533e603c79
4
- data.tar.gz: 8972b6de32a6aa9596d0c3ee95cacb6550687e8e
3
+ metadata.gz: 3d7dc484d0414e3a3d3033ca3a5435910932c4c9
4
+ data.tar.gz: 5e234ccea2bc43683dbefe4ec7ee60547116c745
5
5
  SHA512:
6
- metadata.gz: 49c0c5e5c1fab291d69d6f4dc97f772ccd3b757ea3d7286e7d46daf2e4ffff4fb7971b2463f4cd3d2dd3f1534304693618b2be264873c307c09a6a7b58787125
7
- data.tar.gz: d31226dd0e7222ccfdaec3e77c139a838eb145338cbedd735d59ae6b9e33b8ad697601b5301df5db0c72f7e40e0e766e3a24aa2cfc84d99fb964a3b35dc398c2
6
+ metadata.gz: 51c0fa7f383216fd004bc70287936e8f857b3f4d1e52e4fc59f303a3e668371155bc909d4ca2c611c9d82e031e2d8ec968feb3024b1a91b80ec298c1ef0d0139
7
+ data.tar.gz: 4f4ff7373bb4c045817222e20decddb343bf8534bea8feadadca7f45dafc684ae8a5fbd9621587fde8834d979d7a0d0ba673cdc648bd5d892ae89d6e216111ab
data/lib/platform_sh.rb CHANGED
@@ -57,23 +57,26 @@ class PlatformSH
57
57
 
58
58
  #Tries to guess relational database url
59
59
  def self.guess_database_url
60
- databases = PlatformSH::config["relationships"].select {|k,v| v[0]["scheme"]=="mysql" || v[0]["scheme"]=="postgresql"}
60
+ databases = PlatformSH::config["relationships"].select {|k,v| v[0]["scheme"]=="mysql" || v[0]["scheme"]=="pgsql"}
61
61
  case databases.length
62
- when 0
63
- $stderr.puts "Could not find a relational database"
64
- return nil
65
- when 1
66
- database = databases.first[1][0]
67
- #This is needed to choose between mysql and mysql2 gems, magically.
68
- if database['scheme'] == "mysql"
69
- scheme = "mysql2"
70
- else
71
- scheme = database['scheme']
72
- end
73
- database_url = "#{scheme}://#{database['username']}:#{database['password']}@#{database['host']}:#{database['port']}/#{database['path']}"
74
- return database_url
75
- else
76
- $stderr.puts "More than one database, giving up, set configuration by hand"
62
+ when 0
63
+ $stderr.puts "Could not find a relational database"
64
+ return nil
65
+ when 1
66
+ database = databases.first[1][0]
67
+ #This is needed to choose between mysql and mysql2 gems, magically.
68
+ case database['scheme']
69
+ when "mysql"
70
+ scheme = "mysql2"
71
+ when "pgsql"
72
+ scheme = "postgresql"
73
+ else
74
+ scheme = database['scheme']
75
+ end
76
+ database_url = "#{scheme}://#{database['username']}:#{database['password']}@#{database['host']}:#{database['port']}/#{database['path']}"
77
+ return database_url
78
+ else
79
+ $stderr.puts "More than one database, giving up, set configuration by hand"
77
80
  end
78
81
  end
79
82
 
@@ -1,3 +1,3 @@
1
1
  class PlatformSH
2
- VERSION = "0.2.2"
2
+ VERSION = "0.2.3"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: platform_sh
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.2
4
+ version: 0.2.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ori Pekelman