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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 8a95347d836077163916d5bb88b61ebd2742bcc382a0f3841ac2a6d046ef7f2e
4
- data.tar.gz: fd3b16eccd74ff58c20006149f11d1a7bcbc902634a71f150725a1a157e24575
3
+ metadata.gz: c9b239d8337484aa068e9a7746e248138dadafa12f7cdcdf04f715c896f94188
4
+ data.tar.gz: a8edefdb6f72c353a76e99807b39ae60882860336bf6cb6fc9d4511bf4ba551f
5
5
  SHA512:
6
- metadata.gz: 7e8a9024fad728ca3e9cb661a11307ad05e8c68461688800fc9df5994e4eb1559f8e054885f74be32574ea19ec2c382b30edb54569175ebe3220913eb0f30a9d
7
- data.tar.gz: fa216f11fc4fd8d0cd85c408ec930d2c579e48cc98708462c23a81e654f583c346bc4e1a904a20313dde2e1e4be0f7be7adde0eaa12c5d69040f0d4a27fde7f8
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/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.1)
4
+ souls (0.23.6)
5
5
  paint (= 2.2.1)
6
6
  whirly (= 0.3.0)
7
7
 
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,19 +1,19 @@
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].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 % [
@@ -27,50 +27,55 @@ begin
27
27
  cyan_text: ["\n5. SOULs Media Web", :cyan]
28
28
  }
29
29
  ]
30
- puts first_message
31
- strain = STDIN.gets.chomp.to_i
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 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
+ 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 Paint["Coming Soon...", :blue]
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 "yarn dev"
43
+ system("yarn dev")
44
44
  when "worker"
45
- system "bundle exec puma -p 3000 -e development"
45
+ system("bundle exec puma -p 3000 -e development")
46
46
  else
47
- system "foreman start -f Procfile.dev"
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 "yarn dev"
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 "RACK_ENV=production bundle exec irb"
58
+ system("RACK_ENV=production bundle exec irb")
59
59
  else
60
- system "bundle exec irb"
60
+ system("bundle exec irb")
61
61
  end
62
62
  end
63
63
  when "i", "infra"
64
64
  send_method = ARGV[1]
65
- Souls.send send_method
65
+ Souls.public_send(send_method)
66
66
  when "gcloud"
67
- send_method = ARGV[1]
68
- Souls::Gcloud.send send_method
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 Paint[Souls::VERSION, :white]
75
+ puts(Paint[Souls::VERSION, :white])
71
76
  when "gem:update", "gemfile:update"
72
77
  status = Paint["Checking for updates...", :yellow]
73
- Whirly.start spinner: "clock", interval: 1000, stop: "🎉" do
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 class_name: "user", file_name: "hoi"
87
+ Souls::Init.add_mutation(class_name: "user", file_name: "hoi")
83
88
  when "type"
84
- Souls::Init.add_type class_name: "user", file_name: "hoi"
89
+ Souls::Init.add_type(class_name: "user", file_name: "hoi")
85
90
  when "connection"
86
- Souls::Init.add_connection class_name: "user", file_name: "hoi"
91
+ Souls::Init.add_connection(class_name: "user", file_name: "hoi")
87
92
  when "edge"
88
- Souls::Init.add_edge class_name: "user", file_name: "hoi"
93
+ Souls::Init.add_edge(class_name: "user", file_name: "hoi")
89
94
  when "rspec_mutation"
90
- Souls::Init.add_rspec_mutation class_name: "user", file_name: "hoi"
95
+ Souls::Init.add_rspec_mutation(class_name: "user", file_name: "hoi")
91
96
  else
92
- puts Paint["Wrong Argument!", :red]
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 class_name: class_name
106
+ Souls::Generate.model(class_name: class_name)
102
107
  when "mutation"
103
- Souls::Generate.mutation class_name: class_name
108
+ Souls::Generate.mutation(class_name: class_name)
104
109
  when "query"
105
- Souls::Generate.query class_name: class_name
110
+ Souls::Generate.query(class_name: class_name)
106
111
  when "type"
107
- Souls::Generate.type class_name: class_name
112
+ Souls::Generate.type(class_name: class_name)
108
113
  when "edge"
109
- Souls::Generate.edge class_name: class_name
114
+ Souls::Generate.edge(class_name: class_name)
110
115
  when "connection"
