souls 0.16.7 → 0.16.8

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: 8f0df698e69275cc28c4f58e2b83bab33ad7ee2d3f34cc928bda1d7b42198ca5
4
- data.tar.gz: fa40ef64c0ade791ef760a3d912f0d97fb7fb6ff39db09c07022af44f821cea6
3
+ metadata.gz: '09d37b12a50b54d68e40410a8c69b930cc091553515f735df7575fa6daa88abb'
4
+ data.tar.gz: 770c7f445b61f046d1a2a166004dd4c4e42272aab1192636a4596db0753cb316
5
5
  SHA512:
6
- metadata.gz: c27e742bca22479ce7967648984220104d8ede75172e73e3ff541e8a4649a3fed658630e94f7e3bc02b9480a39ba16545c3026c22fc2ce11b25c75a49c90d7e1
7
- data.tar.gz: a1cd25dc4863a3639cf466f186ad01e832a910b5f974444c6c52c66c54f6b89c235843535560d0f5ae610b457364a06aeecb34171d0520bfa4e5ca4090d8d078
6
+ metadata.gz: d15a89dae81309eeaacee343f636ab4fef4cf04ddc7a287a5ba9fd76e094a9a89c48ad6c42feee91a2f3c70ff09979eecfbf4d63ec882d01d970bc9340047410
7
+ data.tar.gz: 56c5ec546f7e536bbf72b87bba895b292a1b79daebceb2b4037a97729cc8f9c4a91736449872943c1cde940eb829b5087423f18399e649c0272ec9979bf24106
data/.rubocop.yml CHANGED
@@ -79,8 +79,6 @@ Style/HashSyntax:
79
79
  - "**/*.rake"
80
80
  - "Rakefile"
81
81
 
82
- Layout/HeredocIndentation:
83
- Enabled: false
84
82
 
85
83
  Style/IfUnlessModifier:
86
84
  Enabled: false
data/exe/souls CHANGED
@@ -48,6 +48,21 @@ begin
48
48
  Souls::Init.config_init
49
49
  when "-v", "--version"
50
50
  puts Souls::VERSION
51
+ when "add"
52
+ case ARGV[1]
53
+ when "mutation"
54
+ Souls::Init.add_mutation class_name: "user", file_name: "hoi"
55
+ when "type"
56
+ Souls::Init.add_type class_name: "user", file_name: "hoi"
57
+ when "connection"
58
+ Souls::Init.add_connection class_name: "user", file_name: "hoi"
59
+ when "edge"
60
+ Souls::Init.add_edge class_name: "user", file_name: "hoi"
61
+ when "rspec_mutation"
62
+ Souls::Init.add_rspec_mutation class_name: "user", file_name: "hoi"
63
+ else
64
+ puts "HOI!"
65
+ end
51
66
  when "g", "generate"
52
67
  case ARGV[1]
53
68
  when "test_dir"
@@ -110,7 +110,7 @@ module Souls
110
110
  if line.include?("end") || line.include?("t.index")
111
111
  break
112
112
  end
113
- _, name = get_type_and_name(line)
113
+ type, name = get_type_and_name(line)
114
114
  if line.include?("array: true")
115
115
  new_line.write " scope = scope.where(\"#{name} @> ARRAY[?]::text[]\", value[:#{name}]) if value[:#{name}]\n"
116
116
  next
@@ -124,7 +124,12 @@ module Souls
124
124
  when "created_at", "updated_at"
125
125
  next
126
126
  else
127
- new_line.write " scope = scope.where(#{name}: value[:#{name}]) if value[:#{name}]\n"
127
+ case type
128
+ when "boolean"
129
+ new_line.write " scope = scope.where(#{name}: value[:#{name}]) unless value[:#{name}].nil?\n"
130
+ else
131
+ new_line.write " scope = scope.where(#{name}: value[:#{name}]) if value[:#{name}]\n"
132
+ end
128
133
  end
129
134
  end
130
135
  @on = true if table_check(line: line, class_name: class_name)
@@ -137,7 +142,7 @@ module Souls
137
142
  file_path = "./app/graphql/resolvers/#{class_name.singularize}_search.rb"
138
143
  File.open(file_path, "a") do |f|
139
144
  f.write <<-EOS
