souls 0.25.19 → 0.26.1

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: b95e788773391bebd59bf7faf921e9d647bb39f564430b45e239e79c2b0ccfed
4
- data.tar.gz: 22d8445babf829feb19c61209033f5e9b32196f827468f0ad2f9c40aa75305d9
3
+ metadata.gz: 8dfb7d78b585890c670003133a6e687a7a39b4f70e906144c79c27e576d36936
4
+ data.tar.gz: 0b13c30a496b1c02d060eb845c03e41de79c7ea7ed8d615f53a62295d0cc0ce7
5
5
  SHA512:
6
- metadata.gz: 19d6e7e610f56fe92c41c12f2b2175fd92877d2d398a2f246e3a26c18f8cb4d53abb462e4644bf21527c92e9b89e26f16e88e66e68cb682a65c11eecc49b2bc8
7
- data.tar.gz: eca89781a54e42932c3835f56b9c70c3ea1cc3f282b9c4c32c0effeb8ce354e313ce1cafb64ceb90e9191f78c9e92ffe18a5ce6bc9b9503cee257d87bf06bc0b
6
+ metadata.gz: e261f29bba6a2e959f5690eee223cc8119e912a0c8b866348dea1ed6664973c910b124698b1c0ef7d4663860e42c9f36f5ddddaf7a54fd655e39b70192105395
7
+ data.tar.gz: baa9ce69af7d71d150be6a703a913f870da5a05c5f553bcca48728e3f487c92b16d3083e44142ae108652376f8bc7ab7e7fb545f1c019cf26b110f55e418ba8b
data/exe/souls CHANGED
@@ -9,25 +9,8 @@ begin
9
9
  souls_command = ARGV[0]
10
10
  case souls_command
11
11
  when "new"
12
- STRAINS = %w[api worker console admin media doc].freeze
13
- app_name = ARGV[1]
14
- if app_name.nil?
15
- puts(Paint["you need to specify your app name", :red])
16
- puts(Paint["`souls new app_name`", :yellow])
17
- exit
18
- end
19
-
20
- prompt = TTY::Prompt.new
21
- choices = ["1. SOULs GraphQL API", "2. SOULs Pub/Sub Worker", "3. SOULs Frontend Web"]
22
- choice_num = prompt.select(Paint["Select Strain: ", :cyan], choices)[0].to_i
23
- case choice_num
24
- when 1, 2
25
- service_name = (STRAINS[choice_num.to_i - 1]).to_s
26
- Souls::Init.download_souls(app_name: app_name, service_name: service_name)
27
- Souls::Init.initial_config_init(app_name: app_name, service_name: service_name)
28
- else
29
- puts(Paint["Coming Soon...", :blue])
30
- end
12
+ args = ARGV
13
+ Souls::Init.return_method(args)
31
14
  when "s", "server"
32
15
  strain = Souls.configuration.strain
33
16
  case strain
@@ -123,7 +106,7 @@ begin
123
106
  when "g", "generate"
124
107
  args = ARGV
125
108
  status = Paint["Generating Files...", :yellow]
126
- done = Paint["Generated SOULs CRUD Files☻", :yellow]
109
+ done = Paint["You're All Set ☻", :yellow]
127
110
  Whirly.start(spinner: "clock", interval: 420, stop: "🎉") do
128
111
  Whirly.status = status
129
112
  Souls::Generate.return_method(args)
@@ -53,6 +53,8 @@ module Souls
53
53
  when "update"
54
54
  Souls::Generate.update_delete(class_name: class_name)
55
55
  Souls::Generate.migrate(class_name: class_name)
56
+ when "worker"
57
+ Souls::Init.download_worker
56
58
  else
57
59
  "SOULs!"
58
60
  end
data/lib/souls/init.rb CHANGED
@@ -10,13 +10,15 @@ module Souls
10
10
  end
11
11
 
12
12
  def self.initial_config_init(app_name: "souls", service_name: "api")
13
- FileUtils.touch("./#{app_name}/#{service_name}/config/souls.rb")
14
- file_path = "./#{app_name}/#{service_name}/config/souls.rb"
13
+ config_dir = "./#{app_name}/apps/#{service_name}/config"
14
+ FileUtils.mkdir_p(config_dir) unless Dir.exist?(config_dir)
15
+ FileUtils.touch("#{config_dir}/souls.rb")
16
+ file_path = "#{config_dir}/souls.rb"
15
17
  File.open(file_path, "w") do |f|
