souls 1.13.3 → 1.13.7

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2a3f918c37ef59dfb41e4a7e5d1447f2c335025475bfb2824237eefb96367f49
4
- data.tar.gz: 92e1830bc1a1e88d766093fd59b214372080b3b352f3a2c3dee1fec905447a21
3
+ metadata.gz: 3fc7f40511ec0965a0719e497483a38260310725555a29d0898a9cebc0ed2e1d
4
+ data.tar.gz: 631eb79cda3828b4bdfa87631a5135433c984c2a50a6afc9bbca5b7a23631746
5
5
  SHA512:
6
- metadata.gz: ac95676be7662121af2881c8358a296fb81259bb001b119c722936f60a2bd9728717a6733fc81fc35f735e4b7428c44ebd332f216ded7763254d50401da1eee1
7
- data.tar.gz: 567ee50475a74443d694019edfc7f31dc8b884488557dda907313280b7cd8406efccfd3e836211910b14c052d14ce37caef6f6163c87ba8fbf284247c45165ec
6
+ metadata.gz: 813388aae1bfd538bb2546a3e83c471a1b40ca53ff25ba873ed70bb4775695481055e9da0eed6f5f786051aff32adb4423ee333e9ada7e41a0d0414b8d2cc30a
7
+ data.tar.gz: d7aaf5a388ccb022b6c2e4bc076146d23da566bac28b2276c0e1a5d9899464905e6dc9825cf2ee5ee678b73db1b0885698e4caef6dc777e91fb3947dd778c64f
@@ -55,6 +55,20 @@ module Souls
55
55
  end
56
56
  end
57
57
 
58
+ desc "reset", "Reset Database and Seed"
59
+ method_option :env, aliases: "--e", default: "development", desc: "Difine APP Enviroment - development | production"
60
+ def reset
61
+ case options[:env]
62
+ when "production"
63
+ db_system("rake db:migrate:reset RACK_ENV=production DISABLE_DATABASE_ENVIRONMENT_CHECK=1")
64
+ db_system("rake db:seed RACK_ENV=production")
65
+ else
66
+ db_system("rake db:migrate:reset")
67
+ db_system("rake db:migrate RACK_ENV=test")
68
+ db_system("rake db:seed")
69
+ end
70
+ end
71
+
58
72
  desc "add_column [CLASS_NAME]", "Create ActiveRecord Migration File"
59
73
  def add_column(class_name)
60
74
  pluralized_class_name = class_name.underscore.pluralize
@@ -88,7 +102,7 @@ module Souls
88
102
  private
89
103
 
90
104
  def db_system(cmd)
91
- system(cmd) or raise(Souls::PSQLException)
105
+ system(cmd) or Souls::Painter.error("DB is not running. Please run `souls docker psql`")
92
106
  end
93
107
  end
94
108
  end
@@ -2,7 +2,7 @@ module Souls
2
2
  class Delete < Thor
3
3
  desc "rspec_job [CLASS_NAME]", "Delete Rspec Job Test Template"
4
4
  def rspec_job(class_name)
5
- file_dir = "./spec/jobs"
5
+ file_dir = "./spec/queries/jobs"
6
6
  singularized_class_name = class_name.underscore.singularize
7
7
  file_path = "#{file_dir}/#{singularized_class_name}_spec.rb"
8
8
  FileUtils.rm_f(file_path)
@@ -69,7 +69,7 @@ module Souls
69
69
  File.open(file_path, "w") do |f|
70
70
  f.write(<<~TEXT)
71
71
  module Queries
72
- class #{class_name.camelize} < Souls::Types::BaseObject
72
+ class #{class_name.camelize} < BaseQuery
73
73
  description ""
74
74
  type Types::#{class_name.camelize}Type, null: false
75
75
 
@@ -108,7 +108,7 @@ module Souls
108
108
  File.open(file_path, "w") do |f|
109
109
  f.write(<<~TEXT)
110
110
  module Types
111
- class #{class_name.camelize}Type < BaseObject
111
+ class #{class_name.camelize}Type < Souls::Types::BaseObject
112
112
  field :response, String, null: true
113
113
  end
114
114
  end
@@ -36,6 +36,7 @@ module Souls
36
36
 
37
37
  def resolve(args)
38
38
  # Define Here
39
+ puts(args)
39
40
  { response: "success!" }
40
41
  end
41
42
  end
@@ -13,8 +13,8 @@ module Souls
13
13
  f.write(<<~TEXT)
14
14
  module Mutations
15
15
  module Managers
16
- module #{singularized_class_name.camelize}Manager < BaseMutation
17
- class #{options[:mutation].singularize.camelize}
16
+ module #{singularized_class_name.camelize}Manager
17
+ class #{options[:mutation].singularize.camelize} < BaseMutation
18
18
  def self.description: (String)-> untyped
19
19
  def self.argument: (untyped, untyped, untyped)-> untyped
20
20
  def self.field: (untyped, untyped, untyped)-> untyped
@@ -6,34 +6,10 @@ module Souls
6
6
  FileUtils.mkdir_p(file_dir) unless Dir.exist?(file_dir)
7
7
  singularized_class_name = class_name.singularize
8
8
  create_individual_query(class_name: singularized_class_name)
9
- create_index_query(class_name: singularized_class_name)
10
9
  end
11
10
 
12
11
  private
13
12
 
