souls 0.23.5 → 0.23.9

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: e09d9dc9509bac041e641146ab747465b1d4d4dd3cec39833ec857b0f551eb05
4
- data.tar.gz: a120f36e8a70ebdec8ee0c8d89a68b04a927be192d350ffe7e6f42b10a0ad068
3
+ metadata.gz: 0ac8f535bffb1cffc5cc10019b62891735f888982c000bd50e8412a887983bf5
4
+ data.tar.gz: a5458cc6c2b9f94452a2362f4b62f4e33f98ce5d4e68de038586f9dc0f5ce218
5
5
  SHA512:
6
- metadata.gz: de868fbe3a0b5ff9999a38350af392c856d2b94727e939fdceee6b735c437985adc47c88cdbb9bef6333d4ed978085c591bd7d199b4dacb1a537c3cff1c20fc6
7
- data.tar.gz: d468bdb5faafe05b2e5b809e4f78027a282a6a5beebaea70c399c0c37ad5d8d41d60fc689dfd3b72bd2f873fef75491d164a9d4fbf352d808cca8a66384042f1
6
+ metadata.gz: 27c3d5389d371076afe009ea9839dd23ff97701bf3ef5b901a7d5c80eb01bdb2b76f01cec1ffd771cab42acec5cbe64b2baa74846a68dc982a78c46cef3e752c
7
+ data.tar.gz: e70e36f757202fcc306401e95414de79c671797aeccd27646b2f1b7fdf85552b6f8fcfb7fed0e51d9ecfc55fc1a67bbabe1240e4757349e0e68d36292d425e17
data/.rubocop.yml CHANGED
@@ -1,217 +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:
5
- Enabled: false
6
-
7
- Style/ClassAndModuleChildren:
13
+ Style/Copyright:
14
+ Description: "Include a copyright notice in each file before any code."
8
15
  Enabled: false
16
+ VersionAdded: "0.30"
17
+ Notice: '^Copyright (\(c\) )?2[0-9]{3} .+'
18
+ AutocorrectNotice: "Copyright 2021 by ELSOUL LABO B.V."
9
19
 
10
- Style/AsciiComments:
11
- Enabled: false
20
+ Style/TopLevelMethodDefinition:
21
+ Exclude:
22
+ - "db/seeds.rb"
23
+ - "spec/spec_helper.rb"
12
24
 
13
- Style/SymbolArray:
14
- Enabled: false
25
+ Style/IpAddresses:
26
+ Exclude:
27
+ - "config.ru"
28
+ - "Gemfile"
15
29
 
16
- Style/FormatStringToken:
17
- Enabled: false
30
+ Style/HashSyntax:
31
+ EnforcedStyle: ruby19
32
+ Exclude:
33
+ - "**/*.rake"
34
+ - "Rakefile"
18
35
 
19
- Style/WordArray:
20
- Enabled: false
36
+ Style/Semicolon:
37
+ Exclude:
38
+ - "spec/**/*"
21
39
 
22
- Style/MixinGrouping:
23
- Enabled: false
40
+ Style/StringLiterals:
41
+ EnforcedStyle: double_quotes
24
42
 
25
- Style/RescueStandardError:
43
+ Style/ClassVars:
44
+ Exclude:
45
+ - "spec/spec_helper.rb"
46
+ Style/StringConcatenation:
26
47
  Enabled: false
27
48
 
28
- Style/MethodCallWithArgsParentheses:
49
+ Style/Documentation:
29
50
  Enabled: false
30
51
 
31
52
  Style/DocumentationMethod:
32
53
  Enabled: false
33
54
 
34
- Style/CollectionMethods:
35
- PreferredMethods:
36
- detect: "detect"
37
- find: "detect"
38
- inject: "inject"
39
- reduce: "inject"
40
-
41
- Style/Documentation:
42
- Enabled: false
43
-
44
- Style/DoubleNegation:
55
+ Style/FrozenStringLiteralComment:
45
56
  Enabled: false
57
+ Style/Lambda:
58
+ EnforcedStyle: literal
46
59
 
47
- Lint/ConstantResolution:
60
+ Style/AsciiComments:
48
61
  Enabled: false
49
62
 