16
18
  f.write(<<~TEXT)
17
19
  Souls.configure do |config|
18
20
  config.app = "#{app_name}"
19
- config.project_id = "souls-api"
21
+ config.project_id = "souls-app"
20
22
  config.strain = "#{service_name}"
21
23
  config.worker_endpoint = "https://worker.com"
22
24
  config.fixed_gems = ["excluded_gem"]
@@ -27,13 +29,69 @@ module Souls
27
29
  puts(e)
28
30
  end
29
31
 
32
+ def self.download_github_actions
33
+ file_name = "github.tgz"
34
+ url = "https://storage.googleapis.com/souls-bucket/github_actions/github.tgz"
35
+ system("curl -OL #{url}")
36
+ FileUtils.mkdir("github")
37
+ system("tar -zxvf ./#{file_name} -C #{file_name}/")
38
+ FileUtils.rm(file_name)
39
+ end
40
+
41
+ def self.mother_config_init(app_name: "souls-app")
42
+ config_dir = "./#{app_name}/config"
43
+ FileUtils.mkdir_p(config_dir) unless Dir.exist?(config_dir)
44
+ FileUtils.touch("#{config_dir}/souls.rb")
45
+ file_path = "#{config_dir}/souls.rb"
46
+ File.open(file_path, "w") do |f|
47
+ f.write(<<~TEXT)
48
+ Souls.configure do |config|
49
+ config.app = "#{app_name}"
50
+ config.project_id = "souls-app"
51
+ config.strain = "mother"
52
+ config.api = true
53
+ config.worker = false
54
+ config.frontend = false
55
+ config.worker_endpoint = ""
56
+ config.fixed_gems = ["excluded_gem"]
57
+ end
58
+ TEXT
59
+ end
60
+ rescue StandardError => e
61
+ puts(e)
62
+ end
63
+
64
+ def self.return_method(args)
65
+ strains = %w[api worker console admin media doc].freeze
66
+ app_name = args[1]
67
+ if app_name.nil?
68
+ puts(Paint["you need to specify your app name", :red])
69
+ puts(Paint["`souls new souls-app`", :yellow])
70
+ exit
71
+ end
72
+
73
+ prompt = TTY::Prompt.new
74
+ choices = ["1. SOULs GraphQL API", "2. SOULs Pub/Sub Worker", "3. SOULs Frontend Web"]
75
+ choice_num = prompt.select(Paint["Select Strain: ", :cyan], choices)[0].to_i
76
+ case choice_num
77
+ when 1, 2
78
+ service_name = (strains[choice_num.to_i - 1]).to_s
79
+ Souls::Init.download_souls(app_name: app_name, service_name: service_name)
80
+ Souls::Init.mother_config_init(app_name: app_name)
81
+ Souls::Init.download_github_actions
82
+ Souls::Init.initial_config_init(app_name: app_name, service_name: service_name)
83
+ else
84
+ puts(Paint["Coming Soon...", :blue])
85
+ end
86
+ end
87
+
30
88
  def self.download_souls(app_name: "souls", service_name: "api")
31
89
  version = Souls.get_latest_version_txt(service_name: service_name).join(".")
32
90
  file_name = "#{service_name}-v#{version}.tgz"
33
91
  url = "https://storage.googleapis.com/souls-bucket/boilerplates/#{service_name.pluralize}/#{file_name}"
34
92
  system("curl -OL #{url}")
35
- system("mkdir -p #{app_name}/#{service_name}")
36
- system("tar -zxvf ./#{file_name} -C #{app_name}/")
93
+ system("mkdir -p #{app_name}/apps/#{service_name}")
94
+ system("tar -zxvf ./#{file_name} -C #{app_name}/apps/")
37
95
  FileUtils.rm(file_name)
38
96
  line = Paint["====================================", :yellow]
39
97
  puts("\n")
@@ -59,8 +117,54 @@ module Souls
59
117
  puts(line)
60
118
  endroll = <<~TEXT
61
119
  Easy to Run
