souls 0.50.0 → 0.52.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.
Files changed (62) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +5 -1
  3. data/exe/souls +4 -202
  4. data/lib/souls/api/generate/application.rb +97 -94
  5. data/lib/souls/api/generate/connection.rb +5 -4
  6. data/lib/souls/api/generate/edge.rb +5 -4
  7. data/lib/souls/api/generate/index.rb +0 -1
  8. data/lib/souls/api/generate/manager.rb +9 -7
  9. data/lib/souls/api/generate/model.rb +16 -18
  10. data/lib/souls/api/generate/mutation.rb +217 -218
  11. data/lib/souls/api/generate/policy.rb +5 -5
  12. data/lib/souls/api/generate/query.rb +51 -51
  13. data/lib/souls/api/generate/resolver.rb +115 -115
  14. data/lib/souls/api/generate/rspec_factory.rb +53 -53
  15. data/lib/souls/api/generate/rspec_model.rb +5 -5
  16. data/lib/souls/api/generate/rspec_mutation.rb +178 -178
  17. data/lib/souls/api/generate/rspec_policy.rb +5 -5
  18. data/lib/souls/api/generate/rspec_query.rb +111 -111
  19. data/lib/souls/api/generate/rspec_resolver.rb +163 -163
  20. data/lib/souls/api/generate/type.rb +66 -66
  21. data/lib/souls/api/index.rb +7 -4
  22. data/lib/souls/api/update/index.rb +15 -0
  23. data/lib/souls/api/update/mutation.rb +68 -64
  24. data/lib/souls/api/update/resolver.rb +59 -60
  25. data/lib/souls/api/update/rspec_factory.rb +40 -39
  26. data/lib/souls/api/update/rspec_mutation.rb +84 -83
  27. data/lib/souls/api/update/rspec_resolver.rb +70 -69
  28. data/lib/souls/api/update/type.rb +39 -38
  29. data/lib/souls/cli/console/index.rb +13 -1
  30. data/lib/souls/cli/create/index.rb +100 -95
  31. data/lib/souls/cli/db/index.rb +122 -1
  32. data/lib/souls/cli/docker/index.rb +30 -38
  33. data/lib/souls/cli/gcloud/compute/index.rb +100 -93
  34. data/lib/souls/cli/gcloud/iam/index.rb +84 -69
  35. data/lib/souls/cli/gcloud/index.rb +36 -35
  36. data/lib/souls/cli/gcloud/pubsub/subscriptions.rb +40 -27
  37. data/lib/souls/cli/gcloud/pubsub/topics.rb +16 -10
  38. data/lib/souls/cli/gcloud/run/index.rb +23 -17
  39. data/lib/souls/cli/gcloud/sql/index.rb +66 -45
  40. data/lib/souls/cli/index.rb +3 -20
  41. data/lib/souls/cli/init/index.rb +140 -138
  42. data/lib/souls/cli/release/release.rb +106 -105
  43. data/lib/souls/cli/server/index.rb +12 -1
  44. data/lib/souls/cli/sync/conf.rb +39 -38
  45. data/lib/souls/cli/sync/model.rb +19 -20
  46. data/lib/souls/cli/sync/pubsub.rb +69 -70
  47. data/lib/souls/cli/upgrade/gemfile.rb +108 -0
  48. data/lib/souls/cli/upgrade/index.rb +1 -1
  49. data/lib/souls/cli.rb +57 -0
  50. data/lib/souls/index.rb +1 -5
  51. data/lib/souls/version.rb +1 -1
  52. data/lib/souls/versions/.souls_api_version +1 -1
  53. data/lib/souls/versions/.souls_worker_version +1 -1
  54. data/lib/souls/worker/generate/index.rb +1 -1
  55. data/lib/souls/worker/generate/job.rb +45 -0
  56. data/lib/souls/worker/generate/mailer.rb +38 -43
  57. data/lib/souls/worker/index.rb +3 -1
  58. data/lib/souls.rb +2 -0
  59. metadata +19 -5
  60. data/lib/souls/api/generate/migration.rb +0 -51
  61. data/lib/souls/cli/upgrade/gem_update.rb +0 -107
  62. data/lib/souls/worker/generate/mutation.rb +0 -44
