souls 0.23.5 → 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: e09d9dc9509bac041e641146ab747465b1d4d4dd3cec39833ec857b0f551eb05
4
- data.tar.gz: a120f36e8a70ebdec8ee0c8d89a68b04a927be192d350ffe7e6f42b10a0ad068
3
+ metadata.gz: c9b239d8337484aa068e9a7746e248138dadafa12f7cdcdf04f715c896f94188
4
+ data.tar.gz: a8edefdb6f72c353a76e99807b39ae60882860336bf6cb6fc9d4511bf4ba551f
5
5
  SHA512:
6
- metadata.gz: de868fbe3a0b5ff9999a38350af392c856d2b94727e939fdceee6b735c437985adc47c88cdbb9bef6333d4ed978085c591bd7d199b4dacb1a537c3cff1c20fc6
7
- data.tar.gz: d468bdb5faafe05b2e5b809e4f78027a282a6a5beebaea70c399c0c37ad5d8d41d60fc689dfd3b72bd2f873fef75491d164a9d4fbf352d808cca8a66384042f1
6
+ metadata.gz: '09a772d76110044534c362babea22cabe480686806b6bd5505741b389f69bacdc86dcd72ebcf068e7be0e4c384df1f3218034aa36fac49f8890785be3f212498'
7
+ data.tar.gz: 87caf77681a745b9a5d57e7e5532c2cfe7f15bc0b8d8198c1bbcbbd5d7c67eb208cbd82808ce1d062688ebdd87da691f0221fc8c68ecb5ee483237dde6bf1c08
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.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,55 +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
67
  status = Paint["Running Gcloud Commands...", :yellow]
68
- Whirly.start spinner: "clock", interval: 420, stop: "🎉" do
68
+ Whirly.start(spinner: "clock", interval: 420, stop: "🎉") do
69
69
  Whirly.status = status
70
70
  send_method = ARGV[1]
71
- Souls::Gcloud.send send_method
71
+ Souls::Gcloud.public_send(send_method)
72
72
  Whirly.status = "Done!"
73
73
  end
74
74
  when "-v", "--version"
75
- puts Paint[Souls::VERSION, :white]
75
+ puts(Paint[Souls::VERSION, :white])
76
76
  when "gem:update", "gemfile:update"
77
77
  status = Paint["Checking for updates...", :yellow]
78
- Whirly.start spinner: "clock", interval: 420, stop: "🎉" do
78
+ Whirly.start(spinner: "clock", interval: 420, stop: "🎉") do
79
79
  Whirly.status = status
80
80
  Souls.update_gemfile
81
81
  Whirly.status = "Done!"
@@ -84,17 +84,17 @@ begin
84
84
  graphql_class = ARGV[1]
85
85
  case graphql_class
86
86
  when "mutation"
87
- Souls::Init.add_mutation class_name: "user", file_name: "hoi"
87
+ Souls::Init.add_mutation(class_name: "user", file_name: "hoi")
88
88
  when "type"
89
- Souls::Init.add_type class_name: "user", file_name: "hoi"
89
+ Souls::Init.add_type(class_name: "user", file_name: "hoi")
90
90
  when "connection"
91
- Souls::Init.add_connection class_name: "user", file_name: "hoi"
91
+ Souls::Init.add_connection(class_name: "user", file_name: "hoi")
92
92
  when "edge"
93
- Souls::Init.add_edge class_name: "user", file_name: "hoi"
93
+ Souls::Init.add_edge(class_name: "user", file_name: "hoi")
94
94
  when "rspec_mutation"
95
- Souls::Init.add_rspec_mutation class_name: "user", file_name: "hoi"
95
+ Souls::Init.add_rspec_mutation(class_name: "user", file_name: "hoi")
96
96
  else
97
- puts Paint["Wrong Argument!", :red]
97
+ puts(Paint["Wrong Argument!", :red])
98
98
  end
99
99
  when "g", "generate"
100
100
  graphql_class = ARGV[1]
@@ -103,84 +103,84 @@ begin
103
103
  when "test_dir"
104
104
  Souls::Generate.test_dir
105
105
  when "model"
106
- Souls::Generate.model class_name: class_name
106
+ Souls::Generate.model(class_name: class_name)
107
107
  when "mutation"
108
- Souls::Generate.mutation class_name: class_name
108
+ Souls::Generate.mutation(class_name: class_name)
109
109
  when "query"
110
- Souls::Generate.query class_name: class_name
110
+ Souls::Generate.query(class_name: class_name)
111
111
  when "type"
112
- Souls::Generate.type class_name: class_name
112
+ Souls::Generate.type(class_name: class_name)
113
113
  when "edge"
114
- Souls::Generate.edge class_name: class_name
114
+ Souls::Generate.edge(class_name: class_name)
115
115
  when "connection"
116
- Souls::Generate.connection class_name: class_name
116
+ Souls::Generate.connection(class_name: class_name)
117
117
  when "resolver"
118
- Souls::Generate.resolver class_name: class_name
118
+ Souls::Generate.resolver(class_name: class_name)
119
119
  when "policy"
120
- Souls::Generate.policy class_name: class_name
120
+ Souls::Generate.policy(class_name: class_name)
121
121
  when "rspec_factory"
