souls 1.7.21 → 1.7.24

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 7f1736fff66eb0bdd349eafd3b60078309b0e51389223376f783ed21fb97c0bc
4
- data.tar.gz: 50c2333fae0fd7e94ff18661990df02b059e385e76cad90d7886643285ba3b69
3
+ metadata.gz: c731aa9244ceb825af39c837fe0be223a8b6d1df9a64cbb16a3767d0650c8147
4
+ data.tar.gz: 30814435a8d524bc1021bfa2a31dcb88f9f9f4fc373b8d17c219d9ca9b0744a9
5
5
  SHA512:
6
- metadata.gz: bc8113fde23630ec893dec10fabafaf611c5cdd67c02447f79ce934ba114a63c8a6011553dafd62ca367ddcd50ab6657d5eaa33751bf5198a89e100e61dafbdd
7
- data.tar.gz: 22447d85e057a9221bcdae949f5504bbdfdfe14caa32d0290f800ca47d1d148eadf228c140d29e9c6cb4ae61ebcee2762cd3018322add8967d1379e8b2954e8a
6
+ metadata.gz: 153d93623299b56bbf5e51d343165e7e99025ab5f04cff92674080c3a05140db83d3fc09b428d01d7c4bffc26e96d79a4b7e0260f0828eb3496e8d8432b26169
7
+ data.tar.gz: f0c04fb0f44d02aff9979f26869aed96be3e059610c4485e392c8e10b95c4f884c0a7341f2b2d163c2d1e726410fb6e6bd9aa6c6a794c0dbf44f80f452c6c0bf
@@ -22,7 +22,8 @@ module Souls
22
22
  attr_reader :message
23
23
 
24
24
  def initialize
25
- message = "You either haven't created or don't have access to a GCP project. Please create a GCP project with the same name as this app."
25
+ message = "You either haven't created or don't have access to a GCP project. " \
26
+ "Please create a GCP project with the same name as this app."
26
27
  super(message)
27
28
  @message = message
28
29
  end
@@ -3,7 +3,8 @@ module Souls
3
3
  desc "console", "Run IRB Console"
4
4
  method_option :env, aliases: "--e", default: "development", desc: "Difine APP Enviroment - development | production"
5
5
  def console
6
- return system("RACK_ENV=production bundle exec irb") if options[:env].eql? "production"
6
+ return system("RACK_ENV=production bundle exec irb") if options[:env].eql?("production")
7
+
7
8
  system("bundle exec irb")
8
9
  end
9
10
  end
@@ -27,7 +27,7 @@ module Souls
27
27
  desc "auth_login", "gcloud config set and gcloud auth login"
28
28
  def auth_login
29
29
  project_id = Souls.configuration.project_id
30
- system("gcloud projects describe #{project_id}", out: :close) or raise(Souls::GcloudException)
30
+ system("gcloud projects describe #{project_id}", out: File::NULL) or raise(Souls::GcloudException)
31
31
  system("gcloud config set project #{project_id}")
32
32
  system("gcloud auth login")
33
33
  rescue Thor::Error => e
@@ -37,7 +37,7 @@ module Souls
37
37
  desc "config_set", "gcloud config set"
38
38
  def config_set
39
39
  project_id = Souls.configuration.project_id
40
- system("gcloud projects describe #{project_id}", out: :close) or raise(Souls::GcloudException)
40
+ system("gcloud projects describe #{project_id}", out: File::NULL) or raise(Souls::GcloudException)
41
41
  system("gcloud config set project #{project_id}")
42
42
  end
43
43
 
@@ -62,14 +62,23 @@ module Souls
62
62
  type = "[#{type}]" if param[:array]
63
63
  if i.zero?
64
64
  if param[:column_name].match?(/$*_id\z/)
65
- f.write(" def self.argument: (:#{param[:column_name]}, String, required: false ) -> #{rbs_type}\n")
65
+ f.write(
66
+ " def self.argument: (:#{param[:column_name]}, String, " \
67
+ "required: false ) -> #{rbs_type}\n"
68
+ )
66
69
  else
67
- f.write(" def self.argument: (:#{param[:column_name]}, #{type}, required: false ) -> #{rbs_type}\n")
70
+ f.write(
71
+ " def self.argument: (:#{param[:column_name]}, #{type}, " \
72
+ "required: false ) -> #{rbs_type}\n"
73
+ )
68
74
  end
69
75
  elsif param[:column_name].match?(/$*_id\z/)
70
76
  f.write(" | (:#{param[:column_name]}, String, required: false ) -> String\n")
71
77
  else
72
- f.write(" | (:#{param[:column_name]}, #{type}, required: false ) -> #{rbs_type}\n")
78
+ f.write(
79
+ " | (:#{param[:column_name]}, #{type}, " \
80
+ "required: false ) -> #{rbs_type}\n"
81
+ )
73
82
  end
74
83
  end
75
84
  end
@@ -8,8 +8,12 @@ module Souls
8
8
  new_cols = Souls.get_columns_num(class_name: singularized_class_name)
9
9
  dir_name = "./app/graphql/mutations/base/#{singularized_class_name}"
10
10
  file_path = "#{dir_name}/create_#{singularized_class_name}.rb"