@@ -1,37 +1,50 @@
1
1
  module Souls
2
- module Gcloud
3
- module Pubsub
4
- class << self
5
- def create_subscription(
6
- topic_name: "send-user-mail",
7
- project_id: "",
8
- service_account: "",
9
- endpoint: "https:://test.com"
10
- )
11
- project_id = Souls.configuration.project_id if project_id.blank?
12
- service_account = "#{Souls.configuration.app}@#{project_id}.iam.gserviceaccount.com" if service_account.blank?
13
- system(
14
- "gcloud pubsub subscriptions create #{topic_name}-sub \
15
- --topic #{topic_name} \
2
+ class Pubsub < Thor
3
+ desc "create_subscription", "Create Google Cloud PubSub Subscription"
4
+ method_option :topic_name,
5
+ default: "send-user-mailer",
6
+ aliases: "--topic_name",
7
+ desc: "Google Cloud Pubsub Topic Name"
8
+ method_option :endpoint,
9
+ default: "https:://test.com",
10
+ aliases: "--endpoint",
11
+ desc: "Google Cloud Pubsub Push Subscription Endpoint"
12
+ def create_subscription
13
+ project_id = Souls.configuration.project_id
14
+ service_account = "#{Souls.configuration.app}@#{project_id}.iam.gserviceaccount.com"
15
+ system(
16
+ "gcloud pubsub subscriptions create #{options[:topic_name]}-sub \
17
+ --topic #{options[:topic_name]} \
16
18
  --topic-project #{project_id} \
17
19
  --push-auth-service-account #{service_account} \
18
- --push-endpoint #{endpoint} \
20
+ --push-endpoint #{options[:endpoint]} \
19
21
  --expiration-period never
20
22
  "
21
- )
22
- end
23
+ )
24
+ rescue Thor::Error => e
25
+ raise(Thor::Error, e)
26
+ end
23
27
 
24
- def subscription_list
25
- system("gcloud pubsub subscriptions list")
26
- end
28
+ desc "subscription_list", "Show Google Cloud Pubsub Subscription List"
29
+ def subscription_list
30
+ system("gcloud pubsub subscriptions list")
31
+ rescue Thor::Error => e
32
+ raise(Thor::Error, e)
33
+ end
27
34
 
28
- def update_subscription(
29
- topic_name: "send-user-mail",
30
- endpoint: "https:://test.com"
31
- )
32
- system("gcloud pubsub subscriptions update #{topic_name}-sub --push-endpoint #{endpoint} ")
33
- end
34
- end
35
+ desc "update_subscription", "Update Google Cloud Pubsub Subscription Endpoint"
36
+ method_option :topic_name,
37
+ default: "send-user-mailer",
38
+ aliases: "--topic_name",
39
+ desc: "Google Cloud Pubsub Topic Name"
40
+ method_option :endpoint,
41
+ default: "https:://test.com",
42
+ aliases: "--endpoint",
43
+ desc: "Google Cloud Pubsub Push Subscription Endpoint"
44
+ def update_subscription
45
+ system("gcloud pubsub subscriptions update #{options[:topic_name]}-sub --push-endpoint #{options[:endpoint]} ")
46
+ rescue Thor::Error => e
47
+ raise(Thor::Error, e)
35
48
  end
36
49
  end
37
50
  end
@@ -1,15 +1,21 @@
1
1
  module Souls
