souls 0.11.4 → 0.11.9
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 +4 -4
- data/.rubocop.yml +1 -1
- data/Gemfile.lock +1 -1
- data/exe/souls +2 -2
- data/lib/souls/init.rb +51 -8
- data/lib/souls/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 71f35c6279e7208c219e0a2c4940e0d489cd2ee08cdbc81ca70171ec144da144
|
|
4
|
+
data.tar.gz: 2f16a97ba993bbe48d9b283b90113402e2fffd939b2d272f4ed659eba7c2577d
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 234b0e85daf9298fc7c074b2d7925bd7ee2f6eaf4f053a077b6b9998f6f65ce773155e584e1e65526527e1c22255a505d8bfaf1b0c44be5842c2a2a1f8d948c0
|
|
7
|
+
data.tar.gz: 0b3eb2a277257a1768668294c25d603cb14b7ee2709b6b2b3ae1e8001b6553c6449d03b66dcd5e02018f81a2dbe6aec2081d0eacb739514be748ecf1af4bc60b
|
data/.rubocop.yml
CHANGED
data/Gemfile.lock
CHANGED
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.
|
|
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.
|
|
59
|
+
Souls::Init.single_migrate class_name: ARGV[2]
|
|
60
60
|
when "migrate_all"
|
|
61
61
|
Souls::Init.migrate_all
|
|
62
62
|
when "migration"
|
data/lib/souls/init.rb
CHANGED
|
@@ -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
|
-
|
|
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
|
|
@@ -640,7 +645,7 @@ module Souls
|
|
|
640
645
|
end
|
|
641
646
|
|
|
642
647
|
def rspec_mutation_params class_name: "souls"
|
|
643
|
-
file_path = "./spec/mutations/#{class_name.
|
|
648
|
+
file_path = "./spec/mutations/#{class_name.singularize}_spec.rb"
|
|
644
649
|
path = "./db/schema.rb"
|
|
645
650
|
@on = false
|
|
646
651
|
File.open(file_path, "a") do |new_line|
|
|
@@ -648,7 +653,7 @@ module Souls
|
|
|
648
653
|
f.each_line.with_index do |line, i|
|
|
649
654
|
if @on
|
|
650
655
|
if line.include?("end") || line.include?("t.index")
|
|
651
|
-
new_line.write " }) {\n #{class_name.singularize.camelize} {\n id\n"
|
|
656
|
+
new_line.write " }) {\n #{class_name.singularize.camelize(:lower)} {\n id\n"
|
|
652
657
|
break
|
|
653
658
|
end
|
|
654
659
|
type, name = line.split(",")[0].gsub("\"", "").scan(/((?<=t\.).+(?=\s)) (.+)/)[0]
|
|
@@ -675,7 +680,7 @@ module Souls
|
|
|
675
680
|
end
|
|
676
681
|
|
|
677
682
|
def rspec_mutation_params_response class_name: "souls"
|
|
678
|
-
file_path = "./spec/mutations/#{class_name.
|
|
683
|
+
file_path = "./spec/mutations/#{class_name.singularize}_spec.rb"
|
|
679
684
|
path = "./db/schema.rb"
|
|
680
685
|
@on = false
|
|
681
686
|
File.open(file_path, "a") do |new_line|
|
|
@@ -718,7 +723,7 @@ module Souls
|
|
|
718
723
|
end
|
|
719
724
|
|
|
720
725
|
def rspec_mutation_end class_name: "souls"
|
|
721
|
-
file_path = "./spec/mutations/#{class_name.
|
|
726
|
+
file_path = "./spec/mutations/#{class_name.singularize}_spec.rb"
|
|
722
727
|
path = "./db/schema.rb"
|
|
723
728
|
@on = false
|
|
724
729
|
File.open(file_path, "a") do |new_line|
|
|
@@ -780,15 +785,16 @@ end
|
|
|
780
785
|
let!(:#{class_name.singularize.underscore}) { FactoryBot.create(:#{class_name.singularize.underscore}) }
|
|
781
786
|
|
|
782
787
|
let(:query) do
|
|
788
|
+
data_id = Base64.encode64("User:\#{user.id}")
|
|
783
789
|
%(query {
|
|
784
|
-
#{class_name.singularize.underscore}(id:
|
|
790
|
+
#{class_name.singularize.underscore}(id: \\"\#{data_id}\\") {
|
|
785
791
|
id
|
|
786
792
|
EOS
|
|
787
793
|
end
|
|
788
794
|
end
|
|
789
795
|
|
|
790
796
|
def rspec_query_params class_name: "souls"
|
|
791
|
-
file_path = "./spec/queries/#{class_name.
|
|
797
|
+
file_path = "./spec/queries/#{class_name.singularize}_spec.rb"
|
|
792
798
|
path = "./db/schema.rb"
|
|
793
799
|
@on = false
|
|
794
800
|
File.open(file_path, "a") do |new_line|
|
|
@@ -830,7 +836,7 @@ end
|
|
|
830
836
|
end
|
|
831
837
|
|
|
832
838
|
def rspec_query_end class_name: "souls"
|
|
833
|
-
file_path = "./spec/queries/#{class_name.
|
|
839
|
+
file_path = "./spec/queries/#{class_name.singularize}_spec.rb"
|
|
834
840
|
path = "./db/schema.rb"
|
|
835
841
|
@on = false
|
|
836
842
|
File.open(file_path, "a") do |new_line|
|
|
@@ -941,6 +947,43 @@ end
|
|
|
941
947
|
]
|
|
942
948
|
end
|
|
943
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
|
+
|
|
944
987
|
def migrate_all
|
|
945
988
|
puts "◆◆◆ Let's Auto Generate CRUD API ◆◆◆\n"
|
|
946
989
|
paths = get_tables.map do |class_name|
|
data/lib/souls/version.rb
CHANGED
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.
|
|
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-
|
|
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.
|