62
- $ cd #{app_name}/#{service_name}
120
+ $ cd #{app_name}/apps/#{service_name}
121
+ $ bundle
122
+ $ souls s
123
+ Go To : http://localhost:4000
124
+
125
+ Doc: https://souls.elsoul.nl
126
+ TEXT
127
+ cd = Paint[endroll, :white]
128
+ puts(cd)
129
+ puts(line)
130
+ end
131
+
132
+ def self.download_worker
133
+ current_dir_name = FileUtils.pwd.to_s.match(%r{/([^/]+)/?$})[1]
134
+ version = Souls.get_latest_version_txt(service_name: "worker").join(".")
135
+ file_name = "worker-v#{version}.tgz"
136
+ url = "https://storage.googleapis.com/souls-bucket/boilerplates/workers/#{file_name}"
137
+ system("curl -OL #{url}")
138
+ system("mkdir -p ./apps/worker")
139
+ system("tar -zxvf ./#{file_name} -C ./apps/")
140
+ FileUtils.rm(file_name)
141
+ line = Paint["====================================", :yellow]
142
+ puts("\n")
143
+ puts(line)
144
+ txt2 = <<~TEXT
145
+ _____ ____ __ ____#{' '}
146
+ / ___// __ \\/ / / / / %{red1}
147
+ \\__ \\/ / / / / / / / %{red2}
148
+ ___/ / /_/ / /_/ / /___%{red3}#{' '}
149
+ /____/\\____/\\____/_____%{red4}#{' '}
150
+ TEXT
151
+ red1 = ["_____", :red]
152
+ red2 = ["/ ___/", :red]
153
+ red3 = ["(__ )", :red]
154
+ red4 = ["/____/", :red]
155
+ ms = Paint % [txt2, :cyan, { red1: red1, red2: red2, red3: red3, red4: red4 }]
156
+ puts(ms)
157
+ puts(line)
158
+ welcome = Paint["SOULs Worker Activated!", :white]
159
+ puts(welcome)
160
+ souls_ver = Paint["SOULs Version: #{Souls::VERSION}", :white]
161
+ puts(souls_ver)
162
+ puts(line)
163
+ endroll = <<~TEXT
164
+ Easy to Run
165
+ $ cd ./apps/worker
63
166
  $ bundle
167
+ $ souls model:update
64
168
  $ souls s
65
169
  Go To : http://localhost:3000
66
170
 
data/lib/souls/version.rb CHANGED
@@ -1,4 +1,4 @@
1
1
  module Souls
2
- VERSION = "0.25.19".freeze
2
+ VERSION = "0.26.1".freeze
3
3
  public_constant :VERSION
4
4
  end
@@ -1 +1 @@
1
- 0.4.22
1
+ 0.5.1
@@ -1 +1 @@
1
- 0.4.22
1
+ 0.5.1
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.25.19
4
+ version: 0.26.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - POPPIN-FUMI
@@ -10,8 +10,36 @@ authors:
10
10
  autorequire:
11
11
  bindir: exe
12
12
  cert_chain: []
13
- date: 2021-08-02 00:00:00.000000000 Z
13
+ date: 2021-08-03 00:00:00.000000000 Z
14
14
  dependencies:
15
+ - !ruby/object:Gem::Dependency
16
+ name: activesupport
17
+ requirement: !ruby/object:Gem::Requirement
18
+ requirements:
19
+ - - '='
20
+ - !ruby/object:Gem::Version
21
+ version: 6.1.4
22
+ type: :runtime
23
+ prerelease: false
24
+ version_requirements: !ruby/object:Gem::Requirement
25
+ requirements:
26
+ - - '='
27
+ - !ruby/object:Gem::Version
28
+ version: 6.1.4
29
+ - !ruby/object:Gem::Dependency
30
+ name: dotenv
31
+ requirement: !ruby/object:Gem::Requirement
32
+ requirements:
33
+ - - '='
34
+ - !ruby/object:Gem::Version
35
+ version: 2.7.6
36
+ type: :runtime
37
+ prerelease: false
38
+ version_requirements: !ruby/object:Gem::Requirement
39
+ requirements:
40
+ - - '='
41
+ - !ruby/object:Gem::Version
42
+ version: 2.7.6
15
43
  - !ruby/object:Gem::Dependency
16
44
  name: paint
17
45
  requirement: !ruby/object:Gem::Requirement