2
- module Gcloud
3
- module Pubsub
4
- class << self
5
- def create_topic(topic_name: "send-user-mail")
6
- system("gcloud pubsub topics create #{topic_name}")
7
- end
2
+ class Pubsub < Thor
3
+ desc "create_topic", "Create Google Cloud Pubsub Topic"
4
+ method_option :topic_name,
5
+ default: "send-user-mailer",
6
+ aliases: "--topic_name",
7
+ desc: "Google Cloud Pubsub Topic Name"
8
+ def create_topic
9
+ system("gcloud pubsub topics create #{options[:topic_name]}")
10
+ rescue Thor::Error => e
11
+ raise(Thor::Error, e)
12
+ end
8
13
 
9
- def topic_list
10
- system("gcloud pubsub topics list")
11
- end
12
- end
14
+ desc "topic_list", "Show Google Cloud Topic List"
15
+ def topic_list
16
+ system("gcloud pubsub topics list")
17
+ rescue Thor::Error => e
18
+ raise(Thor::Error, e)
13
19
  end
14
20
  end
15
21
  end
@@ -1,24 +1,30 @@
1
1
  module Souls
2
- module Gcloud
3
- module Run
4
- class << self
5
- def awake(app_name: "", url: "")
6
- app_name = Souls.configuration.app if app_name.blank?
7
- system(
8
- "gcloud scheduler jobs create http #{app_name}-awake
2
+ class CloudRun < Thor
3
+ desc "awake", "Set Ping Every 15min by Google Cloud Scheduler"
4
+ method_option :url, default: "https://souls.souls.nl", aliases: "--url", desc: "Set URL"
5
+ def awake
6
+ app_name = Souls.configuration.app
7
+ system(
8
+ "gcloud scheduler jobs create http #{app_name}-awake
9
9
  --schedule '0,10,20,30,40,50 * * * *' --uri #{url} --http-method GET"
10
- )
11
- end
10
+ )
11
+ rescue Thor::Error => e
12
+ raise(Thor::Error, e)
13
+ end
12
14
 
13
- def list(project_id: "")
14
- project_id = Souls.configuration.project_id if project_id.blank?
15
- system("gcloud run services list --project #{project_id} --platform managed")
16
- end
15
+ desc "list", "Show Google Cloud Run List"
16
+ def list(project_id: "")
17
+ project_id = Souls.configuration.project_id if project_id.blank?
18
+ system("gcloud run services list --project #{project_id} --platform managed")
19
+ rescue Thor::Error => e
20
+ raise(Thor::Error, e)
21
+ end
17
22
 
18
- def get_endpoint(worker_name: "")
19
- `gcloud run services list | grep #{worker_name} | awk '{print $4}'`
20
- end
21
- end
23
+ desc "get_endpoint", "Show Worker's Endpoint"
24
+ def get_endpoint(worker_name: "")
25
+ `gcloud run services list | grep #{worker_name} | awk '{print $4}'`
26
+ rescue Thor::Error => e
27
+ raise(Thor::Error, e)
22
28
  end
23
29
  end
24
30
  end
@@ -1,37 +1,52 @@
1
1
  module Souls
2
- module Gcloud
3
- module Sql
4
- class << self
5
- def create_instance(instance_name: "", root_pass: "Postgre123!", zone: "asia-northeast1-b")
6
- instance_name = "#{Souls.configuration.app}-db" if instance_name.blank?
7
- system(
8
- "gcloud sql instances create #{instance_name} \
2
+ class Sql < Thor
3
+ desc "create_instance", "Create Google Cloud SQL - PostgreSQL13"
4
+ method_option :region, default: "", aliases: "--region", desc: "Google Cloud Platform Region"
5
+ method_option :root_password, default: "", aliases: "--root-password", desc: "Set Cloud SQL Root Password"
6
+ def create_instance
7
+ instance_name = "#{Souls.configuration.app}-db" if instance_name.blank?
8
+ region = Souls.configuration.region if options[:region].blank?
9
+ zone = "#{region}-b"
10
+ system(
11
+ "gcloud sql instances create #{instance_name} \
9
12
  --database-version=POSTGRES_13 --cpu=2 --memory=7680MB --zone=#{zone} \
10
- --root-password='#{root_pass}' --database-flags cloudsql.iam_authentication=on"
11
- )
12
- end
13
+ --root-password='#{options[:root_password]}' --database-flags cloudsql.iam_authentication=on"
14
+ )
15
+ rescue Thor::Error => e
16
+ raise(Thor::Error, e)
17
+ end
13
18
 
