souls 0.18.1 → 0.18.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/config/souls.rb +1 -1
- data/exe/souls +2 -2
- data/lib/souls.rb +2 -1
- data/lib/souls/init.rb +28 -7
- data/lib/souls/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a322a1b2aa38e8c02422ae7c8d7987c057d9c4f9f4067e6bacd13452396dd249
|
4
|
+
data.tar.gz: 289abfe312f2aec1e2b6647d519c941a63dabe6a3ece1f1b2a3e5f97d4d53eb2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d2e8645c69414f7dc89b6ff8599b304515199884e59140e3029e4df3d3c73ed8ddd76455b326b51137d4cb949919827297d2b4ce2799cf7c792b2f53f9c04b8f
|
7
|
+
data.tar.gz: 23d6e1ce47025aa568196876d388cfc9d33acb19d2eda0ecaff48f9fe3ee2cb075c9cb61582aafc79a5c51c05a97f4fcf34b43de189249bbf7ee96ee6e011f2b
|
data/Gemfile.lock
CHANGED
data/config/souls.rb
CHANGED
data/exe/souls
CHANGED
@@ -1,6 +1,5 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
2
|
require "souls"
|
3
|
-
STRAINS = ["graph", "worker", "media", "admin"]
|
4
3
|
begin
|
5
4
|
require "./config/souls" unless ARGV[0] == "new" || ARGV[0] == "i"
|
6
5
|
rescue
|
@@ -9,6 +8,7 @@ end
|
|
9
8
|
begin
|
10
9
|
case ARGV[0]
|
11
10
|
when "new"
|
11
|
+
STRAINS = ["api", "worker", "media", "admin"]
|
12
12
|
if ARGV[1].nil?
|
13
13
|
puts "you need to specify your app name \n `souls new app_name`"
|
14
14
|
exit
|
@@ -17,7 +17,7 @@ begin
|
|
17
17
|
strain = STDIN.gets.chomp.to_i
|
18
18
|
(1..4).include?(strain) ? puts("Generating SOULs.. \n") : raise(StandardError, "Choose Number 1..4")
|
19
19
|
Souls::Init.download_souls app_name: ARGV[1], repository_name: "souls_#{STRAINS[strain.to_i - 1]}"
|
20
|
-
Souls::Init.initial_config_init app_name:
|
20
|
+
Souls::Init.initial_config_init app_name: ARGV[1], strain: STRAINS[strain.to_i - 1]
|
21
21
|
when "s", "server"
|
22
22
|
strain = Souls.configuration.strain
|
23
23
|
case strain
|
data/lib/souls.rb
CHANGED
data/lib/souls/init.rb
CHANGED
@@ -1,33 +1,54 @@
|
|
1
1
|
module Souls
|
2
2
|
module Init
|
3
3
|
class << self
|
4
|
-
def get_version repository_name: "
|
4
|
+
def get_version repository_name: "souls_api"
|
5
5
|
data = JSON.parse `curl \
|
6
6
|
-H "Accept: application/vnd.github.v3+json" \
|
7
7
|
-s https://api.github.com/repos/elsoul/#{repository_name}/releases`
|
8
8
|
data[0]["tag_name"]
|
9
9
|
end
|
10
10
|
|
11
|
-
def initial_config_init app_name: "souls",
|
12
|
-
|
13
|
-
file_path = "
|
11
|
+
def initial_config_init app_name: "souls", strain: "api"
|
12
|
+
FileUtils.touch "./#{app_name}/config/souls.rb"
|
13
|
+
file_path = "./#{app_name}/config/souls.rb"
|
14
14
|
File.open(file_path, "w") do |f|
|
15
15
|
f.write <<~EOS
|
16
16
|
Souls.configure do |config|
|
17
17
|
config.app = "#{app_name}"
|
18
|
-
config.strain = "#{
|
18
|
+
config.strain = "#{strain}"
|
19
19
|
end
|
20
20
|
EOS
|
21
21
|
end
|
22
|
+
rescue StandardError => error
|
23
|
+
puts error
|
22
24
|
end
|
23
25
|
|
24
|
-
def
|
26
|
+
def config_init app_name: "souls", strain: "api"
|
27
|
+
file_dir = "#{__dir__}/config"
|
28
|
+
FileUtils.mkdir_p file_dir unless Dir.exist? file_dir
|
29
|
+
FileUtils.touch "#{__dir__}/config/souls.rb"
|
30
|
+
file_path = "#{__dir__}/config/souls.rb"
|
31
|
+
puts "Generating souls conf..."
|
32
|
+
sleep(rand(0.1..0.3))
|
33
|
+
puts "Generated!"
|
34
|
+
puts "Let's Edit SOULs Conf: `#{file_path}`"
|
35
|
+
File.open(file_path, "w") do |f|
|
36
|
+
f.write <<~EOS
|
37
|
+
Souls.configure do |config|
|
38
|
+
config.app = "#{app_name}"
|
39
|
+
config.strain = "#{strain}"
|
40
|
+
end
|
41
|
+
EOS
|
42
|
+
end
|
43
|
+
end
|
44
|
+
|
45
|
+
def download_souls app_name: "souls", repository_name: "souls_api "
|
25
46
|
version = get_version repository_name: repository_name
|
26
47
|
system "curl -OL https://github.com/elsoul/#{repository_name}/archive/#{version}.tar.gz"
|
27
48
|
system "tar -zxvf ./#{version}.tar.gz"
|
28
49
|
system "mkdir #{app_name}"
|
29
50
|
folder = version.delete "v"
|
30
|
-
system "cp -r #{repository_name}-#{folder}
|
51
|
+
system "cp -r #{repository_name}-#{folder}/. #{app_name}/"
|
31
52
|
system "rm -rf #{version}.tar.gz && rm -rf #{repository_name}-#{folder}"
|
32
53
|
txt = <<~TEXT
|
33
54
|
_____ ____ __ ____#{' '}
|
data/lib/souls/version.rb
CHANGED
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.18.
|
4
|
+
version: 0.18.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- POPPIN-FUMI
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: exe
|
12
12
|
cert_chain: []
|
13
|
-
date: 2021-04-
|
13
|
+
date: 2021-04-08 00:00:00.000000000 Z
|
14
14
|
dependencies: []
|
15
15
|
description: SOULS is a Web Application Framework for Microservices on Multi Cloud
|
16
16
|
Platform such as Google Cloud Platform, Amazon Web Services, and Alibaba Cloud.
|