50
- Layout/DotPosition:
51
- EnforcedStyle: trailing
52
-
53
-
54
- Layout/EmptyLineAfterGuardClause:
55
- Enabled: false
56
-
57
- Style/EmptyElse:
58
- EnforcedStyle: empty
59
-
60
- Layout/ExtraSpacing:
61
- Exclude:
62
- - "db/migrate/*.rb"
63
- - "*.gemspec"
64
-
65
- Style/FormatString:
66
- EnforcedStyle: percent
67
-
68
63
  Style/MissingElse:
69
64
  Enabled: false
70
65
 
71
66
  Style/StringHashKeys:
72
67
  Exclude:
73
- - "spec/queries/*.rb"
74
- - "*.gemspec"
75
-
76
- Style/GuardClause:
77
- MinBodyLength: 5
78
-
79
- Style/HashSyntax:
80
- EnforcedStyle: ruby19
81
- Exclude:
82
- - "**/*.rake"
83
- - "Rakefile"
84
-
68
+ - "spec/**/*.rb"
85
69
 
86
- Style/IfUnlessModifier:
70
+ Style/CollectionMethods:
87
71
  Enabled: false
88
72
 
89
- Style/PreferredHashMethods:
90
- EnforcedStyle: short
91
-
92
- Style/Lambda:
73
+ Style/FormatString:
93
74
  Enabled: false
94
75
 
95
- Style/NumericLiterals:
96
- MinDigits: 7
97
-
98
- Style/PerlBackrefs:
99
- AutoCorrect: false
100
-
101
- Style/RedundantSelf:
76
+ Style/ClassAndModuleChildren:
102
77
  Enabled: false
103
78
 
104
- Style/FrozenStringLiteralComment:
79
+ Style/FormatStringToken:
105
80
  Enabled: false
106
81
 
107
- Style/RedundantReturn:
108
- AllowMultipleReturnValues: true
109
-
110
- Style/RedundantArgument:
82
+ Style/ClassMethodsDefinitions:
111
83
  Enabled: false
112
84
 
113
- Style/Semicolon:
85
+ Layout/ExtraSpacing:
114
86
  Exclude:
115
- - "spec/**/*"
87
+ - "db/migrate/*.rb"
116
88
 
117
- Style/SignalException:
118
- EnforcedStyle: only_raise
89
+ Layout/LineLength:
90
+ Exclude:
91
+ - "lib/souls/generate/rspec_mutation.rb"
92
+ - "lib/souls/generate/resolver.rb"
119
93
 
120
- Style/MethodDefParentheses:
94
+ Layout/LineEndStringConcatenationIndentation:
121
95
  Enabled: false
122
96
 
123
- Style/StringLiterals:
124
- EnforcedStyle: double_quotes
125
-
126
- Style/StringLiteralsInInterpolation:
97
+ GraphQL/ObjectDescription:
127
98
  Enabled: false
128
99
 
129
- Style/SingleLineBlockParams:
100
+ GraphQL/FieldDescription:
130
101
  Enabled: false
131
102
 
132
- Lint/UnderscorePrefixedVariableName:
103
+ GraphQL/ArgumentDescription:
133
104
  Enabled: false
134
105
 
135
- Lint/UnusedMethodArgument:
106
+ GraphQL/ExtractInputType:
136
107
  Enabled: false
137
108
 
109
+ GraphQL/ExtractType:
110
+ Enabled: false
138
111
 
139
- Metrics/AbcSize:
112
+ GraphQL/ArgumentName:
140
113
  Enabled: false
141
114
 
142
- Metrics/CyclomaticComplexity:
143
- Max: 40
115
+ Lint/ConstantResolution:
116
+ Enabled: false
144
117
 
145
- Metrics/PerceivedComplexity:
118
+ Lint/NumberConversion:
146
119
  Enabled: false
147
120
 
148
- Metrics/BlockLength:
121
+ Lint/MissingSuper:
149
122
  Enabled: false
150
123
 
151
- Layout/LineLength:
124
+ Metrics/AbcSize:
152
125
  Enabled: false
153
-
154
126
 
155
127
  Metrics/MethodLength:
156
128
  Enabled: false
157
129
 
