souls 0.32.17 → 0.33.2
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 +4 -4
- data/exe/souls +1 -1
- data/lib/souls/cli/sync/model.rb +5 -5
- data/lib/souls/init.rb +23 -0
- data/lib/souls/version.rb +1 -1
- data/lib/souls/versions/.souls_api_version +1 -1
- data/lib/souls/versions/.souls_worker_version +1 -1
- data/lib/souls/worker/generate/index.rb +1 -0
- data/lib/souls/worker/generate/mutation.rb +34 -0
- metadata +2 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5f818f0b464a82d75375ca277ba34206f5e5339385b94c467c3b952902e50770
|
4
|
+
data.tar.gz: 55cc16c9dfc20aee218a9b1ed6ac647c7e41a7b793c63f2780ce6d04cecbf0ae
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: '0802ec2ea9219e9f11412d9a4c92fab058502722245749749a2c70db51d751c2b840b27eb62b9e55ebec1f4e6d58b1c1b3810282d8a83d8a30628d0dd567ad3d'
|
7
|
+
data.tar.gz: fb43c2d1c99db7f60aa76d8b3a9c16a7878f7023a511a36153c3959360ca696ce2e23e92e37a7fb93a352eb3f0588c3a53032ef28b880edd64f9cb679b852887
|
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])
|
data/lib/souls/cli/sync/model.rb
CHANGED
@@ -43,21 +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 =
|
47
|
-
worker_latest_date =
|
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
|
-
FileUtils.
|
52
|
+
FileUtils.mkdir(api_dir) unless Dir.exist?(api_dir)
|
53
53
|
system("cp -r #{worker_dir}/* #{api_dir}")
|
54
54
|
else
|
55
55
|
FileUtils.rm_rf(worker_dir) if Dir.exist?(worker_dir)
|
56
|
-
FileUtils.
|
56
|
+
FileUtils.mkdir(worker_dir) unless Dir.exist?(worker_dir)
|
57
57
|
system("cp -r #{api_dir}/* #{worker_dir}")
|
58
58
|
end
|
59
59
|
rescue StandardError => e
|
60
|
-
puts(
|
60
|
+
puts(Paint["`souls api g scaffold $model` at `api` dir first!", :red])
|
61
61
|
end
|
62
62
|
|
63
63
|
def get_models_path(service_name: "api")
|
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)
|
data/lib/souls/version.rb
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.
|
1
|
+
0.12.2
|
@@ -1 +1 @@
|
|
1
|
-
0.
|
1
|
+
0.12.2
|
@@ -0,0 +1,34 @@
|
|
1
|
+
module Souls
|
2
|
+
module Worker
|
3
|
+
module Generate
|
4
|
+
class << self
|
5
|
+
def mutation(class_name: "csv_export")
|
6
|
+
file_dir = "./app/graphql/mutations/"
|
7
|
+
FileUtils.mkdir_p(file_dir) unless Dir.exist?(file_dir)
|
8
|
+
file_path = "#{file_dir}#{class_name.singularize}_job.rb"
|
9
|
+
raise(StandardError, "Mailer already exist! #{file_path}") if File.exist?(file_path)
|
10
|
+
|
11
|
+
File.open(file_path, "w") do |f|
|
12
|
+
f.write(<<~TEXT)
|
13
|
+
module Mutations
|
14
|
+
class #{class_name.camelize}Job < BaseMutation
|
15
|
+
description "Job Description"
|
16
|
+
field :response, String, null: false
|
17
|
+
|
18
|
+
def resolve
|
19
|
+
# Define Job Here
|
20
|
+
|
21
|
+
{ response: "Job queued!" }
|
22
|
+
rescue StandardError => e
|
23
|
+
GraphQL::ExecutionError.new(e.to_s)
|
24
|
+
end
|
25
|
+
end
|
26
|
+
TEXT
|
27
|
+
end
|
28
|
+
puts(Paint % ["Created file! : %{white_text}", :green, { white_text: [file_path.to_s, :white] }])
|
29
|
+
file_path
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
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.
|
4
|
+
version: 0.33.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- POPPIN-FUMI
|
@@ -148,6 +148,7 @@ files:
|
|
148
148
|
- lib/souls/worker/generate.rb
|
149
149
|
- lib/souls/worker/generate/index.rb
|
150
150
|
- lib/souls/worker/generate/mailer.rb
|
151
|
+
- lib/souls/worker/generate/mutation.rb
|
151
152
|
- lib/souls/worker/index.rb
|
152
153
|
homepage: https://souls.elsoul.nl
|
153
154
|
licenses:
|