14
- def list
15
- system("gcloud sql instances list")
16
- end
19
+ desc "list", "Show Cloud SQL Instances List"
20
+ def list
21
+ system("gcloud sql instances list")
22
+ rescue Thor::Error => e
23
+ raise(Thor::Error, e)
24
+ end
17
25
 
18
- def setup_private_ip
19
- create_ip_range
20
- create_vpc_connector
21
- assign_network
22
- end
26
+ desc "setup_private_ip", "Enable Private IP"
27
+ def setup_private_ip
28
+ create_ip_range
29
+ create_vpc_connector
30
+ assign_network
31
+ rescue Thor::Error => e
32
+ raise(Thor::Error, e)
33
+ end
23
34
 
24
- def assign_network
25
- app_name = Souls.configuration.app
26
- instance_name = "#{Souls.configuration.app}-db"
27
- project_id = Souls.configuration.project_id
28
- system("gcloud beta sql instances patch #{instance_name} --project=#{project_id} --network=#{app_name}")
29
- end
35
+ desc "assign_network", "Assign Network"
36
+ def assign_network
37
+ app_name = Souls.configuration.app
38
+ instance_name = "#{Souls.configuration.app}-db"
39
+ project_id = Souls.configuration.project_id
40
+ system("gcloud beta sql instances patch #{instance_name} --project=#{project_id} --network=#{app_name}")
41
+ rescue Thor::Error => e
42
+ raise(Thor::Error, e)
43
+ end
30
44
 
31
- def create_ip_range
32
- app_name = Souls.configuration.app
33
- system(
34
- "
45
+ desc "create_ip_range", "Create VPC Adress Range"
46
+ def create_ip_range
47
+ app_name = Souls.configuration.app
48
+ system(
49
+ "
35
50
  gcloud compute addresses create #{app_name}-ip-range \
36
51
  --global \
37
52
  --purpose=VPC_PEERING \
@@ -39,37 +54,43 @@ module Souls
39
54
  --description='peering range for SOULs' \
40
55
  --network=#{app_name} \
41
56
  --project=#{app_name}"
42
- )
43
- end
57
+ )
58
+ rescue Thor::Error => e
59
+ raise(Thor::Error, e)
60
+ end
44
61
 
45
- def create_vpc_connector
46
- app_name = Souls.configuration.app
47
- system(
48
- "
62
+ desc "create_vpc_connector", "Create VPC-PEERING Connect"
63
+ def create_vpc_connector
64
+ app_name = Souls.configuration.app
65
+ system(
66
+ "
49
67
  gcloud services vpc-peerings connect \
50
68
  --service=servicenetworking.googleapis.com \
51
69
  --ranges=#{app_name}-ip-range \
52
70
  --network=#{app_name} \
53
71
  --project=#{app_name}
54
72
  "
55
- )
56
- end
73
+ )
74
+ rescue Thor::Error => e
75
+ raise(Thor::Error, e)
76
+ end
57
77
 
