souls 0.14.2 → 0.14.7

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: ef8658cc1f61a2605bf7f014a779af283b48679593338f5e709c883c6f299b23
4
- data.tar.gz: 95b3bc266f7831a88dcf53cdd001ff11449198e40a0800ae859edb37a7648ba7
3
+ metadata.gz: 82a93c134d59e41d907e30a4784bc6d0713d20ec016e606b49f957aa699e1e82
4
+ data.tar.gz: 663dd3215bf74f74fa17e6178a4afface0c4a173334519c4e27af210261716f2
5
5
  SHA512:
6
- metadata.gz: 8f75d929171989d198d9ad5d5fba1188c78d59867ebe9f933ab433711a92c96d7791cb264b661911e13fe0e3afcff9806f165c0ae2d5bb5a5ad429036dbe9140
7
- data.tar.gz: 162c85a48e63eaa1c0ea0883a41eb7a7feff299a507713152b04f03a9db5210cf3f52eca3de43c66bba61fa93394fd1ac3e7accf8cb1fdf80d100ac0d7102b5b
6
+ metadata.gz: 182ee54e370af1f746a45613aeb1c78604701a2ac075e7de9e58e211ed8028a0a75dcc4ab0fddce1f870a17392c14a7fc0e1aede1bdc6d8c37bdf4e107457d23
7
+ data.tar.gz: d91eab772bd9ec65a0844df7fb363171a2a02c76d9300c60087c37fcc75a26d188e067ae36526d9401c09793aacbe16c46bb6968dc126884ef0ad7ea5649b93a
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- souls (0.14.0)
4
+ souls (0.14.6)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
data/exe/souls CHANGED
@@ -62,7 +62,7 @@ begin
62
62
  when "migrate_all"
63
63
  Souls::Init.migrate_all
64
64
  when "migration"
65
- `rake db:create_migration NAME=#{ARGV[3]}`
65
+ `rake db:create_migration NAME=#{ARGV[2]}`
66
66
  when "rspec_factory"
67
67
  Souls::Init.rspec_factory class_name: ARGV[2]
68
68
  when "rspec_model"
data/lib/souls/init.rb CHANGED
@@ -244,6 +244,7 @@ module Souls
244
244
 
245
245
  def model class_name: "souls"
246
246
  file_path = "./app/models/#{class_name.singularize}.rb"
247
+ return p("Model already exist! #{file_path}") if File.exist? file_path
247
248
  File.open(file_path, "w") do |f|
248
249
  f.write <<~EOS
249
250
  class #{class_name.camelize} < ActiveRecord::Base
@@ -257,6 +258,7 @@ module Souls
257
258
  FileUtils.mkdir_p "./app/graphql/mutations"
258
259
  FileUtils.mkdir_p "./app/graphql/queries"
259
260
  FileUtils.mkdir_p "./app/graphql/types"
261
+ FileUtils.mkdir_p "./app/models"
260
262
  FileUtils.mkdir_p "./spec/factories"
261
263
  FileUtils.mkdir_p "./spec/queries"
262
264
  FileUtils.mkdir_p "./spec/mutations"
@@ -300,6 +302,8 @@ module Souls
300
302
  end
301
303
 
302
304
  def create_mutation_head class_name: "souls"
305
+ dir_name = "./app/graphql/mutations/#{class_name}"
306
+ FileUtils.mkdir_p dir_name unless Dir.exist? dir_name
303
307
  file_path = "./app/graphql/mutations/#{class_name}/create_#{class_name}.rb"
304
308
  File.open(file_path, "w") do |new_line|
305
309
  new_line.write <<~EOS
@@ -526,11 +530,7 @@ module Souls
526
530
 
527
531
  def mutation class_name: "souls"
528
532
  singularized_class_name = class_name.singularize
529
- if Dir.exist? "./app/graphql/mutations/#{singularized_class_name}"
530
- create_confirm dir_path: "./app/graphql/mutations/#{singularized_class_name}"
531
- else
532
- Dir.mkdir "./app/graphql/mutations/#{singularized_class_name}"
533
- end
533
+
534
534
  create_mutation_head class_name: singularized_class_name
535
535
  relation_params = create_mutation_params class_name: singularized_class_name
536
536
  create_mutation_after_params class_name: singularized_class_name, relation_params: relation_params
@@ -748,9 +748,9 @@ module Souls
748
748
  EOS
749
749
  else
750
750
  new_line.write <<-EOS
751
-
751
+
752
752
  def get_global_key class_name, id
753
- Base64.encode64("#{class_name}:#{id}")
753
+ Base64.encode64(\"\#{class_name}:\#{id}\")
754
754
  end
755
755
  let(:#{class_name}) { FactoryBot.attributes_for(:#{class_name}, #{@relation_params.join(", ")}) }
756
756
 
data/lib/souls/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Souls
2
- VERSION = "0.14.2"
2
+ VERSION = "0.14.7"
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.14.2
4
+ version: 0.14.7
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-02-02 00:00:00.000000000 Z
13
+ date: 2021-02-04 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.