111
- Souls::Generate.connection class_name: class_name
116
+ Souls::Generate.connection(class_name: class_name)
112
117
  when "resolver"
113
- Souls::Generate.resolver class_name: class_name
118
+ Souls::Generate.resolver(class_name: class_name)
114
119
  when "policy"
115
- Souls::Generate.policy class_name: class_name
120
+ Souls::Generate.policy(class_name: class_name)
116
121
  when "rspec_factory"
117
- Souls::Generate.rspec_factory class_name: class_name
122
+ Souls::Generate.rspec_factory(class_name: class_name)
118
123
  when "rspec_model"
119
- Souls::Generate.rspec_model class_name: class_name
124
+ Souls::Generate.rspec_model(class_name: class_name)
120
125
  when "rspec_mutation"
121
- Souls::Generate.rspec_mutation class_name: class_name
126
+ Souls::Generate.rspec_mutation(class_name: class_name)
122
127
  when "rspec_query"
123
- Souls::Generate.rspec_query class_name: class_name
128
+ Souls::Generate.rspec_query(class_name: class_name)
124
129
  when "rspec_resolver"
125
- Souls::Generate.rspec_resolver class_name: class_name
130
+ Souls::Generate.rspec_resolver(class_name: class_name)
126
131
  when "rspec_policy"
127
- Souls::Generate.rspec_policy class_name: class_name
132
+ Souls::Generate.rspec_policy(class_name: class_name)
128
133
  when "node_type"
129
- Souls::Generate.node_type class_name: class_name
134
+ Souls::Generate.node_type(class_name: class_name)
130
135
  when "job"
131
- Souls::Generate.job class_name: class_name
136
+ Souls::Generate.job(class_name: class_name)
132
137
  when "migrate"
133
- Souls::Generate.single_migrate class_name: class_name
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 "rake db:create_migration NAME=create_#{pluralized_class_name}"
143
+ system("rake db:create_migration NAME=create_#{pluralized_class_name}")
139
144
  when "update"
140
- Souls::Generate.update_delete class_name: class_name
141
- Souls::Generate.single_migrate class_name: class_name
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 class_name: class_name
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 "rake db:create RACK_ENV=production"
157
+ system("rake db:create RACK_ENV=production")
153
158
  else
154
- system "rake db:create && rake db:create RACK_ENV=test"
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 "rake db:migrate RACK_ENV=production"
165
+ system("rake db:migrate RACK_ENV=production")
161
166
  else
162
- system "rake db:migrate && rake db:migrate RACK_ENV=test"
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 "rake db:seed RACK_ENV=production"
173
+ system("rake db:seed RACK_ENV=production")
169
174
  else
170
- system "rake db:seed"
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 "rake db:migrate:reset RACK_ENV=production DISABLE_DATABASE_ENVIRONMENT_CHECK=1"
181
+ system("rake db:migrate:reset RACK_ENV=production DISABLE_DATABASE_ENVIRONMENT_CHECK=1")
177
182
  else
178
- system "rake db:migrate:reset && rake db:migrate:reset RACK_ENV=test"
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 StandardError, "Unknown app name!"
193
+ raise(StandardError, "Unknown app name!")
189
194
  end
190
- system "rm -rf ../#{other_app}/db/*"
191
- system "cp -r ./db/* ../#{other_app}/db/*"
195
+ system("rm -rf ../#{other_app}/db/*")
196
+ system("cp -r ./db/* ../#{other_app}/db/*")
192
197
  when "t", "test"
193
- system "rubocop -a"
194
- system "bundle exec rspec"
198
+ system("rubocop -a")
199
+ system("bundle exec rspec")
195
200
  when "run"
196
- system "docker build . -t souls -f Dockerfile.dev"
197
- system "docker run --rm --env-file .env -p 3000:3000 souls:latest"
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 "gcloud builds submit --config=cloudbuild.yml --project #{project_id}"
205
+ system("gcloud builds submit --config=cloudbuild.yml --project #{project_id}")
201
206
  else
202
- puts Paint["Welcome to SOULs!", :green]
207
+ puts(Paint["Welcome to SOULs!", :green])
203
208
  end
204
- rescue StandardError => error
205
- puts Paint[error, :red]
209
+ rescue StandardError => e
210
+ puts(Paint[e, :red])
206
211
  end