58
- def assign_ip(instance_name: "", ip: "")
59
- ip = `curl inet-ip.info` if ip.blank?
60
- project_id = Souls.configuration.project_id
61
- instance_name = "#{Souls.configuration.app}-db" if instance_name.blank?
62
- system(
63
- "
78
+ desc "assgin_ip", "Add Current Grobal IP to White List"
79
+ def assign_ip(instance_name: "", ip: "")
80
+ ip = `curl inet-ip.info` if ip.blank?
81
+ project_id = Souls.configuration.project_id
82
+ instance_name = "#{Souls.configuration.app}-db" if instance_name.blank?
83
+ system(
84
+ "
64
85
  gcloud beta sql instances patch #{instance_name} \
65
86
  --project=#{project_id} \
66
87
  --assign-ip \
67
88
  --authorized-networks=#{ip} \
68
89
  --quiet
69
90
  "
70
- )
71
- end
72
- end
91
+ )
92
+ rescue Thor::Error => e
93
+ raise(Thor::Error, e)
73
94
  end
74
95
  end
75
96
  end
@@ -1,30 +1,13 @@
1
+ require_relative "./console/index"
1
2
  require_relative "./create/index"
3
+ require_relative "./db/index"
2
4
  require_relative "./docker/index"
3
5
  require_relative "./gcloud/index"
4
6
  require_relative "./init/index"
5
7
  require_relative "./release/index"
6
8
  require_relative "./sync/index"
7
9
  require_relative "./upgrade/index"
10
+ require_relative "./server/index"
8
11
 
9
12
  module Souls
10
- module Create
11
- end
12
-
13
- module Docker
14
- end
15
-
16
- module Gcloud
17
- end
18
-
19
- module Init
20
- end
21
-
22
- module Release
23
- end
24
-
25
- module Sync
26
- end
27
-
28
- module Upgrade
29
- end
30
13
  end
@@ -1,155 +1,157 @@
1
1
  module Souls
2
- module Init
3
- class << self
4
- def get_version(repository_name: "souls_api")
5
- data = JSON.parse(
6
- `curl \
7
- -H "Accept: application/vnd.github.v3+json" \
8
- -s https://api.github.com/repos/elsoul/#{repository_name}/releases`
9
- )
10
- data[0]["tag_name"]
2
+ class CLI < Thor
3
+ desc "new [APP_NAME]", "Create SOULs APP"
4
+ def new(app_name)
5
+ if app_name.nil?
6
+ puts(Paint["you need to specify your app name", :red])
7
+ puts(Paint["`souls new souls-app`", :yellow])
8
+ exit
11
9
  end
12
10
 
13
- def generate_cd
14
- shell = `echo $SHELL`.strip
15
- rc =
16
- if shell.include?("zsh")
17
- "zshrc"
18
- else
19
- "bash"
20
- end
21
- system("echo '\nalias api=\'cd apps/api\'' >> ~/.#{rc}")
22
- system("echo 'alias mother=\'...\'' >> ~/.#{rc}")
23
- system("echo 'alias worker=\'cd apps/worker\'' >> ~/.#{rc}")
24
- puts(Paint["run `source ~/.#{rc}` to reflect your .#{rc}", :yellow])
25
- puts(Paint["You can move to mother/api/worker just type", :green])
26
- puts(Paint["\nmother\n", :white])
27
- puts(
28
- Paint["to go back to mother dir from api/worker\n\nYou can also go to api/worker from mother dir by typing",
29
- :green]
30
- )
31
- puts(Paint["\napi\n", :white])
32
- puts(Paint["or\n", :green])
33
- puts(Paint["worker", :white])
34
- end
11
+ service_name = "api"
12
+ download_souls(app_name: app_name, service_name: service_name)
13
+ mother_config_init(app_name: app_name)
14
+ download_github_actions(app_name: app_name)
15
+ initial_config_init(app_name: app_name, service_name: service_name)
16
+ souls_api_credit(app_name: app_name, service_name: service_name)
17
+ end
35
18
 
