souls 0.32.15 → 0.33.0

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
  SHA256:
3
- metadata.gz: 42790d633f21b5a6ef881c214e3ed3a1e231ec7ff3649912633ba9584b5068ce
4
- data.tar.gz: e98bad2e1ccdaf67fdcb501929410176fccbf10a7905f8aab6d18e0f9f673c36
3
+ metadata.gz: f1b47e28c2adf758f84a32496804bb599f505117d939614361a1653a504867ee
4
+ data.tar.gz: 052040ba9f653ab2c7c7c398ed2dd082f6fb3e371738a60792f029c4e261da2b
5
5
  SHA512:
6
- metadata.gz: f4b248cf180be312dfe9e8dcf9a1f0b1e2bdb11d4287aa3fbbb84fa7dd515c66160d42bd7dd73e5c6e914833331e8af7bc110952dc333bd690721d419ebcd1c2
7
- data.tar.gz: 81bdb2f2d87808c3bf17a73fe43e5e07d5e29967fad84b3f54219644441500af9451b39747fdf3fbd4901759d8e846d544eeba33b05b5528e08f581647e7579a
6
+ metadata.gz: bbb253ebe930a4953e8e469bef9766a26adcfcffff85c1535bccbe8f8c38ed4db64125032b9e24c642245b5b19ff6849c716af08de3d4473167a357659a871a5
7
+ data.tar.gz: c7e72bf2018d6b6a985cd913f9d034d1899ea86890901ae20e7751dca801b7b4d401d148b9f99a9de986dc666886bd52ef9501c93ad1767f465f1ed64a5058c2
data/exe/souls CHANGED
@@ -138,7 +138,7 @@ begin
138
138
  Whirly.start(spinner: "clock", interval: 420, stop: "🎉") do
139
139
  Whirly.status = status
140
140
  Souls::Sync.model
141
- Whirly.status = "API and Worker Both Models Synced!"
141
+ Whirly.status = Paint["API and Worker Both Models Synced!", :green]
142
142
  end
143
143
  else
144
144
  puts(Paint["Comannd doesn't exist.Check you command again!...", :red])
@@ -43,27 +43,21 @@ module Souls
43
43
  api_file_data = file_diff(Dir["#{api_dir}/*.rb"])
44
44
  worker_file_data = file_diff(Dir["#{worker_dir}/*.rb"])
45
45
 
46
- api_latest_date = Date.parse(api_file_data.max)
47
- worker_latest_date = Date.parse(worker_file_data.max)
46
+ api_latest_date = Time.parse(api_file_data.max)
47
+ worker_latest_date = Time.parse(worker_file_data.max)
48
48
  end
49
49
 
50
50
  if api_latest_date < worker_latest_date
51
51
  FileUtils.rm_rf(api_dir) if Dir.exist?(api_dir)
52
52
  FileUtils.mkdir(api_dir) unless Dir.exist?(api_dir)
53
- if api_dir.include?("database.yml")
54
- system("cp #{worker_dir} #{api_dir}")
55
- else
56
- system("cp -r #{worker_dir}/* #{api_dir}")
57
- end
53
+ system("cp -r #{worker_dir}/* #{api_dir}")
58
54
  else
59
55
  FileUtils.rm_rf(worker_dir) if Dir.exist?(worker_dir)
60
56
  FileUtils.mkdir(worker_dir) unless Dir.exist?(worker_dir)
61
- if api_dir.include?("database.yml")
62
- system("cp #{api_dir} #{worker_dir}")
63
- else
64
- system("cp -r #{api_dir}/* #{worker_dir}")
65
- end
57
+ system("cp -r #{api_dir}/* #{worker_dir}")
66
58
  end
59
+ rescue StandardError => e
60
+ puts(Paint["`souls api g scaffold $model` at `api` dir first!", :red])
67
61
  end
68
62
 
69
63
  def get_models_path(service_name: "api")
@@ -87,10 +81,6 @@ module Souls
87
81
  {
88
82
  api: "#{api_path}/spec/factories",
89
83
  worker: "#{worker_path}/spec/factories"
90
- },
91
- {
92
- api: "#{api_path}/config/database.yml",
93
- worker: "#{worker_path}/config/database.yml"
94
84
  }
95
85
  ]
96
86
  end
data/lib/souls/init.rb CHANGED
@@ -9,6 +9,29 @@ module Souls
9
9
  data[0]["tag_name"]
10
10
  end
11
11
 
12
+ def self.generate_cd
13
+ shell = `echo $SHELL`.strip
14
+ rc =
15
+ if shell.include?("zsh")
16
+ "zshrc"
17
+ else
18
+ "bash"
19
+ end
20
+ system("echo 'alias api=\'cd apps/api\'' >> ~/.#{rc}")
21
+ system("echo 'alias mother=\'...\'' >> ~/.#{rc}")
22
+ system("echo 'alias worker=\'cd apps/worker\'' >> ~/.#{rc}")
23
+ puts(Paint["run `source ~/.#{rc}` to reflect your .#{rc}", :yellow])
24
+ puts(Paint["You can move to mother/api/worker just type", :green])
25
+ puts(Paint["\nmother\n", :white])
26
+ puts(
27
+ Paint["to go back to mother dir from api/worker\n\nYou can also go to api/worker from mother dir by typing",
28
+ :green]
29
+ )
30
+ puts(Paint["\napi\n", :white])
31
+ puts(Paint["or\n", :green])
32
+ puts(Paint["worker", :white])
33
+ end
34
+
12
35
  def self.initial_config_init(app_name: "souls", service_name: "api")
13
36
  config_dir = "./#{app_name}/apps/#{service_name}/config"
14
37
  FileUtils.mkdir_p(config_dir) unless Dir.exist?(config_dir)
@@ -136,6 +159,7 @@ module Souls
136
159
  system("curl -OL #{url}")
137
160
  system("mkdir -p ./apps/worker")
138
161
  system("tar -zxvf ./#{file_name} -C ./apps/")
162
+ system("cp ./apps/api/config/database.yml ./apps/worker/config/")
139
163
  FileUtils.rm(file_name)
140
164
  line = Paint["====================================", :yellow]
141
165
  puts("\n")
@@ -163,7 +187,7 @@ module Souls
163
187
  Easy to Run
164
188
  $ cd ./apps/worker
165
189
  $ bundle
166
- $ souls model:update
190
+ $ souls sync model
167
191
  $ souls s
168
192
  Go To : http://localhost:3000
169
193
 
data/lib/souls/version.rb CHANGED
@@ -1,4 +1,4 @@
1
1
  module Souls
2
- VERSION = "0.32.15".freeze
2
+ VERSION = "0.33.0".freeze
3
3
  public_constant :VERSION
4
4
  end
@@ -1 +1 @@
1
- 0.11.15
1
+ 0.12.0
@@ -1 +1 @@
1
- 0.11.15
1
+ 0.12.0
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.32.15
4
+ version: 0.33.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - POPPIN-FUMI