souls 0.23.2 → 0.23.6
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/.rubocop.yml +73 -135
- data/Gemfile.lock +1 -1
- data/Rakefile +2 -2
- data/exe/souls +73 -68
- data/lib/souls.rb +153 -145
- data/lib/souls/gcloud/compute.rb +61 -51
- data/lib/souls/gcloud/iam.rb +22 -24
- data/lib/souls/generate/application.rb +160 -160
- data/lib/souls/generate/connection.rb +13 -15
- data/lib/souls/generate/edge.rb +13 -15
- data/lib/souls/generate/model.rb +16 -17
- data/lib/souls/generate/mutation.rb +225 -221
- data/lib/souls/generate/policy.rb +44 -45
- data/lib/souls/generate/query.rb +49 -49
- data/lib/souls/generate/resolver.rb +121 -124
- data/lib/souls/generate/rspec_factory.rb +49 -52
- data/lib/souls/generate/rspec_model.rb +17 -18
- data/lib/souls/generate/rspec_mutation.rb +193 -199
- data/lib/souls/generate/rspec_policy.rb +38 -39
- data/lib/souls/generate/rspec_query.rb +133 -140
- data/lib/souls/generate/rspec_resolver.rb +147 -154
- data/lib/souls/generate/type.rb +34 -25
- data/lib/souls/init.rb +51 -50
- data/lib/souls/version.rb +2 -1
- data/souls.gemspec +12 -7
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c9b239d8337484aa068e9a7746e248138dadafa12f7cdcdf04f715c896f94188
|
4
|
+
data.tar.gz: a8edefdb6f72c353a76e99807b39ae60882860336bf6cb6fc9d4511bf4ba551f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: '09a772d76110044534c362babea22cabe480686806b6bd5505741b389f69bacdc86dcd72ebcf068e7be0e4c384df1f3218034aa36fac49f8890785be3f212498'
|
7
|
+
data.tar.gz: 87caf77681a745b9a5d57e7e5532c2cfe7f15bc0b8d8198c1bbcbbd5d7c67eb208cbd82808ce1d062688ebdd87da691f0221fc8c68ecb5ee483237dde6bf1c08
|
data/.rubocop.yml
CHANGED
@@ -1,214 +1,152 @@
|
|
1
|
+
require: rubocop-graphql
|
1
2
|
AllCops:
|
3
|
+
SuggestExtensions: false
|
2
4
|
EnabledByDefault: true
|
5
|
+
Exclude:
|
6
|
+
- "app/**/*.rb"
|
7
|
+
- "db/migrate/*.rb"
|
8
|
+
- "db/schema.rb"
|
9
|
+
- "spec/spec_helper.rb"
|
10
|
+
- "spec/**/*.rb"
|
11
|
+
- "lib/souls/generate/type.rb"
|
3
12
|
|
4
|
-
Style/
|
13
|
+
Style/Copyright:
|
14
|
+
Description: "Include a copyright notice in each file before any code."
|
5
15
|
Enabled: false
|
16
|
+
VersionAdded: "0.30"
|
17
|
+
Notice: '^Copyright (\(c\) )?2[0-9]{3} .+'
|
18
|
+
AutocorrectNotice: "Copyright 2021 by ELSOUL LABO B.V."
|
6
19
|
|
7
|
-
Style/
|
8
|
-
|
20
|
+
Style/TopLevelMethodDefinition:
|
21
|
+
Exclude:
|
22
|
+
- "db/seeds.rb"
|
23
|
+
- "spec/spec_helper.rb"
|
9
24
|
|
10
|
-
Style/
|
11
|
-
|
25
|
+
Style/IpAddresses:
|
26
|
+
Exclude:
|
27
|
+
- "config.ru"
|
28
|
+
- "Gemfile"
|
12
29
|
|
13
|
-
Style/
|
14
|
-
|
30
|
+
Style/HashSyntax:
|
31
|
+
EnforcedStyle: ruby19
|
32
|
+
Exclude:
|
33
|
+
- "**/*.rake"
|
34
|
+
- "Rakefile"
|
15
35
|
|
16
|
-
Style/
|
17
|
-
|
36
|
+
Style/Semicolon:
|
37
|
+
Exclude:
|
38
|
+
- "spec/**/*"
|
18
39
|
|
19
|
-
Style/
|
20
|
-
|
40
|
+
Style/StringLiterals:
|
41
|
+
EnforcedStyle: double_quotes
|
21
42
|
|
22
|
-
Style/
|
43
|
+
Style/ClassVars:
|
44
|
+
Exclude:
|
45
|
+
- "spec/spec_helper.rb"
|
46
|
+
Style/StringConcatenation:
|
23
47
|
Enabled: false
|
24
48
|
|
25
|
-
Style/
|
49
|
+
Style/Documentation:
|
26
50
|
Enabled: false
|
27
51
|
|
28
52
|
Style/DocumentationMethod:
|
29
53
|
Enabled: false
|
30
54
|
|
31
|
-
Style/
|
32
|
-
PreferredMethods:
|
33
|
-
detect: "detect"
|
34
|
-
find: "detect"
|
35
|
-
inject: "inject"
|
36
|
-
reduce: "inject"
|
37
|
-
|
38
|
-
Style/Documentation:
|
39
|
-
Enabled: false
|
40
|
-
|
41
|
-
Style/DoubleNegation:
|
55
|
+
Style/FrozenStringLiteralComment:
|
42
56
|
Enabled: false
|
57
|
+
Style/Lambda:
|
58
|
+
EnforcedStyle: literal
|
43
59
|
|
44
|
-
|
60
|
+
Style/AsciiComments:
|
45
61
|
Enabled: false
|
46
62
|
|
47
|
-
Layout/DotPosition:
|
48
|
-
EnforcedStyle: trailing
|
49
|
-
|
50
|
-
|
51
|
-
Layout/EmptyLineAfterGuardClause:
|
52
|
-
Enabled: false
|
53
|
-
|
54
|
-
Style/EmptyElse:
|
55
|
-
EnforcedStyle: empty
|
56
|
-
|
57
|
-
Layout/ExtraSpacing:
|
58
|
-
Exclude:
|
59
|
-
- "db/migrate/*.rb"
|
60
|
-
- "*.gemspec"
|
61
|
-
|
62
|
-
Style/FormatString:
|
63
|
-
EnforcedStyle: percent
|
64
|
-
|
65
63
|
Style/MissingElse:
|
66
64
|
Enabled: false
|
67
65
|
|
68
66
|
Style/StringHashKeys:
|
69
67
|
Exclude:
|
70
|
-
- "spec
|
71
|
-
- "*.gemspec"
|
72
|
-
|
73
|
-
Style/GuardClause:
|
74
|
-
MinBodyLength: 5
|
68
|
+
- "spec/**/*.rb"
|
75
69
|
|
76
|
-
Style/
|
77
|
-
EnforcedStyle: ruby19
|
78
|
-
Exclude:
|
79
|
-
- "**/*.rake"
|
80
|
-
- "Rakefile"
|
81
|
-
|
82
|
-
|
83
|
-
Style/IfUnlessModifier:
|
70
|
+
Style/CollectionMethods:
|
84
71
|
Enabled: false
|
85
72
|
|
86
|
-
Style/
|
87
|
-
EnforcedStyle: short
|
88
|
-
|
89
|
-
Style/Lambda:
|
73
|
+
Style/FormatString:
|
90
74
|
Enabled: false
|
91
75
|
|
92
|
-
Style/
|
93
|
-
MinDigits: 7
|
94
|
-
|
95
|
-
Style/PerlBackrefs:
|
96
|
-
AutoCorrect: false
|
97
|
-
|
98
|
-
Style/RedundantSelf:
|
76
|
+
Style/ClassAndModuleChildren:
|
99
77
|
Enabled: false
|
100
78
|
|
101
|
-
Style/
|
79
|
+
Style/FormatStringToken:
|
102
80
|
Enabled: false
|
103
81
|
|
104
|
-
Style/
|
105
|
-
AllowMultipleReturnValues: true
|
106
|
-
|
107
|
-
Style/RedundantArgument:
|
82
|
+
Style/ClassMethodsDefinitions:
|
108
83
|
Enabled: false
|
109
84
|
|
110
|
-
|
85
|
+
Layout/ExtraSpacing:
|
111
86
|
Exclude:
|
112
|
-
- "
|
87
|
+
- "db/migrate/*.rb"
|
113
88
|
|
114
|
-
|
115
|
-
|
89
|
+
Layout/LineLength:
|
90
|
+
Exclude:
|
91
|
+
- "lib/souls/generate/rspec_mutation.rb"
|
92
|
+
- "lib/souls/generate/resolver.rb"
|
116
93
|
|
117
|
-
|
94
|
+
Layout/LineEndStringConcatenationIndentation:
|
118
95
|
Enabled: false
|
119
96
|
|
120
|
-
|
121
|
-
EnforcedStyle: double_quotes
|
122
|
-
|
123
|
-
Style/StringLiteralsInInterpolation:
|
97
|
+
GraphQL/ObjectDescription:
|
124
98
|
Enabled: false
|
125
99
|
|
126
|
-
|
100
|
+
GraphQL/FieldDescription:
|
127
101
|
Enabled: false
|
128
102
|
|
129
|
-
|
103
|
+
GraphQL/ArgumentDescription:
|
130
104
|
Enabled: false
|
131
105
|
|
132
|
-
|
106
|
+
GraphQL/ExtractInputType:
|
133
107
|
Enabled: false
|
134
108
|
|
109
|
+
GraphQL/ExtractType:
|
110
|
+
Enabled: false
|
135
111
|
|
136
|
-
|
112
|
+
GraphQL/ArgumentName:
|
137
113
|
Enabled: false
|
138
114
|
|
139
|
-
|
140
|
-
|
115
|
+
Lint/ConstantResolution:
|
116
|
+
Enabled: false
|
141
117
|
|
142
|
-
|
118
|
+
Lint/NumberConversion:
|
143
119
|
Enabled: false
|
144
120
|
|
145
|
-
|
121
|
+
Lint/MissingSuper:
|
146
122
|
Enabled: false
|
147
123
|
|
148
|
-
|
124
|
+
Metrics/AbcSize:
|
149
125
|
Enabled: false
|
150
|
-
|
151
126
|
|
152
127
|
Metrics/MethodLength:
|
153
128
|
Enabled: false
|
154
129
|
|
155
|
-
Metrics/
|
130
|
+
Metrics/BlockLength:
|
156
131
|
Enabled: false
|
157
132
|
|
158
|
-
|
159
|
-
|
133
|
+
Metrics/CyclomaticComplexity:
|
134
|
+
Enabled: false
|
160
135
|
|
161
|
-
|
136
|
+
Metrics/PerceivedComplexity:
|
162
137
|
Enabled: false
|
163
138
|
|
164
139
|
Metrics/ModuleLength:
|
165
140
|
Enabled: false
|
166
141
|
|
167
|
-
|
142
|
+
Metrics/BlockNesting:
|
168
143
|
Enabled: false
|
169
144
|
|
170
|
-
|
145
|
+
Naming/AccessorMethodName:
|
171
146
|
Enabled: false
|
172
147
|
|
173
|
-
Naming/
|
148
|
+
Naming/PredicateName:
|
174
149
|
Enabled: false
|
175
150
|
|
176
151
|
Bundler/GemComment:
|
177
|
-
Enabled: false
|
178
|
-
|
179
|
-
Style/SafeNavigation:
|
180
|
-
Enabled: false
|
181
|
-
|
182
|
-
Lint/NumberConversion:
|
183
|
-
Enabled: false
|
184
|
-
Style/ConstantVisibility:
|
185
|
-
Enabled: false
|
186
|
-
Style/MutableConstant:
|
187
|
-
Enabled: false
|
188
|
-
Style/Copyright:
|
189
|
-
Enabled: false
|
190
|
-
Style/MultilineTernaryOperator:
|
191
|
-
Enabled: false
|
192
|
-
Layout/MultilineAssignmentLayout:
|
193
|
-
Enabled: false
|
194
|
-
Style/Send:
|
195
|
-
Enabled: false
|
196
|
-
Style/RedundantFileExtensionInRequire:
|
197
|
-
Enabled: false
|
198
|
-
Style/ClassMethodsDefinitions:
|
199
|
-
Enabled: false
|
200
|
-
Style/GlobalStdStream:
|
201
|
-
Enabled: false
|
202
|
-
Layout/IndentationConsistency:
|
203
|
-
Enabled: false
|
204
|
-
Layout/IndentationWidth:
|
205
|
-
Enabled: false
|
206
|
-
Style/DateTime:
|
207
|
-
Enabled: false
|
208
|
-
Layout/HeredocIndentation:
|
209
|
-
Exclude:
|
210
|
-
- "lib/souls/init.rb"
|
211
|
-
Style/RaiseArgs:
|
212
|
-
Enabled: false
|
213
|
-
Metrics/BlockNesting:
|
214
152
|
Enabled: false
|
data/Gemfile.lock
CHANGED
data/Rakefile
CHANGED
@@ -10,14 +10,14 @@ namespace :task do
|
|
10
10
|
task :g do
|
11
11
|
file_path = "./lib/souls/generate/"
|
12
12
|
Souls::SOULS_METHODS.each do |f|
|
13
|
-
FileUtils.touch
|
13
|
+
FileUtils.touch("#{file_path}#{f}.rb")
|
14
14
|
end
|
15
15
|
end
|
16
16
|
|
17
17
|
task :a do
|
18
18
|
file_path = "./spec/generate/"
|
19
19
|
Souls::SOULS_METHODS.each do |f|
|
20
|
-
FileUtils.touch
|
20
|
+
FileUtils.touch("#{file_path}#{f}_spec.rb")
|
21
21
|
end
|
22
22
|
end
|
23
23
|
end
|
data/exe/souls
CHANGED
@@ -1,19 +1,19 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
2
|
require "souls"
|
3
3
|
begin
|
4
|
-
require
|
5
|
-
rescue
|
6
|
-
puts
|
4
|
+
require("./config/souls") unless ARGV[0] == "new" || ARGV[0] == "i" || ARGV[0] == "-v" || ARGV[0] == "deploy"
|
5
|
+
rescue StandardError
|
6
|
+
puts("Make sure you are at SOULs APP directory!")
|
7
7
|
end
|
8
8
|
begin
|
9
9
|
souls_command = ARGV[0]
|
10
10
|
case souls_command
|
11
11
|
when "new"
|
12
|
-
STRAINS = [
|
12
|
+
STRAINS = %w[api worker console admin media].freeze
|
13
13
|
app_name = ARGV[1]
|
14
14
|
if app_name.nil?
|
15
|
-
puts
|
16
|
-
puts
|
15
|
+
puts(Paint["you need to specify your app name", :red])
|
16
|
+
puts(Paint["`souls new app_name`", :yellow])
|
17
17
|
exit
|
18
18
|
end
|
19
19
|
first_message = Paint % [
|
@@ -27,50 +27,55 @@ begin
|
|
27
27
|
cyan_text: ["\n5. SOULs Media Web", :cyan]
|
28
28
|
}
|
29
29
|
]
|
30
|
-
puts
|
31
|
-
strain =
|
30
|
+
puts(first_message)
|
31
|
+
strain = $stdin.gets.chomp.to_i
|
32
32
|
case strain
|
33
33
|
when 1, 2
|
34
|
-
Souls::Init.download_souls
|
35
|
-
Souls::Init.initial_config_init
|
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])
|
36
36
|
else
|
37
|
-
puts
|
37
|
+
puts(Paint["Coming Soon...", :blue])
|
38
38
|
end
|
39
39
|
when "s", "server"
|
40
40
|
strain = Souls.configuration.strain
|
41
41
|
case strain
|
42
42
|
when "media", "admin", "console"
|
43
|
-
system
|
43
|
+
system("yarn dev")
|
44
44
|
when "worker"
|
45
|
-
system
|
45
|
+
system("bundle exec puma -p 3000 -e development")
|
46
46
|
else
|
47
|
-
system
|
47
|
+
system("foreman start -f Procfile.dev")
|
48
48
|
end
|
49
49
|
when "c", "console"
|
50
50
|
strain = Souls.configuration.strain
|
51
51
|
case strain
|
52
52
|
when "media", "admin"
|
53
|
-
system
|
53
|
+
system("yarn dev")
|
54
54
|
else
|
55
55
|
rack_env = ARGV[1]
|
56
56
|
case rack_env
|
57
57
|
when "RACK_ENV=production"
|
58
|
-
system
|
58
|
+
system("RACK_ENV=production bundle exec irb")
|
59
59
|
else
|
60
|
-
system
|
60
|
+
system("bundle exec irb")
|
61
61
|
end
|
62
62
|
end
|
63
63
|
when "i", "infra"
|
64
64
|
send_method = ARGV[1]
|
65
|
-
Souls.
|
65
|
+
Souls.public_send(send_method)
|
66
66
|
when "gcloud"
|
67
|
-
|
68
|
-
|
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.public_send(send_method)
|
72
|
+
Whirly.status = "Done!"
|
73
|
+
end
|
69
74
|
when "-v", "--version"
|
70
|
-
puts
|
75
|
+
puts(Paint[Souls::VERSION, :white])
|
71
76
|
when "gem:update", "gemfile:update"
|
72
77
|
status = Paint["Checking for updates...", :yellow]
|
73
|
-
Whirly.start
|
78
|
+
Whirly.start(spinner: "clock", interval: 420, stop: "🎉") do
|
74
79
|
Whirly.status = status
|
75
80
|
Souls.update_gemfile
|
76
81
|
Whirly.status = "Done!"
|
@@ -79,17 +84,17 @@ begin
|
|
79
84
|
graphql_class = ARGV[1]
|
80
85
|
case graphql_class
|
81
86
|
when "mutation"
|
82
|
-
Souls::Init.add_mutation
|
87
|
+
Souls::Init.add_mutation(class_name: "user", file_name: "hoi")
|
83
88
|
when "type"
|
84
|
-
Souls::Init.add_type
|
89
|
+
Souls::Init.add_type(class_name: "user", file_name: "hoi")
|
85
90
|
when "connection"
|
86
|
-
Souls::Init.add_connection
|
91
|
+
Souls::Init.add_connection(class_name: "user", file_name: "hoi")
|
87
92
|
when "edge"
|
88
|
-
Souls::Init.add_edge
|
93
|
+
Souls::Init.add_edge(class_name: "user", file_name: "hoi")
|
89
94
|
when "rspec_mutation"
|
90
|
-
Souls::Init.add_rspec_mutation
|
95
|
+
Souls::Init.add_rspec_mutation(class_name: "user", file_name: "hoi")
|
91
96
|
else
|
92
|
-
puts
|
97
|
+
puts(Paint["Wrong Argument!", :red])
|
93
98
|
end
|
94
99
|
when "g", "generate"
|
95
100
|
graphql_class = ARGV[1]
|
@@ -98,84 +103,84 @@ begin
|
|
98
103
|
when "test_dir"
|
99
104
|
Souls::Generate.test_dir
|
100
105
|
when "model"
|
101
|
-
Souls::Generate.model
|
106
|
+
Souls::Generate.model(class_name: class_name)
|
102
107
|
when "mutation"
|
103
|
-
Souls::Generate.mutation
|
108
|
+
Souls::Generate.mutation(class_name: class_name)
|
104
109
|
when "query"
|
105
|
-
Souls::Generate.query
|
110
|
+
Souls::Generate.query(class_name: class_name)
|
106
111
|
when "type"
|
107
|
-
Souls::Generate.type
|
112
|
+
Souls::Generate.type(class_name: class_name)
|
108
113
|
when "edge"
|
109
|
-
Souls::Generate.edge
|
114
|
+
Souls::Generate.edge(class_name: class_name)
|
110
115
|
when "connection"
|
111
|
-
Souls::Generate.connection
|
116
|
+
Souls::Generate.connection(class_name: class_name)
|
112
117
|
when "resolver"
|
113
|
-
Souls::Generate.resolver
|
118
|
+
Souls::Generate.resolver(class_name: class_name)
|
114
119
|
when "policy"
|
115
|
-
Souls::Generate.policy
|
120
|
+
Souls::Generate.policy(class_name: class_name)
|
116
121
|
when "rspec_factory"
|
117
|
-
Souls::Generate.rspec_factory
|
122
|
+
Souls::Generate.rspec_factory(class_name: class_name)
|
118
123
|
when "rspec_model"
|
119
|
-
Souls::Generate.rspec_model
|
124
|
+
Souls::Generate.rspec_model(class_name: class_name)
|
120
125
|
when "rspec_mutation"
|
121
|
-
Souls::Generate.rspec_mutation
|
126
|
+
Souls::Generate.rspec_mutation(class_name: class_name)
|
122
127
|
when "rspec_query"
|
123
|
-
Souls::Generate.rspec_query
|
128
|
+
Souls::Generate.rspec_query(class_name: class_name)
|
124
129
|
when "rspec_resolver"
|
125
|
-
Souls::Generate.rspec_resolver
|
130
|
+
Souls::Generate.rspec_resolver(class_name: class_name)
|
126
131
|
when "rspec_policy"
|
127
|
-
Souls::Generate.rspec_policy
|
132
|
+
Souls::Generate.rspec_policy(class_name: class_name)
|
128
133
|
when "node_type"
|
129
|
-
Souls::Generate.node_type
|
134
|
+
Souls::Generate.node_type(class_name: class_name)
|
130
135
|
when "job"
|
131
|
-
Souls::Generate.job
|
136
|
+
Souls::Generate.job(class_name: class_name)
|
132
137
|
when "migrate"
|
133
|
-
Souls::Generate.single_migrate
|
138
|
+
Souls::Generate.single_migrate(class_name: class_name)
|
134
139
|
when "migrate_all"
|
135
140
|
Souls::Generate.migrate_all
|
136
141
|
when "migration"
|
137
142
|
pluralized_class_name = class_name.underscore.pluralize
|
138
|
-
system
|
143
|
+
system("rake db:create_migration NAME=create_#{pluralized_class_name}")
|
139
144
|
when "update"
|
140
|
-
Souls::Generate.update_delete
|
141
|
-
Souls::Generate.single_migrate
|
145
|
+
Souls::Generate.update_delete(class_name: class_name)
|
146
|
+
Souls::Generate.single_migrate(class_name: class_name)
|
142
147
|
else
|
143
148
|
"SOULs!"
|
144
149
|
end
|
145
150
|
when "d"
|
146
151
|
class_name = ARGV[1]
|
147
|
-
Souls::Generate.delete_all
|
152
|
+
Souls::Generate.delete_all(class_name: class_name)
|
148
153
|
when "db:create"
|
149
154
|
rack_env = ARGV[1]
|
150
155
|
case rack_env
|
151
156
|
when "RACK_ENV=production"
|
152
|
-
system
|
157
|
+
system("rake db:create RACK_ENV=production")
|
153
158
|
else
|
154
|
-
system
|
159
|
+
system("rake db:create && rake db:create RACK_ENV=test")
|
155
160
|
end
|
156
161
|
when "db:migrate"
|
157
162
|
rack_env = ARGV[1]
|
158
163
|
case rack_env
|
159
164
|
when "RACK_ENV=production"
|
160
|
-
system
|
165
|
+
system("rake db:migrate RACK_ENV=production")
|
161
166
|
else
|
162
|
-
system
|
167
|
+
system("rake db:migrate && rake db:migrate RACK_ENV=test")
|
163
168
|
end
|
164
169
|
when "db:seed"
|
165
170
|
rack_env = ARGV[1]
|
166
171
|
case rack_env
|
167
172
|
when "RACK_ENV=production"
|
168
|
-
system
|
173
|
+
system("rake db:seed RACK_ENV=production")
|
169
174
|
else
|
170
|
-
system
|
175
|
+
system("rake db:seed")
|
171
176
|
end
|
172
177
|
when "db:migrate:reset"
|
173
178
|
rack_env = ARGV[1]
|
174
179
|
case rack_env
|
175
180
|
when "RACK_ENV=production"
|
176
|
-
system
|
181
|
+
system("rake db:migrate:reset RACK_ENV=production DISABLE_DATABASE_ENVIRONMENT_CHECK=1")
|
177
182
|
else
|
178
|
-
system
|
183
|
+
system("rake db:migrate:reset && rake db:migrate:reset RACK_ENV=test")
|
179
184
|
end
|
180
185
|
when "db:update"
|
181
186
|
strain = Souls.configuration.strain
|
@@ -185,22 +190,22 @@ begin
|
|
185
190
|
when "worker"
|
186
191
|
other_app = Souls.configuration.api_name
|
187
192
|
else
|
188
|
-
raise
|
193
|
+
raise(StandardError, "Unknown app name!")
|
189
194
|
end
|
190
|
-
system
|
191
|
-
system
|
195
|
+
system("rm -rf ../#{other_app}/db/*")
|
196
|
+
system("cp -r ./db/* ../#{other_app}/db/*")
|
192
197
|
when "t", "test"
|
193
|
-
system
|
194
|
-
system
|
198
|
+
system("rubocop -a")
|
199
|
+
system("bundle exec rspec")
|
195
200
|
when "run"
|
196
|
-
system
|
197
|
-
system
|
201
|
+
system("docker build . -t souls -f Dockerfile.dev")
|
202
|
+
system("docker run --rm --env-file .env -p 3000:3000 souls:latest")
|
198
203
|
when "deploy"
|
199
204
|
project_id = Souls.configuration.project_id
|
200
|
-
system
|
205
|
+
system("gcloud builds submit --config=cloudbuild.yml --project #{project_id}")
|
201
206
|
else
|
202
|
-
puts
|
207
|
+
puts(Paint["Welcome to SOULs!", :green])
|
203
208
|
end
|
204
|
-
rescue StandardError =>
|
205
|
-
puts
|
209
|
+
rescue StandardError => e
|
210
|
+
puts(Paint[e, :red])
|
206
211
|
end
|