36
- def initial_config_init(app_name: "souls", service_name: "api")
37
- config_dir = "./#{app_name}/apps/#{service_name}/config"
38
- FileUtils.mkdir_p(config_dir) unless Dir.exist?(config_dir)
39
- FileUtils.touch("#{config_dir}/souls.rb")
40
- file_path = "#{config_dir}/souls.rb"
41
- File.open(file_path, "w") do |f|
42
- f.write(<<~TEXT)
43
- Souls.configure do |config|
44
- config.app = "#{app_name}"
45
- config.project_id = "#{app_name}-project"
46
- config.endpoint = "/endpoint"
47
- config.strain = "api"
48
- config.fixed_gems = ["excluded_gem"]
49
- config.workers = []
50
- end
51
- TEXT
52
- end
53
- rescue StandardError => e
54
- puts(e)
55
- end
19
+ private
56
20
 
57
- def download_github_actions(app_name: "souls-app")
58
- file_name = "github.tgz"
59
- url = "https://storage.googleapis.com/souls-bucket/github_actions/github.tgz"
60
- system("curl -OL #{url}")
61
- FileUtils.mkdir_p("#{app_name}/github")
62
- system("tar -zxvf ./#{file_name} -C #{app_name}/")
63
- FileUtils.rm(file_name)
64
- end
21
+ def get_version(repository_name: "souls_api")
22
+ data = JSON.parse(
23
+ `curl \
24
+ -H "Accept: application/vnd.github.v3+json" \
25
+ -s https://api.github.com/repos/elsoul/#{repository_name}/releases`
26
+ )
27
+ data[0]["tag_name"]
28
+ end
65
29
 
66
- def mother_config_init(app_name: "souls-app")
67
- config_dir = "./#{app_name}/config"
68
- FileUtils.mkdir_p(config_dir) unless Dir.exist?(config_dir)
69
- FileUtils.touch("#{config_dir}/souls.rb")
70
- file_path = "#{config_dir}/souls.rb"
71
- File.open(file_path, "w") do |f|
72
- f.write(<<~TEXT)
73
- Souls.configure do |config|
74
- config.app = "#{app_name}"
75
- config.project_id = "#{app_name}-project"
76
- config.endpoint = "/endpoint"
77
- config.strain = "mother"
78
- config.fixed_gems = ["excluded_gem"]
79
- config.workers = []
80
- end
81
- TEXT
30
+ def generate_cd
31
+ shell = `echo $SHELL`.strip
32
+ rc =
33
+ if shell.include?("zsh")
34
+ "zshrc"
35
+ else
36
+ "bash"
82
37
  end
83
- rescue StandardError => e
84
- puts(e)
38
+ system("echo '\nalias api=\'cd apps/api\'' >> ~/.#{rc}")
39
+ system("echo 'alias mother=\'...\'' >> ~/.#{rc}")
40
+ system("echo 'alias worker=\'cd apps/worker\'' >> ~/.#{rc}")
41
+ puts(Paint["run `source ~/.#{rc}` to reflect your .#{rc}", :yellow])
42
+ puts(Paint["You can move to mother/api/worker just type", :green])
43
+ puts(Paint["\nmother\n", :white])
44
+ puts(
45
+ Paint["to go back to mother dir from api/worker\n\nYou can also go to api/worker from mother dir by typing",
46
+ :green]
47
+ )
48
+ puts(Paint["\napi\n", :white])
49
+ puts(Paint["or\n", :green])
50
+ puts(Paint["worker", :white])
51
+ end
52
+
53
+ def initial_config_init(app_name: "souls", service_name: "api")
54
+ config_dir = "./#{app_name}/apps/#{service_name}/config"
55
+ FileUtils.mkdir_p(config_dir) unless Dir.exist?(config_dir)
56
+ FileUtils.touch("#{config_dir}/souls.rb")
57
+ file_path = "#{config_dir}/souls.rb"
58
+ File.open(file_path, "w") do |f|
59
+ f.write(<<~TEXT)
60
+ Souls.configure do |config|
61
+ config.app = "#{app_name}"
62
+ config.project_id = "#{app_name}"
63
+ config.region = "asia-northeast1"
64
+ config.endpoint = "/endpoint"
65
+ config.strain = "api"
66
+ config.fixed_gems = ["spring"]
67
+ config.workers = []
68
+ end
69
+ TEXT
85
70
  end