140
- scope = scope.where(is_deleted: value[:is_deleted]) if value[:is_deleted]
145
+ scope = scope.where(is_deleted: value[:is_deleted]) unless value[:is_deleted].nil?
141
146
  scope = scope.where("created_at >= ?", value[:start_date]) if value[:start_date]
142
147
  scope = scope.where("created_at <= ?", value[:end_date]) if value[:end_date]
143
148
 
@@ -169,9 +174,6 @@ end
169
174
  File.open(file_path, "w") do |f|
170
175
  f.write <<~EOS
171
176
  class #{class_name.camelize}
172
- include Sidekiq::Status::Worker
173
- include Sidekiq::Worker
174
- sidekiq_options queue: "default"
175
177
 
176
178
  def perform **args
177
179
  # write task code here
@@ -385,6 +387,36 @@ end
385
387
  rescue StandardError => error
386
388
  puts error
387
389
  end
390
+
391
+ def add_mutation class_name: "souls", file_name: "hoi"
392
+ singularized_class_name = class_name.singularize.underscore
393
+ file_path = "./app/graphql/mutations/#{singularized_class_name}/#{file_name}.rb"
394
+ file_path
395
+ end
396
+
397
+ def add_type class_name: "souls", file_name: "hoi"
398
+ singularized_class_name = class_name.singularize.underscore
399
+ file_path = "./app/graphql/types/#{file_name}.rb"
400
+ file_path
401
+ end
402
+
403
+ def add_edge class_name: "souls", file_name: "hoi"
404
+ singularized_class_name = class_name.singularize.underscore
405
+ file_path = "./app/graphql/types/#{file_name}.rb"
406
+ file_path
407
+ end
408
+
409
+ def add_connection class_name: "souls", file_name: "hoi"
410
+ singularized_class_name = class_name.singularize.underscore
411
+ file_path = "./app/graphql/types/#{file_name}.rb"
412
+ file_path
413
+ end
414
+
415
+ def add_rspec_mutation class_name: "souls", file_name: "hoi"
416
+ singularized_class_name = class_name.singularize.underscore
417
+ file_path = "./app/graphql/types/#{file_name}.rb"
418
+ file_path
419
+ end
388
420
  end
389
421
  end
390
422
  end
data/lib/souls/init.rb CHANGED
@@ -780,10 +780,6 @@ module Souls
780
780
  EOS
781
781
  else
782
782
  new_line.write <<-EOS
783
-
784
- def get_global_key class_name, id
785
- Base64.encode64(\"\#{class_name}:\#{id}\")
786
- end
787
783
  let(:#{class_name}) { FactoryBot.attributes_for(:#{class_name}, #{@relation_params.join(", ")}) }
788
784
 
789
785
  let(:mutation) do
data/lib/souls/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Souls
2
- VERSION = "0.16.7"
2
+ VERSION = "0.16.8"
3
3
  end
metadata CHANGED
@@ -1,16 +1,16 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: souls
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.16.7
4
+ version: 0.16.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - POPPIN-FUMI
8
8
  - KishiTheMechanic
9
9
  - James Neve
10
- autorequire:
10
+ autorequire:
11
11
  bindir: exe
12
12
  cert_chain: []
13
- date: 2021-03-02 00:00:00.000000000 Z
13
+ date: 2021-03-12 00:00:00.000000000 Z
14
14
  dependencies: []
15
15
  description: SOULS is a Web Application Framework for Microservices on Multi Cloud
16
16
  Platform such as Google Cloud Platform, Amazon Web Services, and Alibaba Cloud.
@@ -55,7 +55,7 @@ metadata:
55
55
  homepage_uri: https://github.com/elsoul/souls
56
56
  source_code_uri: https://github.com/elsoul/souls
57
57
  changelog_uri: https://github.com/elsoul/souls
58
- post_install_message:
58
+ post_install_message:
59
59
  rdoc_options: []
60
60
  require_paths:
61
61
  - lib
@@ -71,7 +71,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
71
71
  version: '0'
72
72
  requirements: []
73
73
  rubygems_version: 3.2.3
74
- signing_key:
74
+ signing_key:
75
75
  specification_version: 4
76
76
  summary: SOULS is a GraphQL Based Web Application Framework for Microservices on Multi
77
77
  Cloud Platform such as Google Cloud Platform, Amazon Web Services, and Alibaba Cloud.