souls 0.26.9 → 0.26.10

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
  SHA256:
3
- metadata.gz: abb403a2afdcb6e2de2502a8f22ef0977224dbc17cd2145fd8ae6fd1b690595d
4
- data.tar.gz: bdaa332725d41ec2e2c267544d17805cf278d908524309acc8c52724593a0b0e
3
+ metadata.gz: 6ed9ffbee1c79292d85bde12b686954ecdbcb679f7fdde04324d3152d2cc065d
4
+ data.tar.gz: f9a65837d335c25d873b65d3fe6eb08c9335314ced645c8568b3fce233477a41
5
5
  SHA512:
6
- metadata.gz: bc0bd6eb6dffcafdb444b41bd68d93822c366280af9c2a9da59e8e5d2eb402041b51765d3e346590e8c0999ec6161081b75733d04b83641d88787e8f147f1e4e
7
- data.tar.gz: d55eaa383f6107f409c8c2df0192db434ac6307ba578f36be8d20879ba0ec13b4aee54b14fc020d3a05e3fb6d10fa4ce36324ff5b9c616df67e208c09a702609
6
+ metadata.gz: 58d4c85fbb4ce6c74dec22a3cb7f4975045798eb5d014a185888e91ac0ae5985b0adeb2a27a535230bc047afcffa8c7b217aa43c122eb6a7974b7d3ea47fd771
7
+ data.tar.gz: 9e9b6d5849d53895bc80b37cf446cb501548689f2a43c0040b04556708194b0305d650d95fac2229761f65139d73a2b556e49f6ab74169a60d9ab13d7a831386
data/lib/souls.rb CHANGED
@@ -297,36 +297,50 @@ module Souls
297
297
  end
298
298
 
299
299
  def cp_and_dl_files(api_dir: "", worker_dir: "")
300
- api_file_data = file_diff(Dir["#{api_dir}/*.rb"])
301
- worker_file_data = file_diff(Dir["#{worker_dir}/*.rb"])
300
+ if Dir["#{worker_dir}/*.rb"].blank?
302
301
 
303
- api_latest_date = Date.parse(api_file_data.max)
304
- worker_latest_date = Date.parse(worker_file_data.max)
302
+ api_latest_date = 1
303
+ worker_latest_date = 0
304
+ else
305
+ api_file_data = file_diff(Dir["#{api_dir}/*.rb"])
306
+ worker_file_data = file_diff(Dir["#{worker_dir}/*.rb"])
307
+
308
+ api_latest_date = Date.parse(api_file_data.max)
309
+ worker_latest_date = Date.parse(worker_file_data.max)
310
+ end
305
311
 
306
- if api_latest_date > worker_latest_date
307
- FileUtils.rm_rf(api_dir)
312
+ if api_latest_date < worker_latest_date
313
+ FileUtils.rm_rf(api_dir) if Dir.exist?(api_dir)
308
314
  FileUtils.mkdir(api_dir) unless Dir.exist?(api_dir)
309
315
  system("cp -r #{worker_dir}/* #{api_dir}")
310
316
  else
311
- FileUtils.rm_rf(worker_dir)
317
+ FileUtils.rm_rf(worker_dir) if Dir.exist?(worker_dir)
312
318
  FileUtils.mkdir(worker_dir) unless Dir.exist?(worker_dir)
313
319
  system("cp -r #{api_dir}/* #{worker_dir}")
314
320
  end
315
321
  end
316
322
 
317
323
  def get_models_path(service_name: "api")
324
+ case service_name
325
+ when "api"
326
+ api_path = "."
327
+ worker_path = "../worker"
328
+ when "worker"
329
+ api_path = "../api"
330
+ worker_path = "."
331
+ end
318
332
  [
319
333
  {
320
- api: "../#{service_name}/db",
321
- worker: "./db"
334
+ api: "#{api_path}/db",
335
+ worker: "#{worker_path}/db"
322
336
  },
323
337
  {
324
- api: "../#{service_name}/app/models",
325
- worker: "./app/models"
338
+ api: "#{api_path}/app/models",
339
+ worker: "#{worker_path}/app/models"
326
340
  },
327
341
  {
328
- api: "../#{service_name}/spec/factories",
329
- worker: "./spec/factories"
342
+ api: "#{api_path}/spec/factories",
343
+ worker: "#{worker_path}/spec/factories"
330
344
  }
331
345
  ]
332
346
  end
data/lib/souls/version.rb CHANGED
@@ -1,4 +1,4 @@
1
1
  module Souls
2
- VERSION = "0.26.9".freeze
2
+ VERSION = "0.26.10".freeze
3
3
  public_constant :VERSION
4
4
  end
@@ -1 +1 @@
1
- 0.5.9
1
+ 0.5.10
@@ -1 +1 @@
1
- 0.5.9
1
+ 0.5.10
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: souls
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.26.9
4
+ version: 0.26.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - POPPIN-FUMI