122
- Souls::Generate.rspec_factory class_name: class_name
122
+ Souls::Generate.rspec_factory(class_name: class_name)
123
123
  when "rspec_model"
124
- Souls::Generate.rspec_model class_name: class_name
124
+ Souls::Generate.rspec_model(class_name: class_name)
125
125
  when "rspec_mutation"
126
- Souls::Generate.rspec_mutation class_name: class_name
126
+ Souls::Generate.rspec_mutation(class_name: class_name)
127
127
  when "rspec_query"
128
- Souls::Generate.rspec_query class_name: class_name
128
+ Souls::Generate.rspec_query(class_name: class_name)
129
129
  when "rspec_resolver"
130
- Souls::Generate.rspec_resolver class_name: class_name
130
+ Souls::Generate.rspec_resolver(class_name: class_name)
131
131
  when "rspec_policy"
132
- Souls::Generate.rspec_policy class_name: class_name
132
+ Souls::Generate.rspec_policy(class_name: class_name)
133
133
  when "node_type"
134
- Souls::Generate.node_type class_name: class_name
134
+ Souls::Generate.node_type(class_name: class_name)
135
135
  when "job"
136
- Souls::Generate.job class_name: class_name
136
+ Souls::Generate.job(class_name: class_name)
137
137
  when "migrate"
138
- Souls::Generate.single_migrate class_name: class_name
138
+ Souls::Generate.single_migrate(class_name: class_name)
139
139
  when "migrate_all"
140
140
  Souls::Generate.migrate_all
141
141
  when "migration"
142
142
  pluralized_class_name = class_name.underscore.pluralize
143
- system "rake db:create_migration NAME=create_#{pluralized_class_name}"
143
+ system("rake db:create_migration NAME=create_#{pluralized_class_name}")
144
144
  when "update"
145
- Souls::Generate.update_delete class_name: class_name
146
- 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)
147
147
  else
148
148
  "SOULs!"
149
149
  end
150
150
  when "d"
151
151
  class_name = ARGV[1]
152
- Souls::Generate.delete_all class_name: class_name
152
+ Souls::Generate.delete_all(class_name: class_name)
153
153
  when "db:create"
154
154
  rack_env = ARGV[1]
155
155
  case rack_env
156
156
  when "RACK_ENV=production"
157
- system "rake db:create RACK_ENV=production"
157
+ system("rake db:create RACK_ENV=production")
158
158
  else
159
- system "rake db:create && rake db:create RACK_ENV=test"
159
+ system("rake db:create && rake db:create RACK_ENV=test")
160
160
  end
161
161
  when "db:migrate"
162
162
  rack_env = ARGV[1]
163
163
  case rack_env
164
164
  when "RACK_ENV=production"
165
- system "rake db:migrate RACK_ENV=production"
165
+ system("rake db:migrate RACK_ENV=production")
166
166
  else
167
- system "rake db:migrate && rake db:migrate RACK_ENV=test"
167
+ system("rake db:migrate && rake db:migrate RACK_ENV=test")
168
168
  end
169
169
  when "db:seed"
170
170
  rack_env = ARGV[1]
171
171
  case rack_env
172
172
  when "RACK_ENV=production"
173
- system "rake db:seed RACK_ENV=production"
173
+ system("rake db:seed RACK_ENV=production")
174
174
  else
175
- system "rake db:seed"
175
+ system("rake db:seed")
176
176
  end
177
177
  when "db:migrate:reset"
178
178
  rack_env = ARGV[1]
179
179
  case rack_env
180
180
  when "RACK_ENV=production"
181
- 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")
182
182
  else
183
- 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")
184
184
  end
185
185
  when "db:update"
186
186
  strain = Souls.configuration.strain
@@ -190,22 +190,22 @@ begin
190
190
  when "worker"
191
191
  other_app = Souls.configuration.api_name
192
192
  else
193
- raise StandardError, "Unknown app name!"
193
+ raise(StandardError, "Unknown app name!")
194
194
  end
195
- system "rm -rf ../#{other_app}/db/*"
196
- system "cp -r ./db/* ../#{other_app}/db/*"
195
+ system("rm -rf ../#{other_app}/db/*")
196
+ system("cp -r ./db/* ../#{other_app}/db/*")
197
197
  when "t", "test"
198
- system "rubocop -a"
199
- system "bundle exec rspec"
198
+ system("rubocop -a")
199
+ system("bundle exec rspec")
200
200
  when "run"
201
- system "docker build . -t souls -f Dockerfile.dev"
202
- 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")
203
203
  when "deploy"
204
204
  project_id = Souls.configuration.project_id
205
- system "gcloud builds submit --config=cloudbuild.yml --project #{project_id}"
205
+ system("gcloud builds submit --config=cloudbuild.yml --project #{project_id}")
206
206
  else
207
- puts Paint["Welcome to SOULs!", :green]
207
+ puts(Paint["Welcome to SOULs!", :green])
208
208
  end
209
- rescue StandardError => error
210
- puts Paint[error, :red]
209
+ rescue StandardError => e
210
+ puts(Paint[e, :red])
211
211
  end