souls 0.21.2 → 0.21.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: 9b5d1173eefe9342b59f6b403dbc575a08df5c422ec3e7818da37438b87694b5
4
- data.tar.gz: dda825a1c7e89125354a42d8930a54ac9ed59ab5f9138694ba0ac4290248eda9
3
+ metadata.gz: 499a395ac34e3e202310dbe492af5735bf57244af647ca9aea839c29636ca1b8
4
+ data.tar.gz: 0122ccd831be8640e4ba0faa010a9bc3229dbe0dcefb9eedc42a5d5a33cb2ad9
5
5
  SHA512:
6
- metadata.gz: d86172233a071be4ad87fbe6cf8db1845c4a2f5b82f08f2e2f963b2a3290b79f4242e4316fd09d48646d4fac4907d7afbd5f5766ab884eb9f2910d9877a50f40
7
- data.tar.gz: 60549c9c85efa3572492fb9a7afbbb14c2cd4d7ffc78f8f55bd4c546fd7d637d4d7c401733e673c9df12bdb3ac34272331e577aa4e55ac7261f2706d2e5851e6
6
+ metadata.gz: 0f31eda96afd418bb9dbb61cf020c3518f1183ce019aa28fa977755f1c0074f806b4ced0b0355727cf59b9cd9e1c287e734769aff632f17b722846e54570ddf2
7
+ data.tar.gz: 2b1d1774879089a7dd4584751508a2831bc914219dc68d680f92ae5d75371204875c239393d7dafad7eb9086e1341aaa2dc0b51319e0ae9c14de2b856eaefe27
data/Gemfile CHANGED
@@ -3,9 +3,9 @@ source "https://rubygems.org"
3
3
  # Specify your gem's dependencies in souls.gemspec
4
4
  gemspec
5
5
 
6
- gem "activesupport", "6.1.3.2"
6
+ gem "activesupport", "6.1.4"
7
7
  gem "parser", "3.0.1.1"
8
- gem "rake", "13.0.3"
8
+ gem "rake", "13.0.4"
9
9
  gem "rspec", "3.10.0"
10
- gem "rubocop", "1.15.0"
10
+ gem "rubocop", "1.18.3"
11
11
  gem "steep", "0.44.1"
data/Gemfile.lock CHANGED
@@ -1,21 +1,21 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- souls (0.21.2)
4
+ souls (0.21.6)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
8
8
  specs:
9
- activesupport (6.1.3.2)
9
+ activesupport (6.1.4)
10
10
  concurrent-ruby (~> 1.0, >= 1.0.2)
11
11
  i18n (>= 1.6, < 2)
12
12
  minitest (>= 5.1)
13
13
  tzinfo (~> 2.0)
14
14
  zeitwerk (~> 2.3)
15
15
  ast (2.4.2)
16
- concurrent-ruby (1.1.8)
16
+ concurrent-ruby (1.1.9)
17
17
  diff-lcs (1.4.4)
18
- ffi (1.15.1)
18
+ ffi (1.15.3)
19
19
  i18n (1.8.10)
20
20
  concurrent-ruby (~> 1.0)
21
21
  language_server-protocol (3.16.0.1)
@@ -27,7 +27,7 @@ GEM
27
27
  parser (3.0.1.1)
28
28
  ast (~> 2.4.1)
29
29
  rainbow (3.0.0)
30
- rake (13.0.3)
30
+ rake (13.0.4)
31
31
  rb-fsevent (0.11.0)
32
32
  rb-inotify (0.10.1)
33
33
  ffi (~> 1.0)
@@ -47,16 +47,16 @@ GEM
47
47
  diff-lcs (>= 1.2.0, < 2.0)
48
48
  rspec-support (~> 3.10.0)
49
49
  rspec-support (3.10.2)
50
- rubocop (1.15.0)
50
+ rubocop (1.18.3)
51
51
  parallel (~> 1.10)
52
52
  parser (>= 3.0.0.0)
53
53
  rainbow (>= 2.2.2, < 4.0)
