souls 0.23.3 → 0.23.7

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: 4c6c49b43b4d3a645d9d7eab40a7c1ea026d070ae39e271bfbe7f9ea7d65e96c
4
- data.tar.gz: 8765eed4824d76a38e81b3c8f2d433f4c9986f1faef00185a199ba64c4375eac
3
+ metadata.gz: 4ef86159c8d1ad6c8801122b80b58937274879225668865f5c21da4654e4a076
4
+ data.tar.gz: 33f24d59216616940228f0c8409e6d99341a0066c21c43905045a7b456ae0cb0
5
5
  SHA512:
6
- metadata.gz: a47fa0976ca85c201410354c5ea8c084594db000fe3c1d9ef74db72f03a539736975ba108a0656c244ea4987aa512a7ef19dd21c7644234d488c80b5c9208f43
7
- data.tar.gz: aab9cf1284aa94d320759535025cb651da5997d8306f67a1c84ab9510bbbb4213fac2b9a7b1cb8f5017f7a7587dedb252f2a7a1e029fb2a742aa84fda68adbb0
6
+ metadata.gz: 3eedc0abbc08ce885f149ef755c4ad8e6ec961921a0e3cf84cb825b04fadf2ad2979a2d6c6d2a47472b43d5fad7b10ff3d36d29e0574f3a0c91a374a20cd7689
7
+ data.tar.gz: 869475fd3569b722a1c8ef87fe77fe27425c80225ff4e4deab18d550d0ff0c16f860d2054c31dc790dd01298adc4b4214b68d77668be22ca526f1e9447fa2f02
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/AndOr:
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/ClassAndModuleChildren:
8
- Enabled: false
20
+ Style/TopLevelMethodDefinition:
21
+ Exclude:
22
+ - "db/seeds.rb"
23
+ - "spec/spec_helper.rb"
9
24
 
10
- Style/AsciiComments:
11
- Enabled: false
25
+ Style/IpAddresses:
26
+ Exclude:
27
+ - "config.ru"
28
+ - "Gemfile"
12
29
 
13
- Style/SymbolArray:
14
- Enabled: false
30
+ Style/HashSyntax:
31
+ EnforcedStyle: ruby19
32
+ Exclude:
33
+ - "**/*.rake"
34
+ - "Rakefile"
15
35
 
16
- Style/WordArray:
17
- Enabled: false
36
+ Style/Semicolon:
37
+ Exclude:
38
+ - "spec/**/*"
18
39
 
19
- Style/MixinGrouping:
20
- Enabled: false
40
+ Style/StringLiterals:
41
+ EnforcedStyle: double_quotes
21
42
 
22
- Style/RescueStandardError:
43
+ Style/ClassVars:
44
+ Exclude:
45
+ - "spec/spec_helper.rb"
46
+ Style/StringConcatenation:
23
47
  Enabled: false
24
48
 
25
- Style/MethodCallWithArgsParentheses:
49
+ Style/Documentation:
26
50
  Enabled: false
27
51
 
28
52
  Style/DocumentationMethod:
29
53
  Enabled: false
30
54
 
31
- Style/CollectionMethods:
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
- Lint/ConstantResolution:
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/queries/*.rb"
71
- - "*.gemspec"
72
-
73
- Style/GuardClause:
74
- MinBodyLength: 5
68
+ - "spec/**/*.rb"
75
69
 
76
- Style/HashSyntax:
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/PreferredHashMethods:
87
- EnforcedStyle: short
88
-
89
- Style/Lambda:
73
+ Style/FormatString:
90
74
  Enabled: false
91
75
 
92
- Style/NumericLiterals:
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/FrozenStringLiteralComment:
79
+ Style/FormatStringToken:
102
80
  Enabled: false
103
81
 
104
- Style/RedundantReturn:
105
- AllowMultipleReturnValues: true
106
-
107
- Style/RedundantArgument:
82
+ Style/ClassMethodsDefinitions:
108
83
  Enabled: false
109
84
 
110
- Style/Semicolon:
85
+ Layout/ExtraSpacing:
111
86
  Exclude:
112
- - "spec/**/*"
87
+ - "db/migrate/*.rb"
113
88
 
114
- Style/SignalException:
115
- EnforcedStyle: only_raise
89
+ Layout/LineLength:
90
+ Exclude:
91
+ - "lib/souls/generate/rspec_mutation.rb"
92
+ - "lib/souls/generate/resolver.rb"
116
93
 
117
- Style/MethodDefParentheses:
94
+ Layout/LineEndStringConcatenationIndentation:
118
95
  Enabled: false
119
96
 
120
- Style/StringLiterals:
121
- EnforcedStyle: double_quotes
122
-
123
- Style/StringLiteralsInInterpolation:
97
+ GraphQL/ObjectDescription:
124
98
  Enabled: false
125
99
 
126
- Style/SingleLineBlockParams:
100
+ GraphQL/FieldDescription:
127
101
  Enabled: false
128
102
 
129
- Lint/UnderscorePrefixedVariableName:
103
+ GraphQL/ArgumentDescription:
130
104
  Enabled: false
131
105
 
132
- Lint/UnusedMethodArgument:
106
+ GraphQL/ExtractInputType:
133
107
  Enabled: false
134
108
 
109
+ GraphQL/ExtractType:
110
+ Enabled: false
135
111
 
136
- Metrics/AbcSize:
112
+ GraphQL/ArgumentName:
137
113
  Enabled: false
138
114
 
139
- Metrics/CyclomaticComplexity:
140
- Max: 40
115
+ Lint/ConstantResolution:
116
+ Enabled: false
141
117
 
142
- Metrics/PerceivedComplexity:
118
+ Lint/NumberConversion:
143
119
  Enabled: false
144
120
 
145
- Metrics/BlockLength:
121
+ Lint/MissingSuper:
146
122
  Enabled: false
147
123
 
148
- Layout/LineLength:
124
+ Metrics/AbcSize:
149
125
  Enabled: false
150
-
151
126
 
152
127
  Metrics/MethodLength:
153
128
  Enabled: false
154
129
 
155
- Metrics/ClassLength:
130
+ Metrics/BlockLength:
156
131
  Enabled: false
157
132
 
158
- Naming/HeredocDelimiterNaming:
159
- Enabled: false
133
+ Metrics/CyclomaticComplexity:
134
+ Enabled: false
160
135
 
161
- Naming/AccessorMethodName:
136
+ Metrics/PerceivedComplexity:
162
137
  Enabled: false
163
138
 
164
139
  Metrics/ModuleLength:
165
140
  Enabled: false
166
141
 
167
- Lint/UnusedBlockArgument:
142
+ Metrics/BlockNesting:
168
143
  Enabled: false
169
144
 
170
- Lint/RescueException:
145
+ Naming/AccessorMethodName:
171
146
  Enabled: false
172
147
 
173
- Naming/RescuedExceptionsVariableName:
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
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- souls (0.23.3)
4
+ souls (0.23.6)
5
5
  paint (= 2.2.1)
6
6
  whirly (= 0.3.0)
7
7
 
data/README.md CHANGED
@@ -21,29 +21,38 @@
21
21
 
22
22
  Welcome to SOULs Framework!
23
23
 
24
- SOULs is a Serverless Application Framework. SOULs has four strains, API, Worker, Console, Media, and can be used in combination according to the purpose. SOULs Backend GraphQL Ruby & Frontend Relay are Scalable and Easy to deploy to Google Cloud and Amazon Web Services
25
- You can focus on business logic. No more infra problems.
24
+ SOULs is a Serverless Application Framework.
25
+ SOULs has six strains, API, Worker, Console, Admin, Media, Doc, and can be used in combination according to the purpose. SOULs Backend GraphQL Ruby & Frontend Relay are Scalable and Easy to deploy to Google Cloud.
26
+ You can focus on your business logic. No more infra problems.
26
27
 
27
- SOULs creates 4 types of framework.
28
+ SOULs creates 6 types of framework.
28
29
 