158
- Metrics/ClassLength:
130
+ Metrics/BlockLength:
159
131
  Enabled: false
160
132
 
161
- Naming/HeredocDelimiterNaming:
162
- Enabled: false
133
+ Metrics/CyclomaticComplexity:
134
+ Enabled: false
163
135
 
164
- Naming/AccessorMethodName:
136
+ Metrics/PerceivedComplexity:
165
137
  Enabled: false
166
138
 
167
139
  Metrics/ModuleLength:
168
140
  Enabled: false
169
141
 
170
- Lint/UnusedBlockArgument:
142
+ Metrics/BlockNesting:
171
143
  Enabled: false
172
144
 
173
- Lint/RescueException:
145
+ Naming/AccessorMethodName:
174
146
  Enabled: false
175
147
 
176
- Naming/RescuedExceptionsVariableName:
148
+ Naming/PredicateName:
177
149
  Enabled: false
178
150
 
179
151
  Bundler/GemComment:
180
- Enabled: false
181
-
182
- Style/SafeNavigation:
183
- Enabled: false
184
-
185
- Lint/NumberConversion:
186
- Enabled: false
187
- Style/ConstantVisibility:
188
- Enabled: false
189
- Style/MutableConstant:
190
- Enabled: false
191
- Style/Copyright:
192
- Enabled: false
193
- Style/MultilineTernaryOperator:
194
- Enabled: false
195
- Layout/MultilineAssignmentLayout:
196
- Enabled: false
197
- Style/Send:
198
- Enabled: false
199
- Style/RedundantFileExtensionInRequire:
200
- Enabled: false
201
- Style/ClassMethodsDefinitions:
202
- Enabled: false
203
- Style/GlobalStdStream:
204
- Enabled: false
205
- Layout/IndentationConsistency:
206
- Enabled: false
207
- Layout/IndentationWidth:
208
- Enabled: false
209
- Style/DateTime:
210
- Enabled: false
211
- Layout/HeredocIndentation:
212
- Exclude:
213
- - "lib/souls/init.rb"
214
- Style/RaiseArgs:
215
- Enabled: false
216
- Metrics/BlockNesting:
217
152
  Enabled: false
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- souls (0.23.5)
4
+ souls (0.23.8)
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/config/souls.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  Souls.configure do |config|
2
2
  config.app = "souls-app"
3
- config.project_id = "souls-app"
3
+ config.project_id = "el-soul"
4
4
  config.strain = "api"
5
5
  end