54
54
  regexp_parser (>= 1.8, < 3.0)
55
55
  rexml
56
- rubocop-ast (>= 1.5.0, < 2.0)
56
+ rubocop-ast (>= 1.7.0, < 2.0)
57
57
  ruby-progressbar (~> 1.7)
58
58
  unicode-display_width (>= 1.4.0, < 3.0)
59
- rubocop-ast (1.6.0)
59
+ rubocop-ast (1.7.0)
60
60
  parser (>= 3.0.1.1)
61
61
  ruby-progressbar (1.11.0)
62
62
  steep (0.44.1)
@@ -76,17 +76,16 @@ GEM
76
76
  zeitwerk (2.4.2)
77
77
 
78
78
  PLATFORMS
79
- x86_64-darwin-20
80
79
  x86_64-linux
81
80
 
82
81
  DEPENDENCIES
83
- activesupport (= 6.1.3.2)
82
+ activesupport (= 6.1.4)
84
83
  parser (= 3.0.1.1)
85
- rake (= 13.0.3)
84
+ rake (= 13.0.4)
86
85
  rspec (= 3.10.0)
87
- rubocop (= 1.15.0)
86
+ rubocop (= 1.18.3)
88
87
  souls!
89
88
  steep (= 0.44.1)
90
89
 
91
90
  BUNDLED WITH
92
- 2.2.18
91
+ 2.2.21
data/README.md CHANGED
@@ -1,4 +1,4 @@
1
- [![SOULs](https://firebasestorage.googleapis.com/v0/b/el-quest.appspot.com/o/mediaLibrary%2F1605615287402_souls-ogp.jpg?alt=media&token=1115aa76-6863-469d-acc8-9815ca7fac37)](https://rubygems.org/gems/souls)
1
+ [![SOULs](https://storage.googleapis.com/souls/souls-ogp-vertical.jpg)](https://rubygems.org/gems/souls)
2
2
 
3
3
  <p align="center">
4
4
  <a aria-label="Ruby logo" href="https://el-soul.com">
@@ -77,7 +77,7 @@ And Create Your APP
77
77
 
78
78
  ## SOULs Document
79
79
 
80
- - [SOULs Document](https://elsoul.github.io/souls_doc/)
80
+ - [SOULs Document](https://souls-doc.el-soul.com/)
81
81
 
82
82
 
83
83
 
data/exe/souls CHANGED
@@ -99,7 +99,7 @@ begin
99
99
  when "migration"
100
100
  system "rake db:create_migration NAME=create_#{ARGV[2]}"
101
101
  when "update"
102
- Souls::Generate.delete_all class_name: ARGV[2]
102
+ Souls::Generate.update_delete class_name: ARGV[2]
103
103
  Souls::Generate.single_migrate class_name: ARGV[2]
104
104
  else
105
105
  "SOULs!"
@@ -138,8 +138,8 @@ begin
138
138
  system "rubocop -a"
139
139
  system "bundle exec rspec"
140
140
  when "run"
141
- system "docker build . -t souls:latest"
142
- system "docker run --rm -p 3000:3000 souls:latest"
141
+ system "docker build . -t souls -f Dockerfile.dev"
142
+ system "docker run --rm --env-file .env -p 3000:3000 souls:latest"
143
143
  when "deploy"
144
144
  system "gcloud builds submit --config=cloudbuild.yml --project #{ARGV[1]}"
145
145
  else
@@ -134,6 +134,23 @@ module Souls
134
134
  puts error
135
135
  end
136
136
 
137
+ def update_delete class_name: "souls"
138
+ singularized_class_name = class_name.singularize.underscore
139
+ pluralized_class_name = class_name.pluralize.underscore
140
+ FileUtils.rm_rf "./app/graphql/mutations/#{singularized_class_name}"
141
+ FileUtils.rm "./app/graphql/queries/#{singularized_class_name}.rb"
142
+ FileUtils.rm "./app/graphql/queries/#{pluralized_class_name}.rb"
143
+ FileUtils.rm "./app/graphql/resolvers/#{singularized_class_name}_search.rb"
144
+ FileUtils.rm "./app/graphql/types/#{singularized_class_name}_type.rb"
145
+ FileUtils.rm "./app/graphql/types/#{singularized_class_name}_node_type.rb"
146
+ FileUtils.rm "./spec/mutations/#{singularized_class_name}_spec.rb"
147
+ FileUtils.rm "./spec/queries/#{singularized_class_name}_spec.rb"
148
+ FileUtils.rm "./spec/resolvers/#{singularized_class_name}_search_spec.rb"
149
+ puts "deleted #{class_name.camelize} CRUD!"
150
+ rescue StandardError => error
151
+ puts error
152
+ end
153
+
137
154
  def single_migrate class_name: "user"
138
155
  puts "◆◆◆ Let's Auto Generate CRUD API SET ◆◆◆\n"
139
156
  migrate class_name: class_name
@@ -5,9 +5,9 @@ module Souls
5
5
  ## 1.Mutation - Create
6
6
  def create_mutation_head class_name: "user"
7
7
  singularized_class_name = class_name.singularize.underscore
8
- dir_name = "./app/graphql/mutations/#{singularized_class_name}"
8
+ dir_name = "./app/graphql/mutations/base/#{singularized_class_name}"
9
9
  FileUtils.mkdir_p dir_name unless Dir.exist? dir_name
10
- file_path = "./app/graphql/mutations/#{singularized_class_name}/create_#{singularized_class_name}.rb"
10
+ file_path = "./app/graphql/mutations/base/#{singularized_class_name}/create_#{singularized_class_name}.rb"
11
11
  File.open(file_path, "w") do |new_line|
12
12
  new_line.write <<~EOS
13
13
  module Mutations
@@ -22,7 +22,7 @@ module Souls
22
22
  end
23
23
 
24
24
  def create_mutation_params class_name: "souls"
25
- file_path = "./app/graphql/mutations/#{class_name}/create_#{class_name}.rb"
25
+ file_path = "./app/graphql/mutations/base/#{class_name}/create_#{class_name}.rb"
26
26
  path = "./db/schema.rb"
27
27
  @on = false
28
28
  @user_exist = false
@@ -70,7 +70,7 @@ module Souls
70
70
 
71
71
  def create_mutation_after_params class_name: "article", relation_params: []
72
72
  return false if relation_params.empty?
73
- file_path = "./app/graphql/mutations/#{class_name}/create_#{class_name}.rb"
73
+ file_path = "./app/graphql/mutations/base/#{class_name}/create_#{class_name}.rb"
74
74
  relation_params.each do |params_name|
75
75
  File.open(file_path, "a") do |new_line|
76
76
  new_line.write " _, args[:#{params_name}] = SoulsApiSchema.from_global_id(args[:#{params_name}])\n"
@@ -80,7 +80,7 @@ module Souls
80
80
  end
81
81
 
82
82
  def create_mutation_end class_name: "souls"
83
- file_path = "./app/graphql/mutations/#{class_name}/create_#{class_name}.rb"
83
+ file_path = "./app/graphql/mutations/base/#{class_name}/create_#{class_name}.rb"
84
84
  File.open(file_path, "a") do |new_line|
85
85
  new_line.write <<~EOS
86
86
  #{class_name} = ::#{class_name.camelize}.new args
@@ -102,7 +102,7 @@ module Souls
102
102
 
103
103
  ## 2.Mutation - Update
104
104
  def update_mutation_head class_name: "souls"
105
- file_path = "./app/graphql/mutations/#{class_name}/update_#{class_name}.rb"
105
+ file_path = "./app/graphql/mutations/base/#{class_name}/update_#{class_name}.rb"
106
106
  File.open(file_path, "w") do |new_line|
107
107
  new_line.write <<~EOS
108
108
  module Mutations
@@ -113,10 +113,11 @@ module Souls
113
113
  argument :id, String, required: true
114
114
  EOS
115
115
  end
116
+ file_path
116
117
  end
117
118
 
118
119
  def update_mutation_params class_name: "souls"
119
- file_path = "./app/graphql/mutations/#{class_name}/update_#{class_name}.rb"
120
+ file_path = "./app/graphql/mutations/base/#{class_name}/update_#{class_name}.rb"
120
121
  path = "./db/schema.rb"
121
122
  @on = false
122
123
  @user_exist = false
@@ -166,7 +167,7 @@ module Souls
166
167
 
167
168
  def update_mutation_after_params class_name: "article", relation_params: []
168
169
  return false if relation_params.empty?
169
- file_path = "./app/graphql/mutations/#{class_name}/update_#{class_name}.rb"
170
+ file_path = "./app/graphql/mutations/base/#{class_name}/update_#{class_name}.rb"
170
171
  relation_params.each do |params_name|
171
172
  File.open(file_path, "a") do |new_line|
172
173
  new_line.write " _, args[:#{params_name}] = SoulsApiSchema.from_global_id(args[:#{params_name}])\n"
@@ -176,7 +177,7 @@ module Souls
176
177
  end
177
178
 
178
179
  def update_mutation_end class_name: "souls"
179
- file_path = "./app/graphql/mutations/#{class_name}/update_#{class_name}.rb"
180
+ file_path = "./app/graphql/mutations/base/#{class_name}/update_#{class_name}.rb"
180
181
  File.open(file_path, "a") do |new_line|
181
182
  new_line.write <<~EOS
182
183
  #{class_name} = ::#{class_name.camelize}.find args[:id]
@@ -194,7 +195,7 @@ module Souls
194
195
  end
195
196
 
196
197
  def update_mutation class_name: "souls"
197
- file_path = "./app/graphql/mutations/#{class_name}/update_#{class_name}.rb"
198
+ file_path = "./app/graphql/mutations/base/#{class_name}/update_#{class_name}.rb"
198
199
  return "Mutation already exist! #{file_path}" if File.exist? file_path
199
200
  update_mutation_head class_name: class_name
200
201
  relation_params = update_mutation_params class_name: class_name
@@ -204,7 +205,7 @@ module Souls
204
205
 
205
206
  # 3. Mutation - Delete
206
207
  def delete_mutation class_name: "souls"
207
- file_path = "./app/graphql/mutations/#{class_name}/delete_#{class_name}.rb"
208
+ file_path = "./app/graphql/mutations/base/#{class_name}/delete_#{class_name}.rb"
208
209
  return "Mutation already exist! #{file_path}" if File.exist? file_path
209
210
  File.open(file_path, "w") do |f|
210
211
  f.write <<~EOS
@@ -232,7 +233,7 @@ module Souls
232
233
 
233
234
  # 4. Mutation - Destroy Delete
234
235
  def destroy_delete_mutation class_name: "souls"
235
- file_path = "./app/graphql/mutations/#{class_name}/destroy_delete_#{class_name}.rb"
236
+ file_path = "./app/graphql/mutations/base/#{class_name}/destroy_delete_#{class_name}.rb"
236
237
  return "Mutation already exist! #{file_path}" if File.exist? file_path
237
238
  File.open(file_path, "w") do |f|
238
239
  f.write <<~EOS
@@ -262,11 +263,12 @@ module Souls
262
263
 
263
264
  def mutation class_name: "souls"
264
265
  singularized_class_name = class_name.singularize
265
- file_path = "./app/graphql/mutations/#{singularized_class_name}/create_#{singularized_class_name}.rb"
266
+ file_path = "./app/graphql/mutations/base/#{singularized_class_name}/create_#{singularized_class_name}.rb"
266
267
  return "Mutation already exist! #{file_path}" if File.exist? file_path
267
268
  create_mutation_head class_name: singularized_class_name
268
269
  relation_params = create_mutation_params class_name: singularized_class_name
269
270
  create_mutation_after_params class_name: singularized_class_name, relation_params: relation_params
271
+ # puts "File Created!\n#{file_path}"
270
272
  [
271
273
  create_mutation_end(class_name: singularized_class_name),
272
274
  update_mutation(class_name: singularized_class_name),
@@ -123,17 +123,14 @@ module Souls
123
123
  file_path = "./app/graphql/resolvers/#{class_name.singularize}_search.rb"
124
124
  File.open(file_path, "a") do |f|
125
125
  f.write <<~EOS
126
- scope = scope.where("created_at >= ?", value[:start_date]) if value[:start_date]
127
- scope = scope.where("created_at <= ?", value[:end_date]) if value[:end_date]
128
- #{' '}
129
- branches << scope
130
- #{' '}
131
- value[:OR].inject(branches) { |s, v| normalize_filters(v, s) } if value[:OR].present?
132
- #{' '}
133
- branches
134
- end
135
- end
136
- end
126
+ scope = scope.where("created_at >= ?", value[:start_date]) if value[:start_date]
127
+ scope = scope.where("created_at <= ?", value[:end_date]) if value[:end_date]
128
+ branches << scope
129
+ value[:OR].inject(branches) { |s, v| normalize_filters(v, s) } if value[:OR].present?
130
+ branches
131
+ end
132
+ end
133
+ end
137
134
  EOS
138
135
  end
139
136
  file_path
@@ -147,6 +144,7 @@ module Souls
147
144
  resolver_params class_name: singularized_class_name
148
145
  resolver_after_params class_name: singularized_class_name
149
146
  resolver_before_end class_name: singularized_class_name
147
+ # puts "File Created!\n#{file_path}"
150
148
  resolver_end class_name: singularized_class_name
151
149
  end
152
150
  end
@@ -4,6 +4,7 @@ module Souls
4
4
  ## Generate Rspec Factory
5
5
  def rspec_factory_head class_name: "souls"
6
6
  file_path = "./spec/factories/#{class_name.pluralize}.rb"
7
+ FileUtils.mkdir_p "./spec/factories/" unless Dir.exist? "./spec/factories/"
7
8
  File.open(file_path, "w") do |f|
8
9
  f.write <<~EOS
9
10
  FactoryBot.define do
@@ -3,7 +3,7 @@ module Souls
3
3
  class << self
4
4
  ## Generate Rspec Mutation
5
5
  def rspec_mutation_head class_name: "souls"
6
- file_path = "./spec/mutations/#{class_name.singularize}_spec.rb"
6
+ file_path = "./spec/mutations/base/#{class_name.singularize}_spec.rb"
7
7
  File.open(file_path, "w") do |f|
8
8
  f.write <<~EOS
9
9
  RSpec.describe \"#{class_name.camelize} Mutation テスト\" do
@@ -13,7 +13,7 @@ module Souls
13
13
  end
14
14
 
15
15
  def rspec_mutation_after_head class_name: "souls"
16
- file_path = "./spec/mutations/#{class_name.singularize}_spec.rb"
16
+ file_path = "./spec/mutations/base/#{class_name.singularize}_spec.rb"
17
17
  path = "./db/schema.rb"
18
18
  @on = false
19
19
  @user_exist = false
@@ -62,7 +62,7 @@ module Souls
62
62
  end
63
63
 
64
64
  def rspec_mutation_params class_name: "souls"
65
- file_path = "./spec/mutations/#{class_name.singularize}_spec.rb"
65
+ file_path = "./spec/mutations/base/#{class_name.singularize}_spec.rb"
66
66
  path = "./db/schema.rb"
67
67
  @on = false
68
68
  @user_exist = false
@@ -106,7 +106,7 @@ module Souls
106
106
  end
107
107
 
108
108
  def rspec_mutation_params_response class_name: "souls"
109
- file_path = "./spec/mutations/#{class_name.singularize}_spec.rb"
109
+ file_path = "./spec/mutations/base/#{class_name.singularize}_spec.rb"
110
110
  path = "./db/schema.rb"
111
111
  @on = false
112
112
  File.open(file_path, "a") do |new_line|
@@ -188,7 +188,7 @@ module Souls
188
188
  end
189
189
 
190
190
  def rspec_mutation_end class_name: "souls"
191
- file_path = "./spec/mutations/#{class_name.singularize}_spec.rb"
191
+ file_path = "./spec/mutations/base/#{class_name.singularize}_spec.rb"
192
192
  path = "./db/schema.rb"
193
193
  @on = false
194
194
  File.open(file_path, "a") do |new_line|
@@ -236,7 +236,7 @@ module Souls
236
236
 
237
237
  def rspec_mutation class_name: "souls"
238
238
  singularized_class_name = class_name.singularize
239
- file_path = "./spec/mutations/#{singularized_class_name}_spec.rb"
239
+ file_path = "./spec/mutations/base/#{singularized_class_name}_spec.rb"
240
240
  return "RspecMutation already exist! #{file_path}" if File.exist? file_path
241
241
  rspec_mutation_head class_name: singularized_class_name
242
242
  rspec_mutation_after_head class_name: singularized_class_name
@@ -33,7 +33,7 @@ module Souls
33
33
  context "being a staff" do
34
34
  let(:user) { FactoryBot.create(:user, user_role: 3) }
35
35
 
36
- it { is_expected.to permit_actions([:create, :update, :delete]) }
36
+ it { is_expected.to permit_actions([:create, :update]) }
37
37
  end
38
38
 
39
39
  context "being an administrator" do
@@ -33,7 +33,6 @@ module Souls
33
33
  #{class_name.singularize.camelize(:lower)}(id: \\"\#{data_id}\\") {
34
34
  id
35
35
  EOS
36
- break
37
36
  else
38
37
  new_line.write <<-EOS
39
38
  let(:#{class_name}) { FactoryBot.create(:#{class_name}, #{@relation_params.join(", ")}) }
@@ -44,8 +43,8 @@ module Souls
44
43
  #{class_name.singularize.camelize(:lower)}(id: \\"\#{data_id}\\") {
45
44
  id
46
45
  EOS
47
- break
48
46
  end
47
+ break
49
48
  end
50
49
  _, name = line.split(",")[0].gsub("\"", "").scan(/((?<=t\.).+(?=\s)) (.+)/)[0]
51
50
  case name
data/lib/souls/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Souls
2
- VERSION = "0.21.2"
2
+ VERSION = "0.21.7"
3
3
  end
metadata CHANGED
@@ -1,16 +1,16 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: souls
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.21.2
4
+ version: 0.21.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - POPPIN-FUMI
8
8
  - KishiTheMechanic
9
9
  - James Neve
10
- autorequire:
10
+ autorequire:
11
11
  bindir: exe
12
12
  cert_chain: []
13
- date: 2021-05-27 00:00:00.000000000 Z
13
+ date: 2021-07-07 00:00:00.000000000 Z
14
14
  dependencies: []
15
15
  description: SOULS is a GraphQL Based Web Application Framework for Microservices
16
16
  on Multi Cloud Platform such as Google Cloud Platform, Amazon Web Services, and
@@ -69,7 +69,7 @@ metadata:
69
69
  homepage_uri: https://github.com/elsoul/souls
70
70
  source_code_uri: https://github.com/elsoul/souls
71
71
  changelog_uri: https://github.com/elsoul/souls
72
- post_install_message:
72
+ post_install_message:
73
73
  rdoc_options: []
74
74
  require_paths:
75
75
  - lib
@@ -85,7 +85,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
85
85
  version: '0'
86
86
  requirements: []
87
87
  rubygems_version: 3.2.15
88
- signing_key:
88
+ signing_key:
89
89
  specification_version: 4
90
90
  summary: SOULS is a GraphQL Based Web Application Framework for Microservices on Multi
91
91
  Cloud Platform such as Google Cloud Platform, Amazon Web Services, and Alibaba Cloud.