71
+ rescue StandardError => e
72
+ puts(e)
73
+ end
86
74
 
87
- def start(args)
88
- app_name = args[1]
89
- if app_name.nil?
90
- puts(Paint["you need to specify your app name", :red])
91
- puts(Paint["`souls new souls-app`", :yellow])
92
- exit
93
- end
75
+ def download_github_actions(app_name: "souls-app")
76
+ file_name = "github.tgz"
77
+ url = "https://storage.googleapis.com/souls-bucket/github_actions/github.tgz"
78
+ system("curl -OL #{url}")
79
+ FileUtils.mkdir_p("#{app_name}/github")
80
+ system("tar -zxvf ./#{file_name} -C #{app_name}/")
81
+ FileUtils.rm(file_name)
82
+ end
94
83
 
95
- service_name = "api"
96
- Souls::Init.download_souls(app_name: app_name, service_name: service_name)
97
- Souls::Init.mother_config_init(app_name: app_name)
98
- Souls::Init.download_github_actions(app_name: app_name)
99
- Souls::Init.initial_config_init(app_name: app_name, service_name: service_name)
100
- Souls::Init.souls_api_credit(app_name: app_name, service_name: service_name)
84
+ def mother_config_init(app_name: "souls-app")
85
+ config_dir = "./#{app_name}/config"
86
+ FileUtils.mkdir_p(config_dir) unless Dir.exist?(config_dir)
87
+ FileUtils.touch("#{config_dir}/souls.rb")
88
+ file_path = "#{config_dir}/souls.rb"
89
+ File.open(file_path, "w") do |f|
90
+ f.write(<<~TEXT)
91
+ Souls.configure do |config|
92
+ config.app = "#{app_name}"
93
+ config.project_id = "#{app_name}"
94
+ config.region = "asia-northeast1"
95
+ config.endpoint = "/endpoint"
96
+ config.strain = "mother"
97
+ config.fixed_gems = ["spring"]
98
+ config.workers = []
99
+ end
100
+ TEXT
101
101
  end
102
+ rescue StandardError => e
103
+ puts(e)
104
+ end
102
105
 
103
- def download_souls(app_name: "souls", service_name: "api")
104
- version = Souls.get_latest_version_txt(service_name: service_name).join(".")
105
- file_name = "#{service_name}-v#{version}.tgz"
106
- url = "https://storage.googleapis.com/souls-bucket/boilerplates/#{service_name.pluralize}/#{file_name}"
107
- system("curl -OL #{url}")
108
- system("mkdir -p #{app_name}/apps/#{service_name}")
109
- system("tar -zxvf ./#{file_name} -C #{app_name}/apps/")
110
- system("cd #{app_name} && curl -OL https://storage.googleapis.com/souls-bucket/boilerplates/.rubocop.yml")
111
- system("cd #{app_name} && curl -OL https://storage.googleapis.com/souls-bucket/boilerplates/Gemfile")
112
- system("cd #{app_name} && curl -OL https://storage.googleapis.com/souls-bucket/boilerplates/Procfile.dev")
113
- system("cd #{app_name} && curl -OL https://storage.googleapis.com/souls-bucket/boilerplates/Procfile")
114
- FileUtils.rm(file_name)
115
- end
106
+ def download_souls(app_name: "souls", service_name: "api")
107
+ version = Souls.get_latest_version_txt(service_name: service_name).join(".")
108
+ file_name = "#{service_name}-v#{version}.tgz"
109
+ url = "https://storage.googleapis.com/souls-bucket/boilerplates/#{service_name.pluralize}/#{file_name}"
110
+ system("curl -OL #{url}")
111
+ system("mkdir -p #{app_name}/apps/#{service_name}")
112
+ system("tar -zxvf ./#{file_name} -C #{app_name}/apps/")
113
+ system("cd #{app_name} && curl -OL https://storage.googleapis.com/souls-bucket/boilerplates/.rubocop.yml")
114
+ system("cd #{app_name} && curl -OL https://storage.googleapis.com/souls-bucket/boilerplates/Gemfile")
115
+ system("cd #{app_name} && curl -OL https://storage.googleapis.com/souls-bucket/boilerplates/Procfile.dev")
116
+ system("cd #{app_name} && curl -OL https://storage.googleapis.com/souls-bucket/boilerplates/Procfile")
117
+ FileUtils.rm(file_name)
118
+ end
116
119
 