data/exe/souls CHANGED
@@ -1,81 +1,97 @@
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} %{magenta_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
+ magenta_text: ["\n6. SOULs Doc Web", :magenta]
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
+
73
+ case send_method
74
+ when "create_pubsub_topic"
75
+ topic_name = ARGV[2]
76
+ args = { topic_name: topic_name }
77
+ Souls::Gcloud.public_send(send_method, args)
78
+ when "create_pubsub_subscription"
79
+ project_id = Souls.configuration.project_id
80
+ topic_name = ARGV[2]
81
+ service_account = "#{Souls.configuration.app}@#{project_id}iam.gserviceaccount.com"
82
+ endpoint = Souls.configuration.endpoint
83
+ args = { project_id: project_id, topic_name: topic_name, service_account: service_account, endpoint: endpoint }
84
+ Souls::Gcloud.public_send(send_method, args)
85
+ else
86
+ Souls::Gcloud.public_send(send_method)
87
+ end
72
88
  Whirly.status = "Done!"
73
89
  end
74
90
  when "-v", "--version"
75
- puts Paint[Souls::VERSION, :white]
91
+ puts(Paint[Souls::VERSION, :white])
76
92
  when "gem:update", "gemfile:update"
77
93
  status = Paint["Checking for updates...", :yellow]
78
- Whirly.start spinner: "clock", interval: 420, stop: "🎉" do
94
+ Whirly.start(spinner: "clock", interval: 420, stop: "🎉") do
79
95
  Whirly.status = status
80
96
  Souls.update_gemfile
81
97
  Whirly.status = "Done!"
@@ -84,17 +100,17 @@ begin
84
100
  graphql_class = ARGV[1]
85
101
  case graphql_class
86
102
  when "mutation"
87
- Souls::Init.add_mutation class_name: "user", file_name: "hoi"
103
+ Souls::Init.add_mutation(class_name: "user", file_name: "hoi")
88
104
  when "type"
89
- Souls::Init.add_type class_name: "user", file_name: "hoi"
105
+ Souls::Init.add_type(class_name: "user", file_name: "hoi")
90
106
  when "connection"
91
- Souls::Init.add_connection class_name: "user", file_name: "hoi"
107
+ Souls::Init.add_connection(class_name: "user", file_name: "hoi")
92
108
  when "edge"
93
- Souls::Init.add_edge class_name: "user", file_name: "hoi"
109
+ Souls::Init.add_edge(class_name: "user", file_name: "hoi")
94
110
  when "rspec_mutation"
95
- Souls::Init.add_rspec_mutation class_name: "user", file_name: "hoi"
111
+ Souls::Init.add_rspec_mutation(class_name: "user", file_name: "hoi")
96
112
  else
97
- puts Paint["Wrong Argument!", :red]
113
+ puts(Paint["Wrong Argument!", :red])
98
114
  end
99
115
  when "g", "generate"
100
116
  graphql_class = ARGV[1]
@@ -103,84 +119,84 @@ begin
103
119
  when "test_dir"
104
120
  Souls::Generate.test_dir
105
121
  when "model"
106
- Souls::Generate.model class_name: class_name
122
+ Souls::Generate.model(class_name: class_name)
107
123
  when "mutation"
108
- Souls::Generate.mutation class_name: class_name
124
+ Souls::Generate.mutation(class_name: class_name)
109
125
  when "query"
110
- Souls::Generate.query class_name: class_name
126
+ Souls::Generate.query(class_name: class_name)
111
127
  when "type"
112
- Souls::Generate.type class_name: class_name
128
+ Souls::Generate.type(class_name: class_name)
113
129
  when "edge"
114
- Souls::Generate.edge class_name: class_name
130
+ Souls::Generate.edge(class_name: class_name)
115
131
  when "connection"
116
- Souls::Generate.connection class_name: class_name
132
+ Souls::Generate.connection(class_name: class_name)
117
133
  when "resolver"
118
- Souls::Generate.resolver class_name: class_name
134
+ Souls::Generate.resolver(class_name: class_name)
119
135
  when "policy"
120
- Souls::Generate.policy class_name: class_name
136
+ Souls::Generate.policy(class_name: class_name)
121
137
  when "rspec_factory"
122
- Souls::Generate.rspec_factory class_name: class_name
138
+ Souls::Generate.rspec_factory(class_name: class_name)
123
139
  when "rspec_model"
124
- Souls::Generate.rspec_model class_name: class_name
140
+ Souls::Generate.rspec_model(class_name: class_name)
125
141
  when "rspec_mutation"
126
- Souls::Generate.rspec_mutation class_name: class_name
142
+ Souls::Generate.rspec_mutation(class_name: class_name)
127
143
  when "rspec_query"
128
- Souls::Generate.rspec_query class_name: class_name
144
+ Souls::Generate.rspec_query(class_name: class_name)
129
145
  when "rspec_resolver"
130
- Souls::Generate.rspec_resolver class_name: class_name
146
+ Souls::Generate.rspec_resolver(class_name: class_name)
131
147
  when "rspec_policy"
132
- Souls::Generate.rspec_policy class_name: class_name
148
+ Souls::Generate.rspec_policy(class_name: class_name)
133
149
  when "node_type"
134
- Souls::Generate.node_type class_name: class_name
150
+ Souls::Generate.node_type(class_name: class_name)
135
151
  when "job"
136
- Souls::Generate.job class_name: class_name
152
+ Souls::Generate.job(class_name: class_name)
137
153
  when "migrate"
138
- Souls::Generate.single_migrate class_name: class_name
154
+ Souls::Generate.single_migrate(class_name: class_name)
139
155
  when "migrate_all"
140
156
  Souls::Generate.migrate_all
141
157
  when "migration"
142
158
  pluralized_class_name = class_name.underscore.pluralize
143
- system "rake db:create_migration NAME=create_#{pluralized_class_name}"
159
+ system("rake db:create_migration NAME=create_#{pluralized_class_name}")
144
160
  when "update"
145
- Souls::Generate.update_delete class_name: class_name
146
- Souls::Generate.single_migrate class_name: class_name
161
+ Souls::Generate.update_delete(class_name: class_name)
162
+ Souls::Generate.single_migrate(class_name: class_name)
147
163
  else
148
164
  "SOULs!"
149
165
  end
150
166
  when "d"
151
167
  class_name = ARGV[1]
152
- Souls::Generate.delete_all class_name: class_name
168
+ Souls::Generate.delete_all(class_name: class_name)
153
169
  when "db:create"
154
170
  rack_env = ARGV[1]
155
171
  case rack_env
156
172
  when "RACK_ENV=production"
157
- system "rake db:create RACK_ENV=production"
173
+ system("rake db:create RACK_ENV=production")
158
174
  else
159
- system "rake db:create && rake db:create RACK_ENV=test"
175
+ system("rake db:create && rake db:create RACK_ENV=test")
160
176
  end
161
177
  when "db:migrate"
162
178
  rack_env = ARGV[1]
163
179
  case rack_env
164
180
  when "RACK_ENV=production"
165
- system "rake db:migrate RACK_ENV=production"
181
+ system("rake db:migrate RACK_ENV=production")
166
182
  else
167
- system "rake db:migrate && rake db:migrate RACK_ENV=test"
183
+ system("rake db:migrate && rake db:migrate RACK_ENV=test")
168
184
  end
169
185
  when "db:seed"
170
186
  rack_env = ARGV[1]
171
187
  case rack_env
172
188
  when "RACK_ENV=production"
173
- system "rake db:seed RACK_ENV=production"
189
+ system("rake db:seed RACK_ENV=production")
174
190
  else
175
- system "rake db:seed"
191
+ system("rake db:seed")
176
192
  end
177
193
  when "db:migrate:reset"
178
194
  rack_env = ARGV[1]
179
195
  case rack_env
180
196
  when "RACK_ENV=production"
181
- system "rake db:migrate:reset RACK_ENV=production DISABLE_DATABASE_ENVIRONMENT_CHECK=1"
197
+ system("rake db:migrate:reset RACK_ENV=production DISABLE_DATABASE_ENVIRONMENT_CHECK=1")
182
198
  else
183
- system "rake db:migrate:reset && rake db:migrate:reset RACK_ENV=test"
199
+ system("rake db:migrate:reset && rake db:migrate:reset RACK_ENV=test")
184
200
  end
185
201
  when "db:update"
186
202
  strain = Souls.configuration.strain
@@ -190,22 +206,22 @@ begin
190
206
  when "worker"
191
207
  other_app = Souls.configuration.api_name
192
208
  else
193
- raise StandardError, "Unknown app name!"
209
+ raise(StandardError, "Unknown app name!")
194
210
  end
195
- system "rm -rf ../#{other_app}/db/*"
196
- system "cp -r ./db/* ../#{other_app}/db/*"
211
+ system("rm -rf ../#{other_app}/db/*")
212
+ system("cp -r ./db/* ../#{other_app}/db/*")
197
213
  when "t", "test"
198
- system "rubocop -a"
199
- system "bundle exec rspec"
214
+ system("rubocop -a")
215
+ system("bundle exec rspec")
200
216
  when "run"
201
- system "docker build . -t souls -f Dockerfile.dev"
202
- system "docker run --rm --env-file .env -p 3000:3000 souls:latest"
217
+ system("docker build . -t souls -f Dockerfile.dev")
218
+ system("docker run --rm --env-file .env -p 3000:3000 souls:latest")
203
219
  when "deploy"
204
220
  project_id = Souls.configuration.project_id
205
- system "gcloud builds submit --config=cloudbuild.yml --project #{project_id}"
221
+ system("gcloud builds submit --config=cloudbuild.yml --project #{project_id}")
206
222
  else
207
- puts Paint["Welcome to SOULs!", :green]
223
+ puts(Paint["Welcome to SOULs!", :green])
208
224
  end
209
- rescue StandardError => error
210
- puts Paint[error, :red]
225
+ rescue StandardError => e
226
+ puts(Paint[e, :red])
211
227
  end