29
30
  1. API - GraphQL (Ruby) - Simple API - Cloud Run
30
31
  2. Worker - Google Pub/Sub Worker API (Ruby) - Cloud Run
31
- 3. Media Web Client - Media web client with SSG (TypeScript)
32
+ 3. Console Web Client - User Console and CMS (TypeScript)
32
33
  4. Admin Web Client - Admin Console and CMS (TypeScript)
34
+ 5. Media Web Client - Media web client with SSG (TypeScript)
35
+ 6. Doc Web Client - Doc web client with SSG (TypeScript)
33
36
 
34
37
  ## Dependency
35
38
 
36
39
  - [Google SDK](https://cloud.google.com/sdk/docs)
37
40
  - [Docker](https://www.docker.com/)
38
41
  - [Firebase CLI](https://firebase.google.com/docs/cli)
42
+ - [Ruby](https://www.ruby-lang.org)
39
43
 
40
44
  ## Cloud Infrastructure
41
45
 
42
- - [Google Kubernetes Engine](https://cloud.google.com/kubernetes-engine)
43
- - [Google Traffic Director](https://cloud.google.com/traffic-director)
44
46
  - [Google Cloud Run](https://cloud.google.com/run)
47
+ - [Google Cloud SQL](https://cloud.google.com/sql)
48
+ - [Google Cloud Pub/Sub](https://cloud.google.com/pubsub)
49
+ - [Google Cloud Storage](https://cloud.google.com/run)
50
+ - [Google Cloud IAM](https://cloud.google.com/iam)
51
+ - [Google Cloud DNS](https://cloud.google.com/dns)
52
+ - [Google Cloud Container Registry](https://cloud.google.com/container-registry)
45
53
  - [Google Firebase](https://firebase.google.com/)
46
54
  - [Google Cloud Scheduler](https://cloud.google.com/scheduler)
55
+ - [Github Actions](https://github.com/features/actions)
47
56
 
48
57
  ## Installation
49
58
 
@@ -67,10 +76,13 @@ And Create Your APP
67
76
 
68
77
  ### Choose SOULs Type:
69
78
 
70
- 1. API
71
- 2. Worker
72
- 3. Media Web
73
- 4. Admin Web
79
+ Select Strain:
80
+ 1. SOULs GraphQL API
81
+ 2. SOULs Worker
82
+ 3. SOULs Console Web
83
+ 4. SOULs Admin Web
84
+ 5. SOULs Media Web
85
+ 6. SOULs Doc Web
74
86
 
75
87
 
76
88
  ## SOULs Document
@@ -81,7 +93,7 @@ And Create Your APP
81
93
 
82
94
  ## Development
83
95
 
84
- After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
96
+ After checking out the repo, run `bin/setup` to install dependencies. Then, run `souls t` to run the tests. You can also run `souls c` for an interactive prompt that will allow you to experiment.
85
97
 
86
98
  To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org/gems/souls).
87
99
 
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 "#{file_path}#{f}.rb"
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 "#{file_path}#{f}_spec.rb"
20
+ FileUtils.touch("#{file_path}#{f}_spec.rb")
21
21
  end
22
22
  end
23
23
  end
data/exe/souls CHANGED
@@ -1,81 +1,82 @@
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" || ARGV[0] == "deploy"
5
- rescue
6
- puts "Make sure you are at SOULs APP directory!"
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 = ["api", "worker", "console", "admin", "media"]
12
+ STRAINS = %w[api worker console admin media doc].freeze
13
13
  app_name = ARGV[1]
14
14
  if app_name.nil?
15
- puts Paint["you need to specify your app name", :red]
16
- puts Paint["`souls new app_name`", :yellow]
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 % [
20
- "Select Strain: %{red_text} %{yellow_text} %{green_text} %{blue_text} %{cyan_text}",
20
+ "Select Strain: %{red_text} %{yellow_text} %{green_text} %{blue_text} %{cyan_text} %{magenda_text}",
21
21
  :white,
22
22
  {
23
23
  red_text: ["\n1. SOULs GraphQL API", :red],
24
- yellow_text: ["\n2. SOULs Worker", :yellow],
24
+ yellow_text: ["\n2. SOULs Pub/Sub Worker", :yellow],
25
25
  green_text: ["\n3. SOULs Console Web", :green],
26
26
  blue_text: ["\n4. SOULs Admin Web", :blue],
27
- cyan_text: ["\n5. SOULs Media Web", :cyan]
27
+ cyan_text: ["\n5. SOULs Media Web", :cyan],
28
+ magenda_text: ["\n6. SOULs Doc Web", :magenda]
28
29
  }
29
30
  ]
30
- puts first_message
31
- strain = STDIN.gets.chomp.to_i
31
+ puts(first_message)
32
+ strain = $stdin.gets.chomp.to_i
32
33
  case strain
33
34
  when 1, 2
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]
35
+ Souls::Init.download_souls(app_name: app_name, repository_name: "souls_#{STRAINS[strain.to_i - 1]}")
36
+ Souls::Init.initial_config_init(app_name: app_name, strain: STRAINS[strain.to_i - 1])
36
37
  else
37
- puts Paint["Coming Soon...", :blue]
38
+ puts(Paint["Coming Soon...", :blue])
38
39
  end
39
40
  when "s", "server"
40
41
  strain = Souls.configuration.strain
41
42
  case strain
42
- when "media", "admin", "console"
43
- system "yarn dev"
43
+ when "media", "admin", "console", "doc"
44
+ system("yarn dev")
44
45
  when "worker"
45
- system "bundle exec puma -p 3000 -e development"
46
+ system("bundle exec puma -p 3000 -e development")
46
47
  else
47
- system "foreman start -f Procfile.dev"
48
+ system("foreman start -f Procfile.dev")
48
49
  end
49
50
  when "c", "console"
50
51
  strain = Souls.configuration.strain
51
52
  case strain
52
- when "media", "admin"
53
- system "yarn dev"
53
+ when "media", "admin", "console", "doc"
54
+ system("yarn dev")
54
55
  else
55
56
  rack_env = ARGV[1]
56
57
  case rack_env
57
58
  when "RACK_ENV=production"
58
- system "RACK_ENV=production bundle exec irb"
59
+ system("RACK_ENV=production bundle exec irb")
59
60
  else
60
- system "bundle exec irb"
61
+ system("bundle exec irb")
61
62
  end
62
63
  end
63
64
  when "i", "infra"
64
65
  send_method = ARGV[1]
65
- Souls.send send_method
66
+ Souls.public_send(send_method)
66
67
  when "gcloud"
67
68
  status = Paint["Running Gcloud Commands...", :yellow]
68
- Whirly.start spinner: "clock", interval: 420, stop: "🎉" do
69
+ Whirly.start(spinner: "clock", interval: 420, stop: "🎉") do
69
70
  Whirly.status = status
70
71
  send_method = ARGV[1]
71
- Souls::Gcloud.send send_method
72
+ Souls::Gcloud.public_send(send_method)
72
73
  Whirly.status = "Done!"
73
74
  end
74
75
  when "-v", "--version"
75
- puts Paint[Souls::VERSION, :white]
76
+ puts(Paint[Souls::VERSION, :white])
76
77
  when "gem:update", "gemfile:update"
77
78
  status = Paint["Checking for updates...", :yellow]
78
- Whirly.start spinner: "clock", interval: 420, stop: "🎉" do
79
+ Whirly.start(spinner: "clock", interval: 420, stop: "🎉") do
79
80
  Whirly.status = status
80
81
  Souls.update_gemfile
81
82
  Whirly.status = "Done!"
@@ -84,17 +85,17 @@ begin
84
85
  graphql_class = ARGV[1]
85
86
  case graphql_class
86
87
  when "mutation"
87
- Souls::Init.add_mutation class_name: "user", file_name: "hoi"
88
+ Souls::Init.add_mutation(class_name: "user", file_name: "hoi")
88
89
  when "type"
89
- Souls::Init.add_type class_name: "user", file_name: "hoi"
90
+ Souls::Init.add_type(class_name: "user", file_name: "hoi")
90
91
  when "connection"
91
- Souls::Init.add_connection class_name: "user", file_name: "hoi"
92
+ Souls::Init.add_connection(class_name: "user", file_name: "hoi")
92
93
  when "edge"
93
- Souls::Init.add_edge class_name: "user", file_name: "hoi"
94
+ Souls::Init.add_edge(class_name: "user", file_name: "hoi")
94
95
  when "rspec_mutation"
95
- Souls::Init.add_rspec_mutation class_name: "user", file_name: "hoi"
96
+ Souls::Init.add_rspec_mutation(class_name: "user", file_name: "hoi")
96
97
  else
97
- puts Paint["Wrong Argument!", :red]
98
+ puts(Paint["Wrong Argument!", :red])
98
99
  end
99
100
  when "g", "generate"
100
101
  graphql_class = ARGV[1]
@@ -103,84 +104,84 @@ begin
103
104
  when "test_dir"
104
105
  Souls::Generate.test_dir
105
106
  when "model"
106
- Souls::Generate.model class_name: class_name
107
+ Souls::Generate.model(class_name: class_name)
107
108
  when "mutation"
108
- Souls::Generate.mutation class_name: class_name
109
+ Souls::Generate.mutation(class_name: class_name)
109
110
  when "query"
110
- Souls::Generate.query class_name: class_name
111
+ Souls::Generate.query(class_name: class_name)
111
112
  when "type"
112
- Souls::Generate.type class_name: class_name
113
+ Souls::Generate.type(class_name: class_name)
113
114
  when "edge"
114
- Souls::Generate.edge class_name: class_name
115
+ Souls::Generate.edge(class_name: class_name)
115
116
  when "connection"
116
- Souls::Generate.connection class_name: class_name
117
+ Souls::Generate.connection(class_name: class_name)
117
118
  when "resolver"
118
- Souls::Generate.resolver class_name: class_name
119
+ Souls::Generate.resolver(class_name: class_name)
119
120
  when "policy"
120
- Souls::Generate.policy class_name: class_name
121
+ Souls::Generate.policy(class_name: class_name)
121
122
  when "rspec_factory"
122
- Souls::Generate.rspec_factory class_name: class_name
123
+ Souls::Generate.rspec_factory(class_name: class_name)
123
124
  when "rspec_model"
124
- Souls::Generate.rspec_model class_name: class_name
125
+ Souls::Generate.rspec_model(class_name: class_name)
125
126
  when "rspec_mutation"
126
- Souls::Generate.rspec_mutation class_name: class_name
127
+ Souls::Generate.rspec_mutation(class_name: class_name)
127
128
  when "rspec_query"
128
- Souls::Generate.rspec_query class_name: class_name
129
+ Souls::Generate.rspec_query(class_name: class_name)
129
130
  when "rspec_resolver"
130
- Souls::Generate.rspec_resolver class_name: class_name
131
+ Souls::Generate.rspec_resolver(class_name: class_name)
131
132
  when "rspec_policy"
132
- Souls::Generate.rspec_policy class_name: class_name
133
+ Souls::Generate.rspec_policy(class_name: class_name)
133
134
  when "node_type"
134
- Souls::Generate.node_type class_name: class_name
135
+ Souls::Generate.node_type(class_name: class_name)
135
136
  when "job"
136
- Souls::Generate.job class_name: class_name
137
+ Souls::Generate.job(class_name: class_name)
137
138
  when "migrate"
138
- Souls::Generate.single_migrate class_name: class_name
139
+ Souls::Generate.single_migrate(class_name: class_name)
139
140
  when "migrate_all"
140
141
  Souls::Generate.migrate_all
141
142
  when "migration"
142
143
  pluralized_class_name = class_name.underscore.pluralize
143
- system "rake db:create_migration NAME=create_#{pluralized_class_name}"
144
+ system("rake db:create_migration NAME=create_#{pluralized_class_name}")
144
145
  when "update"
145
- Souls::Generate.update_delete class_name: class_name
146
- Souls::Generate.single_migrate class_name: class_name
146
+ Souls::Generate.update_delete(class_name: class_name)
147
+ Souls::Generate.single_migrate(class_name: class_name)
147
148
  else
148
149
  "SOULs!"
149
150
  end
150
151
  when "d"
151
152
  class_name = ARGV[1]
152
- Souls::Generate.delete_all class_name: class_name
153
+ Souls::Generate.delete_all(class_name: class_name)
153
154
  when "db:create"
154
155
  rack_env = ARGV[1]
155
156
  case rack_env
156
157
  when "RACK_ENV=production"
157
- system "rake db:create RACK_ENV=production"
158
+ system("rake db:create RACK_ENV=production")
158
159
  else
159
- system "rake db:create && rake db:create RACK_ENV=test"
160
+ system("rake db:create && rake db:create RACK_ENV=test")
160
161
  end
161
162
  when "db:migrate"
162
163
  rack_env = ARGV[1]
163
164
  case rack_env
164
165
  when "RACK_ENV=production"
165
- system "rake db:migrate RACK_ENV=production"
166
+ system("rake db:migrate RACK_ENV=production")
166
167
  else
167
- system "rake db:migrate && rake db:migrate RACK_ENV=test"
168
+ system("rake db:migrate && rake db:migrate RACK_ENV=test")
168
169
  end
169
170
  when "db:seed"
170
171
  rack_env = ARGV[1]
171
172
  case rack_env
172
173
  when "RACK_ENV=production"
173
- system "rake db:seed RACK_ENV=production"
174
+ system("rake db:seed RACK_ENV=production")
174
175
  else
175
- system "rake db:seed"
176
+ system("rake db:seed")
176
177
  end
177
178
  when "db:migrate:reset"
178
179
  rack_env = ARGV[1]
179
180
  case rack_env
180
181
  when "RACK_ENV=production"
181
- system "rake db:migrate:reset RACK_ENV=production DISABLE_DATABASE_ENVIRONMENT_CHECK=1"
182
+ system("rake db:migrate:reset RACK_ENV=production DISABLE_DATABASE_ENVIRONMENT_CHECK=1")
182
183
  else
183
- system "rake db:migrate:reset && rake db:migrate:reset RACK_ENV=test"
184
+ system("rake db:migrate:reset && rake db:migrate:reset RACK_ENV=test")
184
185
  end
185
186
  when "db:update"
186
187
  strain = Souls.configuration.strain
@@ -190,22 +191,22 @@ begin
190
191
  when "worker"
191
192
  other_app = Souls.configuration.api_name
192
193
  else
193
- raise StandardError, "Unknown app name!"
194
+ raise(StandardError, "Unknown app name!")
194
195
  end
195
- system "rm -rf ../#{other_app}/db/*"
196
- system "cp -r ./db/* ../#{other_app}/db/*"
196
+ system("rm -rf ../#{other_app}/db/*")
197
+ system("cp -r ./db/* ../#{other_app}/db/*")
197
198
  when "t", "test"
198
- system "rubocop -a"
199
- system "bundle exec rspec"
199
+ system("rubocop -a")
200
+ system("bundle exec rspec")
200
201
  when "run"
201
- system "docker build . -t souls -f Dockerfile.dev"
202
- system "docker run --rm --env-file .env -p 3000:3000 souls:latest"
202
+ system("docker build . -t souls -f Dockerfile.dev")
203
+ system("docker run --rm --env-file .env -p 3000:3000 souls:latest")
203
204
  when "deploy"
204
205
  project_id = Souls.configuration.project_id
205
- system "gcloud builds submit --config=cloudbuild.yml --project #{project_id}"
206
+ system("gcloud builds submit --config=cloudbuild.yml --project #{project_id}")
206
207
  else
207
- puts Paint["Welcome to SOULs!", :green]
208
+ puts(Paint["Welcome to SOULs!", :green])
208
209
  end
209
- rescue StandardError => error
210
- puts Paint[error, :red]
210
+ rescue StandardError => e
211
+ puts(Paint[e, :red])
211
212
  end