souls 0.11.8 → 0.11.9

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: 696c6d3b5705e34a38a0dcc9b72a2d41cd5c23554155fce2c8928ee50018af88
4
- data.tar.gz: aec799376bf62420d4a34886c61a051688e7b3838458611c7f52c775a7bb328f
3
+ metadata.gz: 71f35c6279e7208c219e0a2c4940e0d489cd2ee08cdbc81ca70171ec144da144
4
+ data.tar.gz: 2f16a97ba993bbe48d9b283b90113402e2fffd939b2d272f4ed659eba7c2577d
5
5
  SHA512:
6
- metadata.gz: c24f73e30a5189a34206d3da1b00f44f14075aa1d3f424b6a024fcd2929a3f065e3b96da3eec3628a823f80d448d4d1e3dd456a44dcc1eb24fb36c29e6bb951f
7
- data.tar.gz: e1621cfdbcc1878be1742a9ae06d3bfb2dfadeb4a401f35b1c80f2463b05fbb7445b349de04df0486373022f3a0597a0e8110a17d5d59c25e44609b25b7d71d6
6
+ metadata.gz: 234b0e85daf9298fc7c074b2d7925bd7ee2f6eaf4f053a077b6b9998f6f65ce773155e584e1e65526527e1c22255a505d8bfaf1b0c44be5842c2a2a1f8d948c0
7
+ data.tar.gz: 0b3eb2a277257a1768668294c25d603cb14b7ee2709b6b2b3ae1e8001b6553c6449d03b66dcd5e02018f81a2dbe6aec2081d0eacb739514be748ecf1af4bc60b
@@ -207,4 +207,4 @@ Layout/HeredocIndentation:
207
207
  Style/RaiseArgs:
208
208
  Enabled: false
209
209
  Metrics/BlockNesting:
210
- Enable: false
210
+ Enabled: false
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- souls (0.11.6)
4
+ souls (0.11.8)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
data/exe/souls CHANGED
@@ -46,7 +46,7 @@ begin
46
46
  when "g", "generate"
47
47
  case ARGV[1]
48
48
  when "test"
49
- Souls::Init.rspec_query class_name: "user"
49
+ Souls::Init.single_migrate class_name: "user"
50
50
  when "model"
51
51
  Souls::Init.model class_name: ARGV[2]
52
52
  when "mutation"
@@ -56,7 +56,7 @@ begin
56
56
  when "type"
57
57
  Souls::Init.type class_name: ARGV[2]
58
58
  when "migrate"
59
- Souls::Init.migrate class_name: ARGV[2]
59
+ Souls::Init.single_migrate class_name: ARGV[2]
60
60
  when "migrate_all"
61
61
  Souls::Init.migrate_all
62
62
  when "migration"
@@ -582,7 +582,12 @@ module Souls
582
582
  field = '["tag1", "tag2", "tag3"]' if line.include?("array: true")
583
583
  type, name = line.split(",")[0].gsub("\"", "").scan(/((?<=t\.).+(?=\s)) (.+)/)[0]
584
584
  field ||= get_test_type type
585
- new_line.write " #{name} { #{field} }\n"
585
+ if type == "bigint" && name.include?("_id")
586
+ id_name = name.gsub("_id", "")
587
+ new_line.write " association :#{id_name}, factory: :#{id_name}\n"
588
+ else
589
+ new_line.write " #{name} { #{field} }\n"
590
+ end
586
591
  end
587
592
  if table_check(line: line, class_name: class_name)
588
593
  @on = true
@@ -942,6 +947,43 @@ end
942
947
  ]
943
948
  end
944
949
 
950
+ def single_migrate class_name: "user"
951
+ puts "◆◆◆ Let's Auto Generate CRUD API ◆◆◆\n"
952
+ result = migrate class_name: class_name
953
+ puts result[0][:model]
954
+ puts result[0][:type]
955
+ puts result[0][:rspec_factory]
956
+ puts result[0][:rspec_model]
957
+ puts result[0][:rspec_mutation]
958
+ puts result[0][:rspec_query]
959
+ puts result[0][:query]
960
+ puts result[0][:mutation]
961
+
962
+ puts "\nAll files created from ./db/schema.rb"
963
+ puts "\n\n"
964
+ puts "##########################################################\n"
965
+ puts "# #\n"
966
+ puts "# Add These Lines at ./app/graphql/types/query_type.rb #\n"
967
+ puts "# #\n"
968
+ puts "##########################################################\n\n\n"
969
+ result[0][:add_query_type].each do |path|
970
+ puts path
971
+ end
972
+ puts "\n ## Connection Type\n\n"
973
+ puts " def #{class_name.pluralize}"
974
+ puts " #{class_name.singularize.camelize}.all.order(id: :desc)"
975
+ puts " end\n\n\n"
976
+
977
+ puts "#############################################################\n"
978
+ puts "# #\n"
979
+ puts "# Add These Lines at ./app/graphql/types/mutation_type.rb #\n"
980
+ puts "# #\n"
981
+ puts "#############################################################\n\n\n"
982
+ result[0][:add_mutation_type].each do |path|
983
+ puts path
984
+ end
985
+ end
986
+
945
987
  def migrate_all
946
988
  puts "◆◆◆ Let's Auto Generate CRUD API ◆◆◆\n"
947
989
  paths = get_tables.map do |class_name|
@@ -1,3 +1,3 @@
1
1
  module Souls
2
- VERSION = "0.11.8"
2
+ VERSION = "0.11.9"
3
3
  end
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: 0.11.8
4
+ version: 0.11.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - POPPIN-FUMI
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: exe
12
12
  cert_chain: []
13
- date: 2021-01-26 00:00:00.000000000 Z
13
+ date: 2021-01-28 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.