load_remote_db 0.1.7 → 0.1.8

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: c6bfa7b6d48699b1a31e4db35f61f3a23ba6b485
4
- data.tar.gz: 54e3f77aa879537b9069a7031466cfc01bf4bf4a
3
+ metadata.gz: 76cb1980c871da64c2a8c9bf320b20fb06168269
4
+ data.tar.gz: b4f234ea9d192f44347b72eefa33766caf63a263
5
5
  SHA512:
6
- metadata.gz: 36ffcc8498ac97803e6d33f956f76fe3eba1d3bc6bf77f6e702d3e376c7a0d9bfb23a30ba3fc78208fcac79855e0de3b2afed3695668c24c50e679301578b5f6
7
- data.tar.gz: fa129dfe61838af340ea31ac736b0d2a04dd85911490f2852ecdb70c965ca53b6b054f67b66bc6d7447c37341849a17d98390cf1d4eb6334dca7cf813bdde990
6
+ metadata.gz: 10326c8102959b20327ccf657c3d145b78d13d6da15fa02638cd94a9ef6d22ec9307069178ffcc28ad36dbb83f09f5313ac396a66e9b328a19293a73c52214d8
7
+ data.tar.gz: c074b0dc0ee7703d4e4aa3f4527990b8747e6cab6f59455bc17fb457dcba12387bf839aa802f906368c56081ec9a97fabc5904f6b4b86ad58c478cffb6d14198
data/README.md CHANGED
@@ -35,7 +35,7 @@ Simply execute the command:
35
35
  For instance
36
36
 
37
37
  $ bundle exec rake db:load_from_remote SERVER=staging
38
- $ bundle exec rake db:load_from_remote SERVER=staging SYNC_FOLDER=public/system
38
+ $ bundle exec rake db:load_from_remote SERVER=staging SYNC_FOLDER=public/system/
39
39
  $ bundle exec rake db:load_from_remote SERVER=staging DOWNLOAD_ONLY=true
40
40
 
41
41
 
@@ -1,3 +1,3 @@
1
1
  module LoadRemoteDb
2
- VERSION = '0.1.7'.freeze
2
+ VERSION = '0.1.8'.freeze
3
3
  end
@@ -24,6 +24,7 @@ class RemoteDbLoader
24
24
  password = development_db['password']
25
25
  database = development_db['database']
26
26
 
27
+ eval File.read("#{Rails.root}/config/deploy.rb")
27
28
  eval File.read("#{Rails.root}/config/deploy/#{env}.rb")
28
29
 
29
30
  ## get remote database config.yml
@@ -34,6 +35,7 @@ class RemoteDbLoader
34
35
 
35
36
  shared_path = "#{@deploy_to}/shared"
36
37
 
38
+ puts get_db_info_command
37
39
  remote_db_config = eval `#{get_db_info_command}`
38
40
  remote_db_username = remote_db_config["username"] || 'root'
39
41
  remote_db_password = remote_db_config["password"]
@@ -115,6 +117,9 @@ class RemoteDbLoader
115
117
  end
116
118
 
117
119
  def method_missing(name, *args, &block)
120
+ return @server_user if name == :fetch && args[0] == :deploy_user
121
+ return @application if name == :fetch && args[0] == :application
122
+
118
123
  return self unless %I[server set].include?(name)
119
124
  @server_ip ||= if name == :server
120
125
  args[0]
@@ -122,6 +127,10 @@ class RemoteDbLoader
122
127
  args[1]
123
128
  end
124
129
  @server_user ||= args[1] if name == :set && args[0] == :user
125
- @deploy_to ||= args[1] if name == :set && args[0] == :deploy_to
130
+ @application ||= args[1] if name == :set && args[0] == :application
131
+ @server_user ||= args[1] if name == :set && args[0] == :deploy_user
132
+ if name == :set && args[0] == :deploy_to
133
+ @deploy_to ||= args[1]
134
+ end
126
135
  end
127
136
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: load_remote_db
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.7
4
+ version: 0.1.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - James Huynh
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-08-08 00:00:00.000000000 Z
11
+ date: 2017-10-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler