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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ac62e7ceab027e6712c2f49a1006467634b695c94277532d995abfe8b84b06d5
4
- data.tar.gz: b9a7d9be1893112f1ed88c10246addcf65b1324fbe38c88341ea165e1dbfeb95
3
+ metadata.gz: 696c6d3b5705e34a38a0dcc9b72a2d41cd5c23554155fce2c8928ee50018af88
4
+ data.tar.gz: aec799376bf62420d4a34886c61a051688e7b3838458611c7f52c775a7bb328f
5
5
  SHA512:
6
- metadata.gz: a8d541ba1c46c4419c0599a38be3ad060c3630e50768ac19d598d4324b9ed38c80be49e67aacb307179f091a0543c64853d1563a51b0bdaeefa1f2d3b4d9cf99
7
- data.tar.gz: 2be11c59ff026d0cd1a33d897772e03a8e1839feba4d0b01ffb44f7ec8b37ac5b6d3e76dc7a7c2bdd8bd1edfc4bafa6fd5f039875d6b9aa5d9f204a2f8f639d2
6
+ metadata.gz: c24f73e30a5189a34206d3da1b00f44f14075aa1d3f424b6a024fcd2929a3f065e3b96da3eec3628a823f80d448d4d1e3dd456a44dcc1eb24fb36c29e6bb951f
7
+ data.tar.gz: e1621cfdbcc1878be1742a9ae06d3bfb2dfadeb4a401f35b1c80f2463b05fbb7445b349de04df0486373022f3a0597a0e8110a17d5d59c25e44609b25b7d71d6
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- souls (0.11.2)
4
+ souls (0.11.6)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
@@ -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.pluralize}.rb"
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.pluralize}.rb"
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.pluralize}.rb"
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.pluralize}.rb"
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.pluralize}.rb"
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: \#{Base64.encode64("#{class_name.camelize}:\#{user.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.pluralize}.rb"
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.pluralize}.rb"
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
@@ -1,3 +1,3 @@
1
1
  module Souls
2
- VERSION = "0.11.3"
2
+ VERSION = "0.11.8"
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.3
4
+ version: 0.11.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - POPPIN-FUMI