bezel-app 0.1.3 → 0.1.4

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: 78ea98df3b0c1c5faba2a0cb91e2af51a736f7ca
4
- data.tar.gz: 90384a72836d8ea528608e0326c5c3bd0051b93d
3
+ metadata.gz: a704618556c1ec5f3d303fe862e14ec78eaf446f
4
+ data.tar.gz: 2ede1231be7a0e20f4f0b3b6b50a6ec9e798a83d
5
5
  SHA512:
6
- metadata.gz: d359910e0acb5b2afa48b9790d8ae13fcc408154bff58066ae82f6e943c6f6373596d93fc330d2c81edcdec1ea89c13433de0bc102b65cf5db8526608d91a2b9
7
- data.tar.gz: ecff06b79ad559654e0523f8c117de424c01da00ae9e023d6446f8c5648dbc90e1bfbfaa5dedd6b117dc6f4b9380e73bf25ba7748c896a7f4b139fff5a95978e
6
+ metadata.gz: 450027d5e67411ffafc49df055d6123d32d6085b3dd14fe845cbcaa7c103d763ff6f350101011c1c486a59d4d31a3410032adc97b8a03907404eb0b9a90f86a0
7
+ data.tar.gz: 95d75c46f8d74c88eaf2559f74006c20c8a6f2d17fd16248f318e3152531b1460f701ba75c1b557d9e235a4951e4af2a4a283a9d9c60ef6017f5cd34e4f9727f
data/bezel-app.gemspec CHANGED
@@ -5,7 +5,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
5
5
 
6
6
  Gem::Specification.new do |spec|
7
7
  spec.name = 'bezel-app'
8
- spec.version = '0.1.3'
8
+ spec.version = '0.1.4'
9
9
  spec.authors = ['Keith Thompson']
10
10
  spec.email = ['KeithM_Thompson@outlook.com']
11
11
 
data/lib/db_connection.rb CHANGED
@@ -57,7 +57,13 @@ MIGRATIONS = Dir.glob('./db/migrate/*.sql').to_a
57
57
  pending_migrations = MIGRATIONS.reject { |file| migrated?(file) }
58
58
  pending_migrations.each do |file|
59
59
  add_to_version(file)
60
- `psql -d #{app_name} -a -f #{file}`
60
+ if (ENV['DATABASE_URL'])
61
+ uri = URI.parse(ENV['DATABASE_URL'])
62
+ db_name = uri.path[1..-1]
63
+ else
64
+ db_name = app_name
65
+ end
66
+ `psql -d #{db_name} -a -f #{file}`
61
67
  end
62
68
  end
63
69
 
@@ -111,10 +117,20 @@ MIGRATIONS = Dir.glob('./db/migrate/*.sql').to_a
111
117
  end
112
118
 
113
119
  def self.reset
114
- commands = [
115
- "dropdb #{app_name}",
116
- "createdb #{app_name}"
117
- ]
120
+ if (ENV['DATABASE_URL'])
121
+ uri = URI.parse(ENV['DATABASE_URL'])
122
+
123
+ commands = [
124
+ "dropdb #{uri.path[1..-1]}",
125
+ "createdb #{uri.path[1..-1]}"
126
+ ]
127
+
128
+ else
129
+ commands = [
130
+ "dropdb #{app_name}",
131
+ "createdb #{app_name}"
132
+ ]
133
+ end
118
134
 
119
135
  commands.each { |command| `#{command}` }
120
136
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bezel-app
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Keith Thompson