souls 0.23.0 → 0.23.4
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/Gemfile.lock +1 -1
- data/exe/souls +60 -42
- data/lib/souls.rb +3 -7
- data/lib/souls/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: aa814dc13fd13435747be4c7f825b20f695493e58f2973dd92ec8116e3d6a918
|
4
|
+
data.tar.gz: 8aa79f05984d5994837aa98d9bb3d54da16e42c1ba20c39291f558b9dcba30a8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4472db8c5bbe47770b5da27a6e5b3feabdfea348161f580dc3235d9e6439320de550926bd4b40f4a57542f446c6b3f9aa720b9428ace9b565b46e95df043e6ae
|
7
|
+
data.tar.gz: f21acca565e37aa4f5cdbf06709d73157127f1158056260d1170fb10d03f2d4a1305a000fbbd53fedf5e8d551e1bcaf1e26fb708e9ad37912b80f2863de232f2
|
data/Gemfile.lock
CHANGED
data/exe/souls
CHANGED
@@ -1,15 +1,17 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
2
|
require "souls"
|
3
3
|
begin
|
4
|
-
require "./config/souls" unless ARGV[0] == "new" || ARGV[0] == "i" || ARGV[0] == "-v"
|
4
|
+
require "./config/souls" unless ARGV[0] == "new" || ARGV[0] == "i" || ARGV[0] == "-v" || ARGV[0] == "deploy"
|
5
5
|
rescue
|
6
6
|
puts "Make sure you are at SOULs APP directory!"
|
7
7
|
end
|
8
8
|
begin
|
9
|
-
|
9
|
+
souls_command = ARGV[0]
|
10
|
+
case souls_command
|
10
11
|
when "new"
|
11
12
|
STRAINS = ["api", "worker", "console", "admin", "media"]
|
12
|
-
|
13
|
+
app_name = ARGV[1]
|
14
|
+
if app_name.nil?
|
13
15
|
puts Paint["you need to specify your app name", :red]
|
14
16
|
puts Paint["`souls new app_name`", :yellow]
|
15
17
|
exit
|
@@ -29,12 +31,11 @@ begin
|
|
29
31
|
strain = STDIN.gets.chomp.to_i
|
30
32
|
case strain
|
31
33
|
when 1, 2
|
32
|
-
Souls::Init.download_souls app_name:
|
33
|
-
Souls::Init.initial_config_init app_name:
|
34
|
+
Souls::Init.download_souls app_name: app_name, repository_name: "souls_#{STRAINS[strain.to_i - 1]}"
|
35
|
+
Souls::Init.initial_config_init app_name: app_name, strain: STRAINS[strain.to_i - 1]
|
34
36
|
else
|
35
37
|
puts Paint["Coming Soon...", :blue]
|
36
38
|
end
|
37
|
-
|
38
39
|
when "s", "server"
|
39
40
|
strain = Souls.configuration.strain
|
40
41
|
case strain
|
@@ -51,7 +52,8 @@ begin
|
|
51
52
|
when "media", "admin"
|
52
53
|
system "yarn dev"
|
53
54
|
else
|
54
|
-
|
55
|
+
rack_env = ARGV[1]
|
56
|
+
case rack_env
|
55
57
|
when "RACK_ENV=production"
|
56
58
|
system "RACK_ENV=production bundle exec irb"
|
57
59
|
else
|
@@ -59,20 +61,28 @@ begin
|
|
59
61
|
end
|
60
62
|
end
|
61
63
|
when "i", "infra"
|
62
|
-
|
64
|
+
send_method = ARGV[1]
|
65
|
+
Souls.send send_method
|
63
66
|
when "gcloud"
|
64
|
-
|
67
|
+
status = Paint["Running Gcloud Commands...", :yellow]
|
68
|
+
Whirly.start spinner: "clock", interval: 420, stop: "🎉" do
|
69
|
+
Whirly.status = status
|
70
|
+
send_method = ARGV[1]
|
71
|
+
Souls::Gcloud.send send_method
|
72
|
+
Whirly.status = "Done!"
|
73
|
+
end
|
65
74
|
when "-v", "--version"
|
66
|
-
puts Souls::VERSION
|
75
|
+
puts Paint[Souls::VERSION, :white]
|
67
76
|
when "gem:update", "gemfile:update"
|
68
77
|
status = Paint["Checking for updates...", :yellow]
|
69
|
-
Whirly.start spinner: "clock", interval:
|
78
|
+
Whirly.start spinner: "clock", interval: 420, stop: "🎉" do
|
70
79
|
Whirly.status = status
|
71
80
|
Souls.update_gemfile
|
72
81
|
Whirly.status = "Done!"
|
73
82
|
end
|
74
83
|
when "add"
|
75
|
-
|
84
|
+
graphql_class = ARGV[1]
|
85
|
+
case graphql_class
|
76
86
|
when "mutation"
|
77
87
|
Souls::Init.add_mutation class_name: "user", file_name: "hoi"
|
78
88
|
when "type"
|
@@ -84,82 +94,89 @@ begin
|
|
84
94
|
when "rspec_mutation"
|
85
95
|
Souls::Init.add_rspec_mutation class_name: "user", file_name: "hoi"
|
86
96
|
else
|
87
|
-
puts "
|
97
|
+
puts Paint["Wrong Argument!", :red]
|
88
98
|
end
|
89
99
|
when "g", "generate"
|
90
|
-
|
100
|
+
graphql_class = ARGV[1]
|
101
|
+
class_name = ARGV[2]
|
102
|
+
case graphql_class
|
91
103
|
when "test_dir"
|
92
104
|
Souls::Generate.test_dir
|
93
105
|
when "model"
|
94
|
-
Souls::Generate.model class_name:
|
106
|
+
Souls::Generate.model class_name: class_name
|
95
107
|
when "mutation"
|
96
|
-
Souls::Generate.mutation class_name:
|
108
|
+
Souls::Generate.mutation class_name: class_name
|
97
109
|
when "query"
|
98
|
-
Souls::Generate.query class_name:
|
110
|
+
Souls::Generate.query class_name: class_name
|
99
111
|
when "type"
|
100
|
-
Souls::Generate.type class_name:
|
112
|
+
Souls::Generate.type class_name: class_name
|
101
113
|
when "edge"
|
102
|
-
Souls::Generate.edge class_name:
|
114
|
+
Souls::Generate.edge class_name: class_name
|
103
115
|
when "connection"
|
104
|
-
Souls::Generate.connection class_name:
|
116
|
+
Souls::Generate.connection class_name: class_name
|
105
117
|
when "resolver"
|
106
|
-
Souls::Generate.resolver class_name:
|
118
|
+
Souls::Generate.resolver class_name: class_name
|
107
119
|
when "policy"
|
108
|
-
Souls::Generate.policy class_name:
|
120
|
+
Souls::Generate.policy class_name: class_name
|
109
121
|
when "rspec_factory"
|
110
|
-
Souls::Generate.rspec_factory class_name:
|
122
|
+
Souls::Generate.rspec_factory class_name: class_name
|
111
123
|
when "rspec_model"
|
112
|
-
Souls::Generate.rspec_model class_name:
|
124
|
+
Souls::Generate.rspec_model class_name: class_name
|
113
125
|
when "rspec_mutation"
|
114
|
-
Souls::Generate.rspec_mutation class_name:
|
126
|
+
Souls::Generate.rspec_mutation class_name: class_name
|
115
127
|
when "rspec_query"
|
116
|
-
Souls::Generate.rspec_query class_name:
|
128
|
+
Souls::Generate.rspec_query class_name: class_name
|
117
129
|
when "rspec_resolver"
|
118
|
-
Souls::Generate.rspec_resolver class_name:
|
130
|
+
Souls::Generate.rspec_resolver class_name: class_name
|
119
131
|
when "rspec_policy"
|
120
|
-
Souls::Generate.rspec_policy class_name:
|
132
|
+
Souls::Generate.rspec_policy class_name: class_name
|
121
133
|
when "node_type"
|
122
|
-
Souls::Generate.node_type class_name:
|
134
|
+
Souls::Generate.node_type class_name: class_name
|
123
135
|
when "job"
|
124
|
-
Souls::Generate.job class_name:
|
136
|
+
Souls::Generate.job class_name: class_name
|
125
137
|
when "migrate"
|
126
|
-
Souls::Generate.single_migrate class_name:
|
138
|
+
Souls::Generate.single_migrate class_name: class_name
|
127
139
|
when "migrate_all"
|
128
140
|
Souls::Generate.migrate_all
|
129
141
|
when "migration"
|
130
|
-
|
131
|
-
system "rake db:create_migration NAME=create_#{
|
142
|
+
pluralized_class_name = class_name.underscore.pluralize
|
143
|
+
system "rake db:create_migration NAME=create_#{pluralized_class_name}"
|
132
144
|
when "update"
|
133
|
-
Souls::Generate.update_delete class_name:
|
134
|
-
Souls::Generate.single_migrate class_name:
|
145
|
+
Souls::Generate.update_delete class_name: class_name
|
146
|
+
Souls::Generate.single_migrate class_name: class_name
|
135
147
|
else
|
136
148
|
"SOULs!"
|
137
149
|
end
|
138
150
|
when "d"
|
139
|
-
|
151
|
+
class_name = ARGV[1]
|
152
|
+
Souls::Generate.delete_all class_name: class_name
|
140
153
|
when "db:create"
|
141
|
-
|
154
|
+
rack_env = ARGV[1]
|
155
|
+
case rack_env
|
142
156
|
when "RACK_ENV=production"
|
143
157
|
system "rake db:create RACK_ENV=production"
|
144
158
|
else
|
145
159
|
system "rake db:create && rake db:create RACK_ENV=test"
|
146
160
|
end
|
147
161
|
when "db:migrate"
|
148
|
-
|
162
|
+
rack_env = ARGV[1]
|
163
|
+
case rack_env
|
149
164
|
when "RACK_ENV=production"
|
150
165
|
system "rake db:migrate RACK_ENV=production"
|
151
166
|
else
|
152
167
|
system "rake db:migrate && rake db:migrate RACK_ENV=test"
|
153
168
|
end
|
154
169
|
when "db:seed"
|
155
|
-
|
170
|
+
rack_env = ARGV[1]
|
171
|
+
case rack_env
|
156
172
|
when "RACK_ENV=production"
|
157
173
|
system "rake db:seed RACK_ENV=production"
|
158
174
|
else
|
159
175
|
system "rake db:seed"
|
160
176
|
end
|
161
177
|
when "db:migrate:reset"
|
162
|
-
|
178
|
+
rack_env = ARGV[1]
|
179
|
+
case rack_env
|
163
180
|
when "RACK_ENV=production"
|
164
181
|
system "rake db:migrate:reset RACK_ENV=production DISABLE_DATABASE_ENVIRONMENT_CHECK=1"
|
165
182
|
else
|
@@ -184,10 +201,11 @@ begin
|
|
184
201
|
system "docker build . -t souls -f Dockerfile.dev"
|
185
202
|
system "docker run --rm --env-file .env -p 3000:3000 souls:latest"
|
186
203
|
when "deploy"
|
187
|
-
|
204
|
+
project_id = Souls.configuration.project_id
|
205
|
+
system "gcloud builds submit --config=cloudbuild.yml --project #{project_id}"
|
188
206
|
else
|
189
207
|
puts Paint["Welcome to SOULs!", :green]
|
190
208
|
end
|
191
209
|
rescue StandardError => error
|
192
|
-
puts Paint[
|
210
|
+
puts Paint[error, :red]
|
193
211
|
end
|
data/lib/souls.rb
CHANGED
@@ -77,7 +77,6 @@ module Souls
|
|
77
77
|
updated_gems = []
|
78
78
|
updated_gem_versions = []
|
79
79
|
updated_lines = []
|
80
|
-
console_log = []
|
81
80
|
from_dev = false
|
82
81
|
File.open(file_path, "r") do |f|
|
83
82
|
f.each_line do |line|
|
@@ -96,17 +95,11 @@ module Souls
|
|
96
95
|
updated_gems << (gem[0]).to_s
|
97
96
|
updated_gem_versions << data["version"]
|
98
97
|
system "gem update #{gem[0]}"
|
99
|
-
console_log << if gem[0] == "souls"
|
100
|
-
"#{gem[0]} v#{gem[1]} → v#{data["version"]}\n\nSOULs Doc: https://souls.elsoul.nl"
|
101
|
-
else
|
102
|
-
"#{gem[0]} v#{gem[1]} → v#{data["version"]}"
|
103
|
-
end
|
104
98
|
end
|
105
99
|
end
|
106
100
|
{
|
107
101
|
gems: updated_gems,
|
108
102
|
lines: updated_lines,
|
109
|
-
console_log: console_log,
|
110
103
|
updated_gem_versions: updated_gem_versions
|
111
104
|
}
|
112
105
|
end
|
@@ -151,6 +144,9 @@ module Souls
|
|
151
144
|
}
|
152
145
|
]
|
153
146
|
end
|
147
|
+
if gem[0] == "souls"
|
148
|
+
logs << Paint["\nSOULs Doc: %{cyan_text}", :white, { cyan_text: ["https://souls.elsoul.nl\n", :cyan] }]
|
149
|
+
end
|
154
150
|
new_line.write "#{new_gems[:lines][@i]}\n"
|
155
151
|
@i += 1
|
156
152
|
else
|
data/lib/souls/version.rb
CHANGED