11
- raise Souls::CLIException.new("File #{file_path} is missing. Please recreate it and then run this command again.") unless
12
- File.exist? file_path
11
+ unless File.exist?(file_path)
12
+ raise(
13
+ Souls::CLIException,
14
+ "File #{file_path} is missing. Please recreate it and then run this command again."
15
+ )
16
+ end
13
17
 
14
18
  mutation_argument = check_mutation_argument(class_name: "user", action: "create")
15
19
  overwrite_class_file(mutation_argument: mutation_argument, file_path: file_path, new_cols: new_cols)
@@ -22,8 +26,12 @@ module Souls
22
26
  new_cols = Souls.get_columns_num(class_name: singularized_class_name)
23
27
  dir_name = "./app/graphql/mutations/base/#{singularized_class_name}"
24
28
  file_path = "#{dir_name}/update_#{singularized_class_name}.rb"
25
- raise Souls::CLIException.new("File #{file_path} is missing. Please recreate it and then run this command again.") unless
26
- File.exist? file_path
29
+ unless File.exist?(file_path)
30
+ raise(
31
+ Souls::CLIException,
32
+ "File #{file_path} is missing. Please recreate it and then run this command again."
33
+ )
34
+ end
27
35
 
28
36
  mutation_argument = check_mutation_argument(class_name: class_name, action: "update")
29
37
  overwrite_class_file(mutation_argument: mutation_argument, file_path: file_path, new_cols: new_cols)
@@ -27,11 +27,12 @@ module Souls
27
27
  type = "[#{type}]" if col[:array]
28
28
  next if col[:column_name] == "created_at" || col[:column_name] == "updated_at"
29
29
 
30
- if i.zero?
31
- write_txt += line
32
- else
33
- write_txt += " #{col[:column_name]}: #{type}?,\n"
34
- end
30
+ write_txt +=
31
+ if i.zero?
32
+ line
33
+ else
34
+ " #{col[:column_name]}: #{type}?,\n"
35
+ end
35
36
  end
36
37
  resolve = true
37
38
  elsif line.include?("def self.argument:") && !argument
@@ -28,11 +28,14 @@ module Souls
28
28
  type = Souls.type_check(col[:type])
29
29
  type = "[#{type}]" if col[:array]
30
30
 
31
- if type.include?("[")
32
- add_line = " scope = scope.where('#{col[:column_name]} @> ARRAY[?]::#{col[:type]}[]', value[:#{col[:column_name]}]) if value[:#{col[:column_name]}]\n"
33
- else
34
- add_line = " scope = scope.where(#{col[:column_name]}: value[:#{col[:column_name]}]) if value[:#{col[:column_name]}]\n"
35
- end
31
+ add_line =
32
+ if type.include?("[")
33
+ " scope = scope.where('#{col[:column_name]} @> ARRAY[?]::#{col[:type]}[]', " \
34
+ "value[:#{col[:column_name]}]) if value[:#{col[:column_name]}]\n"
35
+ else
36
+ " scope = scope.where(#{col[:column_name]}: value[:#{col[:column_name]}]) if " \
37
+ "value[:#{col[:column_name]}]\n"
38
+ end
36
39
  new_line.write(add_line) unless scope_args.include?(col[:column_name])
37
40
  end
38
41
  scope = true
@@ -26,9 +26,11 @@ module Souls
26
26
 
27
27
  type_line =
28
28
  if type == "String" && !col[:array]
29
- " #{col[:column_name].camelize(:lower)}: \"\#{#{class_name}[:#{col[:column_name].underscore}]}\"\n"
29
+ " #{col[:column_name].camelize(:lower)}" \
30
+ ": \"\#{#{class_name}[:#{col[:column_name].underscore}]}\"\n"
30
31
  else
31
- " #{col[:column_name].camelize(:lower)}: \#{#{class_name}[:#{col[:column_name].underscore}]}\n"
32
+ " #{col[:column_name].camelize(:lower)}" \
33
+ ": \#{#{class_name}[:#{col[:column_name].underscore}]}\n"
32
34
  end
33
35
  args = check_rspec_mutation_argument(class_name: class_name)
34
36
  new_line.write(type_line) unless args.include?(col[:column_name].underscore)
@@ -1,3 +1,3 @@
1
1
  require_relative "./gemfile"
2
2
  require_relative "./submodule"
3
- require_relative "./config"
3
+ require_relative "./config"
data/lib/souls/version.rb CHANGED
@@ -1,4 +1,4 @@
1
1
  module Souls
2
- VERSION = "1.7.21".freeze
2
+ VERSION = "1.7.24".freeze
3
3
  public_constant :VERSION
4
4
  end
@@ -1 +1 @@
1
- 1.7.21
1
+ 1.7.24
@@ -1 +1 @@
1
- 1.7.21
1
+ 1.7.24
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: souls
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.7.21
4
+ version: 1.7.24
5
5
  platform: ruby
6
6
  authors:
7
7
  - POPPIN-FUMI
@@ -224,9 +224,7 @@ homepage: https://souls.elsoul.nl
224
224
  licenses:
225
225
  - Apache-2.0
226
226
  metadata:
227
- homepage_uri: https://souls.elsoul.nl
228
- source_code_uri: https://github.com/elsoul/souls
229
- changelog_uri: https://github.com/elsoul/souls/releases/tag/v1.7.21
227
+ rubygems_mfa_required: 'true'
230
228
  post_install_message:
231
229
  rdoc_options: []
232
230
  require_paths: