souls 0.16.8 → 0.17.3

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: '09d37b12a50b54d68e40410a8c69b930cc091553515f735df7575fa6daa88abb'
4
- data.tar.gz: 770c7f445b61f046d1a2a166004dd4c4e42272aab1192636a4596db0753cb316
3
+ metadata.gz: 4e0e45cd92b7c2d7ffd54a5e49350615d0413a99ad49fa6f1312019184186979
4
+ data.tar.gz: b0677d2efb8da005c391dd97f9cf9d507f27a6020bbede62988630d8718e474b
5
5
  SHA512:
6
- metadata.gz: d15a89dae81309eeaacee343f636ab4fef4cf04ddc7a287a5ba9fd76e094a9a89c48ad6c42feee91a2f3c70ff09979eecfbf4d63ec882d01d970bc9340047410
7
- data.tar.gz: 56c5ec546f7e536bbf72b87bba895b292a1b79daebceb2b4037a97729cc8f9c4a91736449872943c1cde940eb829b5087423f18399e649c0272ec9979bf24106
6
+ metadata.gz: 6ef658d2adcb3fa24e176e6598d65a847c220ef4893023d9a61898aadd78b33b1d3155d80d70b87b2e864e0727d01dd19b085065ae453fe87a82e92c6744b675
7
+ data.tar.gz: 32543be68ca4e7e30e744f05e26f63bec32bfe6f6f5094f708dc88d484ddb3f3b061782bd06c6bbe7893a188cb492ddf3e0117c28a4be2f365eb10a731110a18
data/exe/souls CHANGED
@@ -35,7 +35,7 @@ begin
35
35
  else
36
36
  case ARGV[1]
37
37
  when "RACK_ENV=production"
38
- system "bundle exec irb RACK_ENV=production"
38
+ system "RACK_ENV=production bundle exec irb"
39
39
  else
40
40
  system "bundle exec irb"
41
41
  end
@@ -103,7 +103,10 @@ begin
103
103
  "SOULs!"
104
104
  end
105
105
  when "d"
106
- Souls::Init.delete_all class_name: ARGV[1]
106
+ Souls::Init.add_delete class_name: ARGV[1]
107
+ when "update"
108
+ Souls::Init.add_delete class_name: ARGV[1]
109
+ Souls::Init.single_migrate class_name: ARGV[1]
107
110
  when "db:create"
108
111
  system "rake db:create && rake db:create RACK_ENV=test"
109
112
  when "db:migrate"
@@ -114,7 +117,12 @@ begin
114
117
  system "rake db:migrate && rake db:migrate RACK_ENV=test"
115
118
  end
116
119
  when "db:seed"
117
- system "rake db:seed"
120
+ case ARGV[1]
121
+ when "RACK_ENV=production"
122
+ system "rake db:seed RACK_ENV=production"
123
+ else
124
+ system "rake db:seed"
125
+ end
118
126
  when "db:migrate:reset"
119
127
  case ARGV[1]
120
128
  when "RACK_ENV=production"
@@ -77,7 +77,6 @@ module Souls
77
77
  file_path = "./app/graphql/resolvers/#{class_name.singularize}_search.rb"
78
78
  File.open(file_path, "a") do |f|
79
79
  f.write <<-EOS
80
- argument :is_deleted, Boolean, required: false
81
80
  argument :start_date, String, required: false
82
81
  argument :end_date, String, required: false
83
82
  end
@@ -142,7 +141,6 @@ module Souls
142
141
  file_path = "./app/graphql/resolvers/#{class_name.singularize}_search.rb"
143
142
  File.open(file_path, "a") do |f|
144
143
  f.write <<-EOS
145
- scope = scope.where(is_deleted: value[:is_deleted]) unless value[:is_deleted].nil?
146
144
  scope = scope.where("created_at >= ?", value[:start_date]) if value[:start_date]
147
145
  scope = scope.where("created_at <= ?", value[:end_date]) if value[:end_date]
148
146
 
@@ -368,6 +366,25 @@ end
368
366
  rspec_resolver_end class_name: singularized_class_name
369
367
  end
370
368
 
369
+ def add_delete class_name: "souls"
370
+ singularized_class_name = class_name.singularize.underscore
371
+ pluralized_class_name = class_name.pluralize.underscore
372
+ FileUtils.rm_rf "./app/graphql/mutations/#{singularized_class_name}"
373
+ FileUtils.rm "./app/graphql/queries/#{singularized_class_name}.rb"
374
+ FileUtils.rm "./app/graphql/queries/#{pluralized_class_name}.rb"
375
+ FileUtils.rm "./app/graphql/resolvers/#{singularized_class_name}_search.rb"
376
+ FileUtils.rm "./app/graphql/types/#{singularized_class_name}_type.rb"
377
+ FileUtils.rm "./app/graphql/types/#{singularized_class_name}_node_type.rb"
378
+ FileUtils.rm "./spec/factories/#{pluralized_class_name}.rb"
379
+ FileUtils.rm "./spec/mutations/#{singularized_class_name}_spec.rb"
380
+ FileUtils.rm "./spec/models/#{singularized_class_name}_spec.rb"
381
+ FileUtils.rm "./spec/queries/#{singularized_class_name}_spec.rb"
382
+ FileUtils.rm "./spec/resolvers/#{singularized_class_name}_search_spec.rb"
383
+ puts "deleted #{class_name.camelize} CRUD!"
384
+ rescue StandardError => error
385
+ puts error
386
+ end
387
+
371
388
  def delete_all class_name: "souls"
372
389
  singularized_class_name = class_name.singularize.underscore
373
390
  pluralized_class_name = class_name.pluralize.underscore
data/lib/souls/init.rb CHANGED
@@ -289,8 +289,8 @@ module Souls
289
289
  float: 4.2,
290
290
  string: '"MyString"',
291
291
  text: '"MyString"',
292
- datetime: "DateTime.now",
293
- date: "DateTime.now",
292
+ datetime: "Time.now",
293
+ date: "Time.now",
294
294
  boolean: false,
295
295
  integer: 1
296
296
  }[type.to_sym]
data/lib/souls/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Souls
2
- VERSION = "0.16.8"
2
+ VERSION = "0.17.3"
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.16.8
4
+ version: 0.17.3
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-03-12 00:00:00.000000000 Z
13
+ date: 2021-03-29 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.