souls 0.11.3 → 0.11.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 +4 -4
- data/Gemfile.lock +1 -1
- data/lib/souls/init.rb +10 -10
- data/lib/souls/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 696c6d3b5705e34a38a0dcc9b72a2d41cd5c23554155fce2c8928ee50018af88
|
|
4
|
+
data.tar.gz: aec799376bf62420d4a34886c61a051688e7b3838458611c7f52c775a7bb328f
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: c24f73e30a5189a34206d3da1b00f44f14075aa1d3f424b6a024fcd2929a3f065e3b96da3eec3628a823f80d448d4d1e3dd456a44dcc1eb24fb36c29e6bb951f
|
|
7
|
+
data.tar.gz: e1621cfdbcc1878be1742a9ae06d3bfb2dfadeb4a401f35b1c80f2463b05fbb7445b349de04df0486373022f3a0597a0e8110a17d5d59c25e44609b25b7d71d6
|
data/Gemfile.lock
CHANGED
data/lib/souls/init.rb
CHANGED
|
@@ -625,7 +625,7 @@ module Souls
|
|
|
625
625
|
end
|
|
626
626
|
|
|
627
627
|
def rspec_mutation_head class_name: "souls"
|
|
628
|
-
file_path = "./spec/mutations/#{class_name.
|
|
628
|
+
file_path = "./spec/mutations/#{class_name.singularize}_spec.rb"
|
|
629
629
|
File.open(file_path, "w") do |f|
|
|
630
630
|
f.write <<~EOS
|
|
631
631
|
RSpec.describe \"#{class_name.camelize} Mutation テスト\" do
|
|
@@ -640,7 +640,7 @@ module Souls
|
|
|
640
640
|
end
|
|
641
641
|
|
|
642
642
|
def rspec_mutation_params class_name: "souls"
|
|
643
|
-
file_path = "./spec/mutations/#{class_name.
|
|
643
|
+
file_path = "./spec/mutations/#{class_name.singularize}_spec.rb"
|
|
644
644
|
path = "./db/schema.rb"
|
|
645
645
|
@on = false
|
|
646
646
|
File.open(file_path, "a") do |new_line|
|
|
@@ -648,7 +648,7 @@ module Souls
|
|
|
648
648
|
f.each_line.with_index do |line, i|
|
|
649
649
|
if @on
|
|
650
650
|
if line.include?("end") || line.include?("t.index")
|
|
651
|
-
new_line.write " }) {\n #{class_name.singularize.camelize} {\n id\n"
|
|
651
|
+
new_line.write " }) {\n #{class_name.singularize.camelize(:lower)} {\n id\n"
|
|
652
652
|
break
|
|
653
653
|
end
|
|
654
654
|
type, name = line.split(",")[0].gsub("\"", "").scan(/((?<=t\.).+(?=\s)) (.+)/)[0]
|
|
@@ -675,7 +675,7 @@ module Souls
|
|
|
675
675
|
end
|
|
676
676
|
|
|
677
677
|
def rspec_mutation_params_response class_name: "souls"
|
|
678
|
-
file_path = "./spec/mutations/#{class_name.
|
|
678
|
+
file_path = "./spec/mutations/#{class_name.singularize}_spec.rb"
|
|
679
679
|
path = "./db/schema.rb"
|
|
680
680
|
@on = false
|
|
681
681
|
File.open(file_path, "a") do |new_line|
|
|
@@ -718,7 +718,7 @@ module Souls
|
|
|
718
718
|
end
|
|
719
719
|
|
|
720
720
|
def rspec_mutation_end class_name: "souls"
|
|
721
|
-
file_path = "./spec/mutations/#{class_name.
|
|
721
|
+
file_path = "./spec/mutations/#{class_name.singularize}_spec.rb"
|
|
722
722
|
path = "./db/schema.rb"
|
|
723
723
|
@on = false
|
|
724
724
|
File.open(file_path, "a") do |new_line|
|
|
@@ -772,7 +772,7 @@ end
|
|
|
772
772
|
end
|
|
773
773
|
|
|
774
774
|
def rspec_query_head class_name: "souls"
|
|
775
|
-
file_path = "./spec/queries/#{class_name.
|
|
775
|
+
file_path = "./spec/queries/#{class_name.singularize}_spec.rb"
|
|
776
776
|
File.open(file_path, "w") do |f|
|
|
777
777
|
f.write <<~EOS
|
|
778
778
|
RSpec.describe \"#{class_name.camelize} Query テスト\" do
|
|
@@ -780,15 +780,16 @@ end
|
|
|
780
780
|
let!(:#{class_name.singularize.underscore}) { FactoryBot.create(:#{class_name.singularize.underscore}) }
|
|
781
781
|
|
|
782
782
|
let(:query) do
|
|
783
|
+
data_id = Base64.encode64("User:\#{user.id}")
|
|
783
784
|
%(query {
|
|
784
|
-
#{class_name.singularize.underscore}(id:
|
|
785
|
+
#{class_name.singularize.underscore}(id: \\"\#{data_id}\\") {
|
|
785
786
|
id
|
|
786
787
|
EOS
|
|
787
788
|
end
|
|
788
789
|
end
|
|
789
790
|
|
|
790
791
|
def rspec_query_params class_name: "souls"
|
|
791
|
-
file_path = "./spec/queries/#{class_name.
|
|
792
|
+
file_path = "./spec/queries/#{class_name.singularize}_spec.rb"
|
|
792
793
|
path = "./db/schema.rb"
|
|
793
794
|
@on = false
|
|
794
795
|
File.open(file_path, "a") do |new_line|
|
|
@@ -830,7 +831,7 @@ end
|
|
|
830
831
|
end
|
|
831
832
|
|
|
832
833
|
def rspec_query_end class_name: "souls"
|
|
833
|
-
file_path = "./spec/queries/#{class_name.
|
|
834
|
+
file_path = "./spec/queries/#{class_name.singularize}_spec.rb"
|
|
834
835
|
path = "./db/schema.rb"
|
|
835
836
|
@on = false
|
|
836
837
|
File.open(file_path, "a") do |new_line|
|
|
@@ -943,7 +944,6 @@ end
|
|
|
943
944
|
|
|
944
945
|
def migrate_all
|
|
945
946
|
puts "◆◆◆ Let's Auto Generate CRUD API ◆◆◆\n"
|
|
946
|
-
`rake db:migrate`
|
|
947
947
|
paths = get_tables.map do |class_name|
|
|
948
948
|
migrate class_name: class_name.singularize
|
|
949
949
|
end
|
data/lib/souls/version.rb
CHANGED