14
- def create_index_query(class_name: "user")
15
- file_path = "./app/graphql/queries/#{class_name.pluralize}.rb"
16
- return "Query already exist! #{file_path}" if File.exist?(file_path)
17
-
18
- File.open(file_path, "w") do |f|
19
- f.write(<<~TEXT)
20
- module Queries
21
- class #{class_name.camelize.pluralize} < Queries::BaseQuery
22
- type [Types::#{class_name.camelize}Type], null: false
23
-
24
- def resolve
25
- ::#{class_name.camelize}.all
26
- end
27
- end
28
- end
29
- TEXT
30
- end
31
- Souls::Painter.create_file(file_path.to_s)
32
- file_path
33
- rescue StandardError => e
34
- raise(StandardError, e)
35
- end
36
-
37
13
  def create_individual_query(class_name: "user")
38
14
  file_path = "./app/graphql/queries/#{class_name}.rb"
39
15
  return "Query already exist! #{file_path}" if File.exist?(file_path)
@@ -3,7 +3,6 @@ module Souls
3
3
  desc "query_rbs [CLASS_NAME]", "Generate GraphQL Query RBS"
4
4
  def query_rbs(class_name)
5
5
  single_query_rbs(class_name)
6
- queries_rbs(class_name)
7
6
  end
8
7
 
9
8
  private
@@ -35,29 +34,5 @@ module Souls
35
34
  end
36
35
  file_path
37
36
  end
38
-
39
- def queries_rbs(class_name)
40
- file_path = ""
41
- Dir.chdir(Souls.get_mother_path.to_s) do
42
- file_dir = "./sig/api/app/graphql/queries/"
43
- FileUtils.mkdir_p(file_dir) unless Dir.exist?(file_dir)
44
- pluralized_class_name = class_name.underscore.pluralize
45
- file_path = "#{file_dir}#{pluralized_class_name}.rbs"
46
- File.open(file_path, "w") do |f|
47
- f.write(<<~TEXT)
48
- module Queries
49
- class BaseQuery
50
- end
51
- class #{pluralized_class_name.camelize} < Queries::BaseQuery
52
- def resolve: () -> ( Hash[Symbol, ( String | Integer | bool )] | ::GraphQL::ExecutionError)
53
- def self.type: (*untyped) -> String
54
- end
55
- end
56
- TEXT
57
- end
58
- Souls::Painter.create_file(file_path.to_s)
59
- end
60
- file_path
61
- end
62
37
  end
63
38
  end
@@ -16,7 +16,9 @@ module Souls
16
16
 
17
17
  let(:mutation) do
18
18
  %(mutation {
19
- #{options[:mutation].singularize.camelize(:lower)}(input: {}) {
19
+ #{options[:mutation].singularize.camelize(:lower)}(input: {
20
+ argument: "argument test!"
21
+ }) {
20
22
  response
21
23
  }
22
24
  }
@@ -34,7 +36,7 @@ module Souls
34
36
  rescue StandardError
35
37
  raise(StandardError, result)
36
38
  end
37
- expect(a1).to(include("response" => be_a(String)))
39
+ expect(a1).to(eq("success!"))
38
40
  end
39
41
  end
40
42
  end
data/lib/souls/version.rb CHANGED
@@ -1,4 +1,4 @@
1
1
  module Souls
2
- VERSION = "1.13.3".freeze
2
+ VERSION = "1.13.7".freeze
3
3
  public_constant :VERSION
4
4
  end
@@ -1 +1 @@
1
- 1.13.3
1
+ 1.13.7
@@ -1 +1 @@
1
- 1.13.3
1
+ 1.13.7
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: 1.13.3
4
+ version: 1.13.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-12-14 00:00:00.000000000 Z
13
+ date: 2021-12-22 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: activesupport
@@ -138,10 +138,9 @@ dependencies:
138
138
  - - ">="
139
139
  - !ruby/object:Gem::Version
140
140
  version: 1.1.0
141
- description: "Ruby Serverless Framework 'SOULs'. The SOULs project was launched with
142
- the goal of reducing software development, operation and maintenance costs. Build
143
- Serverless Apps faster like Rails.\n Powered by Ruby GraphQL, RBS/Steep, Active
144
- Record, RSpec, RuboCop, and Google Cloud. "
141
+ description: |-
142
+ Ruby Serverless Framework 'SOULs' | Ruby サーバーレスフレームワーク SOULs.
143
+ Powered by Ruby GraphQL, RBS/Steep, Active Record, RSpec, RuboCop, and Google Cloud.
145
144
  email:
146
145
  - f.kawasaki@elsoul.nl
147
146
  - s.kishi@elsoul.nl
@@ -292,8 +291,6 @@ requirements: []
292
291
  rubygems_version: 3.2.32
293
292
  signing_key:
294
293
  specification_version: 4
295
- summary: Ruby Serverless Framework 'SOULs'. The SOULs project was launched with the
296
- goal of reducing software development, operation and maintenance costs. Build Serverless
297
- Apps faster like Rails. Powered by Ruby GraphQL, RBS/Steep, Active Record, RSpec,
298
- RuboCop, and Google Cloud.
294
+ summary: Ruby Serverless Framework 'SOULs' | Ruby サーバーレスフレームワーク SOULs. Powered by
295
+ Ruby GraphQL, RBS/Steep, Active Record, RSpec, RuboCop, and Google Cloud.
299
296
  test_files: []