titanic-db 0.0.5 → 0.0.6

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: cc844c7a25dab624884d3613a83d3736cc176f77
4
- data.tar.gz: 171bb6622c0d6319706efdba49848038f3cf4aea
3
+ metadata.gz: 6f5271949cd52096c505f84a76293d417e92cc22
4
+ data.tar.gz: acf6b52db7703895e896bbef037bcde02a2f44ad
5
5
  SHA512:
6
- metadata.gz: 66f62565708c4699461b6908cb42494f310f5737185a082a6199fd765246592799e4567858987508a5a1668476434406179995b09016a3d990a96d95fef54331
7
- data.tar.gz: 6bb45b4a16edcbbc5a81404fc31526ccb691d0b133b04a003605d8dac2382bfb7f9979f7ff9fabfa19e27f124765938210ef19f3dfec7ba70394aef3f231417b
6
+ metadata.gz: 7892c58249d1a0dddc8e93a293a199c948da126ac51c9339e96e484cc9ad730355b22ebfeaaa6a8bba9e945b154d0b7eb6b134ef542a9c113a54812de82a2b2e
7
+ data.tar.gz: 511dad9151cc025875e7ab3f8849f2d9d239d6dafc5ef83bcbb9b3a6be8ef0d17151294b75b8052db2eb0b517176437c3d3f86818b92268e29d4f6bacc79900d
@@ -3,28 +3,28 @@ namespace :db do
3
3
  desc "Pull the db from remote and replaces your local dev copy with it"
4
4
  task :sync => :environment do
5
5
  # Make a temp folder
6
- FileUtils.mkdir "titanic"
6
+ FileUtils.mkdir "#{Rails.root}/titanic/"
7
7
 
8
8
  # Pull db from remote to local folder
9
9
  system "scp #{ENV["TITANIC_SSH_USERNAME"]}@#{ENV["TITANIC_SSH_HOST"]}:#{ENV["TITANIC_SSH_FILEPATH"]} /titanic"
10
10
 
11
11
  # Drop the current db
12
- system 'bundle exec rails db:drop RAILS_ENV=development'
13
- system 'bundle exec rails db:create RAILS_ENV=development'
12
+ system 'RAILS_ENV=development bundle exec rails db:drop'
13
+ system 'RAILS_ENV=development bundle exec rails db:create'
14
14
 
15
15
  project_name = Rails.application.config.session_options[:key].sub(/^_/,'').sub(/_session/,'')
16
16
  config = Rails.configuration.database_configuration
17
17
  database_name = config["development"]["database"]
18
18
 
19
- bz2_files = Dir["/titanic/*.sql.bz2"].each {|file| system "bzip2 -d #{file}" } # Extract any bz2 files
20
- file = Dir["/titanic/*"].first
19
+ bz2_files = Dir["#{Rails.root}/titanic/*.sql.bz2"].each {|file| system "bzip2 -d #{file}" } # Extract any bz2 files
20
+ file = Dir["#{Rails.root}/titanic/*"].first
21
21
 
22
22
  # Import the db
23
23
  system "psql #{database_name} < #{file}"
24
24
 
25
25
  # Finish and cleanup
26
26
  # - delete temp folder and db copy
27
- FileUtils.remove_dir "titanic"
27
+ FileUtils.remove_dir "#{Rails.root}/titanic/"
28
28
 
29
29
  puts "Done! 🛳 "
30
30
  end
@@ -1,3 +1,3 @@
1
1
  module Titanic
2
- VERSION = "0.0.5"
2
+ VERSION = "0.0.6"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: titanic-db
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.5
4
+ version: 0.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Spencer Dixon