117
- def souls_api_credit(app_name: "souls", service_name: "api")
118
- line = Paint["====================================", :yellow]
119
- puts("\n")
120
- puts(line)
121
- txt2 = <<~TEXT
122
- _____ ____ __ ____#{' '}
123
- / ___// __ \\/ / / / / %{red1}
124
- \\__ \\/ / / / / / / / %{red2}
125
- ___/ / /_/ / /_/ / /___%{red3}#{' '}
126
- /____/\\____/\\____/_____%{red4}#{' '}
127
- TEXT
128
- red1 = ["_____", :red]
129
- red2 = ["/ ___/", :red]
130
- red3 = ["(__ )", :red]
131
- red4 = ["/____/", :red]
132
- ms = Paint % [txt2, :cyan, { red1: red1, red2: red2, red3: red3, red4: red4 }]
133
- puts(ms)
134
- puts(line)
135
- welcome = Paint["Welcome to SOULs!", :white]
136
- puts(welcome)
137
- souls_ver = Paint["SOULs Version: #{Souls::VERSION}", :white]
138
- puts(souls_ver)
139
- puts(line)
140
- endroll = <<~TEXT
141
- Easy to Run
142
- $ cd #{app_name}/apps/#{service_name}
143
- $ bundle
144
- $ souls s
145
- Go To : http://localhost:4000
120
+ def souls_api_credit(app_name: "souls", service_name: "api")
121
+ line = Paint["====================================", :yellow]
122
+ puts("\n")
123
+ puts(line)
124
+ txt2 = <<~TEXT
125
+ _____ ____ __ ____#{' '}
126
+ / ___// __ \\/ / / / / %{red1}
127
+ \\__ \\/ / / / / / / / %{red2}
128
+ ___/ / /_/ / /_/ / /___%{red3}#{' '}
129
+ /____/\\____/\\____/_____%{red4}#{' '}
130
+ TEXT
131
+ red1 = ["_____", :red]
132
+ red2 = ["/ ___/", :red]
133
+ red3 = ["(__ )", :red]
134
+ red4 = ["/____/", :red]
135
+ ms = Paint % [txt2, :cyan, { red1: red1, red2: red2, red3: red3, red4: red4 }]
136
+ puts(ms)
137
+ puts(line)
138
+ welcome = Paint["Welcome to SOULs!", :white]
139
+ puts(welcome)
140
+ souls_ver = Paint["SOULs Version: #{Souls::VERSION}", :white]
141
+ puts(souls_ver)
142
+ puts(line)
143
+ endroll = <<~TEXT
144
+ Easy to Run
145
+ $ cd #{app_name}/apps/#{service_name}
146
+ $ bundle
147
+ $ souls s
148
+ Go To : http://localhost:4000
146
149
 
147
- Doc: https://souls.elsoul.nl
148
- TEXT
149
- cd = Paint[endroll, :white]
150
- puts(cd)
151
- puts(line)
152
- end
150
+ Doc: https://souls.elsoul.nl
151
+ TEXT
152
+ cd = Paint[endroll, :white]
153
+ puts(cd)
154
+ puts(line)
153
155
  end
154
156
  end
155
157
  end