souls 0.20.9 → 0.21.4

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: 443214d6bae9d05c4e444ada56df4c39dc331bffceb85c22dd0b6ebf0b4573ee
4
- data.tar.gz: 0eb3086895580711fd9b86d4810610ba650b853494962c0bc4b56e790281bb82
3
+ metadata.gz: fb337b1ca467483546c4704adda9a1dc12c7378b806558fbb9fbad95bb014e54
4
+ data.tar.gz: 513b3415539ecdf5a47c47da4f64f63bf85a3c5e51360d4c8194b1ad9ead0933
5
5
  SHA512:
6
- metadata.gz: 7fe66e3281f85e2d0149eb92020142b91683fd3155cc813563c3e0a8363aedadf6cfe7769d16a8b41c7ab8d34e78d00ea6f10ac952ee41cded241d98157dc9b2
7
- data.tar.gz: 232f7e7012f7e8a27306744753b33d4923f2f2502fab0a940e0b9634848bc2f4b56d629611010d896e03014e8f1174a120ddaefa6653c688cd33d004aebc162f
6
+ metadata.gz: 4b1710a3d01e9f153430d095b6440960bc88a6d58998f899040250b72d39d9cdd795eb765b9da6f92370400cac0ff973e9bd0bc72d454219750290b5e90a5ee8
7
+ data.tar.gz: 8d326e8302499e91918ce6cd562ad1a76d58fb139720db48381e916259ca89dc2e02e15b905afb661d90a2fae3c1b0db03fd9380e63d335aaeff68d0a7624cef
data/.ruby-version CHANGED
@@ -1 +1 @@
1
- 3.0.0
1
+ 3.0.1
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.0"
7
- gem "parser", "3.0.0"
6
+ gem "activesupport", "6.1.3.2"
7
+ gem "parser", "3.0.1.1"
8
8
  gem "rake", "13.0.3"
9
- gem "rspec", "3.1.0"
10
- gem "rubocop", "1.12.1"
11
- gem "steep", "0.43.1"
9
+ gem "rspec", "3.10.0"
10
+ gem "rubocop", "1.16.1"
11
+ gem "steep", "0.44.1"
data/Gemfile.lock CHANGED
@@ -1,91 +1,91 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- souls (0.20.9)
4
+ souls (0.21.3)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
8
8
  specs:
9
- activesupport (6.1.0)
9
+ activesupport (6.1.3.2)
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.0)
18
+ ffi (1.15.1)
19
19
  i18n (1.8.10)
20
20
  concurrent-ruby (~> 1.0)
21
- language_server-protocol (3.16.0.0)
21
+ language_server-protocol (3.16.0.1)
22
22
  listen (3.5.1)
23
23
  rb-fsevent (~> 0.10, >= 0.10.3)
24
24
  rb-inotify (~> 0.9, >= 0.9.10)
25
25
  minitest (5.14.4)
26
26
  parallel (1.20.1)
27
- parser (3.0.0.0)
27
+ parser (3.0.1.1)
28
28
  ast (~> 2.4.1)
29
29
  rainbow (3.0.0)
30
30
  rake (13.0.3)
31
- rb-fsevent (0.10.4)
31
+ rb-fsevent (0.11.0)
32
32
  rb-inotify (0.10.1)
33
33
  ffi (~> 1.0)
34
- rbs (1.1.1)
34
+ rbs (1.2.1)
35
35
  regexp_parser (2.1.1)
36
36
  rexml (3.2.5)
37
- rspec (3.1.0)
38
- rspec-core (~> 3.1.0)
39
- rspec-expectations (~> 3.1.0)
40
- rspec-mocks (~> 3.1.0)
41
- rspec-core (3.1.7)
42
- rspec-support (~> 3.1.0)
43
- rspec-expectations (3.1.2)
37
+ rspec (3.10.0)
38
+ rspec-core (~> 3.10.0)
39
+ rspec-expectations (~> 3.10.0)
40
+ rspec-mocks (~> 3.10.0)
41
+ rspec-core (3.10.1)
42
+ rspec-support (~> 3.10.0)
43
+ rspec-expectations (3.10.1)
44
44
  diff-lcs (>= 1.2.0, < 2.0)
45
- rspec-support (~> 3.1.0)
46
- rspec-mocks (3.1.3)
47
- rspec-support (~> 3.1.0)
48
- rspec-support (3.1.2)
49
- rubocop (1.12.1)
45
+ rspec-support (~> 3.10.0)
46
+ rspec-mocks (3.10.2)
47
+ diff-lcs (>= 1.2.0, < 2.0)
48
+ rspec-support (~> 3.10.0)
49
+ rspec-support (3.10.2)
50
+ rubocop (1.16.1)
50
51
  parallel (~> 1.10)
51
52
  parser (>= 3.0.0.0)
52
53
  rainbow (>= 2.2.2, < 4.0)
53
54
  regexp_parser (>= 1.8, < 3.0)
54
55
  rexml
55
- rubocop-ast (>= 1.2.0, < 2.0)
56
+ rubocop-ast (>= 1.7.0, < 2.0)
56
57
  ruby-progressbar (~> 1.7)
57
58
  unicode-display_width (>= 1.4.0, < 3.0)
58
- rubocop-ast (1.4.1)
59
- parser (>= 2.7.1.5)
59
+ rubocop-ast (1.7.0)
60
+ parser (>= 3.0.1.1)
60
61
  ruby-progressbar (1.11.0)
61
- steep (0.43.1)
62
+ steep (0.44.1)
62
63
  activesupport (>= 5.1)
63
64
  language_server-protocol (>= 3.15, < 4.0)
64
65
  listen (~> 3.0)
65
66
  parallel (>= 1.0.0)
66
67
  parser (>= 2.7)
67
68
  rainbow (>= 2.2.2, < 4.0)
68
- rbs (~> 1.1.0)
69
+ rbs (>= 1.2.0)
69
70
  terminal-table (>= 2, < 4)
70
- terminal-table (3.0.0)
71
- unicode-display_width (~> 1.1, >= 1.1.1)
71
+ terminal-table (3.0.1)
72
+ unicode-display_width (>= 1.1.1, < 3)
72
73
  tzinfo (2.0.4)
73
74
  concurrent-ruby (~> 1.0)
74
- unicode-display_width (1.7.0)
75
+ unicode-display_width (2.0.0)
75
76
  zeitwerk (2.4.2)
76
77
 
77
78
  PLATFORMS
78
- x86_64-darwin-20
79
79
  x86_64-linux
80
80
 
81
81
  DEPENDENCIES
82
- activesupport (= 6.1.0)
83
- parser (= 3.0.0)
82
+ activesupport (= 6.1.3.2)
83
+ parser (= 3.0.1.1)
84
84
  rake (= 13.0.3)
85
- rspec (= 3.1.0)
86
- rubocop (= 1.12.1)
85
+ rspec (= 3.10.0)
86
+ rubocop (= 1.16.1)
87
87
  souls!
88
- steep (= 0.43.1)
88
+ steep (= 0.44.1)
89
89
 
90
90
  BUNDLED WITH
91
- 2.2.14
91
+ 2.2.19
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">
data/exe/souls CHANGED
@@ -98,16 +98,21 @@ begin
98
98
  Souls::Generate.migrate_all
99
99
  when "migration"
100
100
  system "rake db:create_migration NAME=create_#{ARGV[2]}"
101
+ when "update"
102
+ Souls::Generate.update_delete class_name: ARGV[2]
103
+ Souls::Generate.single_migrate class_name: ARGV[2]
101
104
  else
102
105
  "SOULs!"
103
106
  end
104
107
  when "d"
105
108
  Souls::Generate.delete_all class_name: ARGV[1]
106
- when "update"
107
- Souls::Generate.add_delete class_name: ARGV[1]
108
- Souls::Generate.single_migrate class_name: ARGV[1]
109
109
  when "db:create"
110
- system "rake db:create && rake db:create RACK_ENV=test"
110
+ case ARGV[1]
111
+ when "RACK_ENV=production"
112
+ system "rake db:create RACK_ENV=production"
113
+ else
114
+ system "rake db:create && rake db:create RACK_ENV=test"
115
+ end
111
116
  when "db:migrate"
112
117
  case ARGV[1]
113
118
  when "RACK_ENV=production"
@@ -1,51 +1,20 @@
1
- Dir["#{__dir__}/lib/souls/generate/*.rb"].each { |f| require_relative f.gsub("./lib/souls", ".")}
1
+ # Did not work client side
2
+ # Dir["#{__dir__}/lib/souls/generate/*.rb"].each { |f| require_relative f.gsub("./lib/souls", ".")}
3
+ require_relative "./generate/model"
4
+ require_relative "./generate/mutation"
5
+ require_relative "./generate/policy"
6
+ require_relative "./generate/query"
7
+ require_relative "./generate/resolver"
8
+ require_relative "./generate/rspec_factory"
9
+ require_relative "./generate/rspec_model"
10
+ require_relative "./generate/rspec_mutation"
2
11
  require_relative "./generate/rspec_policy"
12
+ require_relative "./generate/rspec_query"
13
+ require_relative "./generate/rspec_resolver"
14
+ require_relative "./generate/type"
15
+ require_relative "./generate/application"
3
16
 
4
17
  module Souls
5
18
  module Generate
6
- def self.policy class_name: "souls"
7
- dir_name = "./app/policies"
8
- FileUtils.mkdir_p dir_name unless Dir.exist? dir_name
9
- file_path = "#{dir_name}/#{class_name.singularize}_policy.rb"
10
- File.open(file_path, "w") do |f|
11
- f.write <<~EOS
12
- class #{class_name.camelize}Policy < ApplicationPolicy
13
- def show?
14
- admin_permissions?
15
- end
16
-
17
- def index?
18
- admin_permissions?
19
- end
20
-
21
- def create?
22
- admin_permissions?
23
- end
24
-
25
- def update?
26
- admin_permissions?
27
- end
28
-
29
- def delete?
30
- admin_permissions?
31
- end
32
-
33
- private
34
-
35
- def staff_permissions?
36
- @user.master? or @user.admin? or @user.staff?
37
- end
38
-
39
- def admin_permissions?
40
- @user.master? or @user.admin?
41
- end
42
- end
43
- EOS
44
- end
45
- file_path
46
- rescue StandardError => error
47
- puts "method error"
48
- puts error.backtrace
49
- end
50
19
  end
51
20
  end
@@ -106,7 +106,9 @@ module Souls
106
106
  rspec_query: rspec_query(class_name: singularized_class_name),
107
107
  rspec_resolver: rspec_resolver(class_name: singularized_class_name),
108
108
  queries: query(class_name: singularized_class_name),
109
- mutations: mutation(class_name: singularized_class_name)
109
+ mutations: mutation(class_name: singularized_class_name),
110
+ policies: policy(class_name: singularized_class_name),
111
+ rspec_policies: rspec_policy(class_name: singularized_class_name)
110
112
  ]
111
113
  end
112
114
 
@@ -132,6 +134,23 @@ module Souls
132
134
  puts error
133
135
  end
134
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
+
135
154
  def single_migrate class_name: "user"
136
155
  puts "◆◆◆ Let's Auto Generate CRUD API SET ◆◆◆\n"
137
156
  migrate class_name: class_name
@@ -113,6 +113,7 @@ 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"
@@ -194,6 +195,8 @@ module Souls
194
195
  end
195
196
 
196
197
  def update_mutation class_name: "souls"
198
+ file_path = "./app/graphql/mutations/#{class_name}/update_#{class_name}.rb"
199
+ return "Mutation already exist! #{file_path}" if File.exist? file_path
197
200
  update_mutation_head class_name: class_name
198
201
  relation_params = update_mutation_params class_name: class_name
199
202
  update_mutation_after_params class_name: class_name, relation_params: relation_params
@@ -203,6 +206,7 @@ module Souls
203
206
  # 3. Mutation - Delete
204
207
  def delete_mutation class_name: "souls"
205
208
  file_path = "./app/graphql/mutations/#{class_name}/delete_#{class_name}.rb"
209
+ return "Mutation already exist! #{file_path}" if File.exist? file_path
206
210
  File.open(file_path, "w") do |f|
207
211
  f.write <<~EOS
208
212
  module Mutations
@@ -230,6 +234,7 @@ module Souls
230
234
  # 4. Mutation - Destroy Delete
231
235
  def destroy_delete_mutation class_name: "souls"
232
236
  file_path = "./app/graphql/mutations/#{class_name}/destroy_delete_#{class_name}.rb"
237
+ return "Mutation already exist! #{file_path}" if File.exist? file_path
233
238
  File.open(file_path, "w") do |f|
234
239
  f.write <<~EOS
235
240
  module Mutations
@@ -258,7 +263,8 @@ module Souls
258
263
 
259
264
  def mutation class_name: "souls"
260
265
  singularized_class_name = class_name.singularize
261
-
266
+ file_path = "./app/graphql/mutations/#{singularized_class_name}/create_#{singularized_class_name}.rb"
267
+ return "Mutation already exist! #{file_path}" if File.exist? file_path
262
268
  create_mutation_head class_name: singularized_class_name
263
269
  relation_params = create_mutation_params class_name: singularized_class_name
264
270
  create_mutation_after_params class_name: singularized_class_name, relation_params: relation_params
@@ -6,23 +6,24 @@ module Souls
6
6
  dir_name = "./app/policies"
7
7
  FileUtils.mkdir_p dir_name unless Dir.exist? dir_name
8
8
  file_path = "#{dir_name}/#{class_name.singularize}_policy.rb"
9
+ return "Policy already exist! #{file_path}" if File.exist? file_path
9
10
  File.open(file_path, "w") do |f|
10
11
  f.write <<~EOS
11
12
  class #{class_name.camelize}Policy < ApplicationPolicy
12
13
  def show?
13
- admin_permissions?
14
+ true
14
15
  end
15
16
 
16
17
  def index?
17
- admin_permissions?
18
+ true
18
19
  end
19
20
 
20
21
  def create?
21
- admin_permissions?
22
+ staff_permissions?
22
23
  end
23
24
 
24
25
  def update?
25
- admin_permissions?
26
+ staff_permissions?
26
27
  end
27
28
 
28
29
  def delete?
@@ -4,6 +4,7 @@ module Souls
4
4
  ## Generate Query / Queries
5
5
  def create_queries class_name: "souls"
6
6
  file_path = "./app/graphql/queries/#{class_name.pluralize}.rb"
7
+ return "Query already exist! #{file_path}" if File.exist? file_path
7
8
  File.open(file_path, "w") do |f|
8
9
  f.write <<~EOS
9
10
  module Queries
@@ -24,6 +25,7 @@ module Souls
24
25
 
25
26
  def create_query class_name: "souls"
26
27
  file_path = "./app/graphql/queries/#{class_name}.rb"
28
+ return "Query already exist! #{file_path}" if File.exist? file_path
27
29
  File.open(file_path, "w") do |f|
28
30
  f.write <<~EOS
29
31
  module Queries
@@ -6,7 +6,6 @@ module Souls
6
6
  FileUtils.mkdir_p "./app/graphql/resolvers" unless Dir.exist? "./app/graphql/resolvers"
7
7
  file_path = "./app/graphql/resolvers/#{class_name.singularize}_search.rb"
8
8
  @relation_params = []
9
- return ["Resolver already exist! #{file_path}"] if File.exist? file_path
10
9
  File.open(file_path, "w") do |f|
11
10
  f.write <<~EOS
12
11
  module Resolvers
@@ -126,11 +125,8 @@ module Souls
126
125
  f.write <<~EOS
127
126
  scope = scope.where("created_at >= ?", value[:start_date]) if value[:start_date]
128
127
  scope = scope.where("created_at <= ?", value[:end_date]) if value[:end_date]
129
- #{' '}
130
128
  branches << scope
131
- #{' '}
132
129
  value[:OR].inject(branches) { |s, v| normalize_filters(v, s) } if value[:OR].present?
133
- #{' '}
134
130
  branches
135
131
  end
136
132
  end
@@ -142,6 +138,8 @@ module Souls
142
138
 
143
139
  def resolver class_name: "souls"
144
140
  singularized_class_name = class_name.singularize.underscore
141
+ file_path = "./app/graphql/resolvers/#{singularized_class_name}_search.rb"
142
+ return "Resolver already exist! #{file_path}" if File.exist? file_path
145
143
  resolver_head class_name: singularized_class_name
146
144
  resolver_params class_name: singularized_class_name
147
145
  resolver_after_params class_name: singularized_class_name
@@ -52,7 +52,7 @@ module Souls
52
52
 
53
53
  def rspec_factory class_name: "souls"
54
54
  file_path = "./spec/factories/#{class_name.pluralize}.rb"
55
- return ["Factory aleady exist! #{file_path}"] if File.exist? file_path
55
+ return "RspecFactory already exist! #{file_path}" if File.exist? file_path
56
56
  singularized_class_name = class_name.singularize
57
57
  rspec_factory_head class_name: singularized_class_name
58
58
  rspec_factory_params class_name: singularized_class_name
@@ -4,7 +4,7 @@ module Souls
4
4
  ## Generate Rspec Model
5
5
  def rspec_model class_name: "souls"
6
6
  file_path = "./spec/models/#{class_name}_spec.rb"
7
- return ["Aleady Exist!"] if File.exist? file_path
7
+ return "RspecModel already exist! #{file_path}" if File.exist? file_path
8
8
  File.open(file_path, "w") do |f|
9
9
  f.write <<~EOS
10
10
  RSpec.describe "#{class_name.camelize} Model テスト", type: :model do
@@ -236,6 +236,8 @@ 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"
240
+ return "RspecMutation already exist! #{file_path}" if File.exist? file_path
239
241
  rspec_mutation_head class_name: singularized_class_name
240
242
  rspec_mutation_after_head class_name: singularized_class_name
241
243
  rspec_mutation_params class_name: singularized_class_name
@@ -6,6 +6,7 @@ module Souls
6
6
  dir_name = "./spec/policies"
7
7
  FileUtils.mkdir_p dir_name unless Dir.exist? dir_name
8
8
  file_path = "./spec/policies/#{class_name}_policy_spec.rb"
9
+ return "RspecPolicy already exist! #{file_path}" if File.exist? file_path
9
10
  File.open(file_path, "w") do |new_line|
10
11
  new_line.write <<~EOS
11
12
  describe #{class_name.camelize}Policy do
@@ -159,6 +159,8 @@ module Souls
159
159
 
160
160
  def rspec_query class_name: "souls"
161
161
  singularized_class_name = class_name.singularize
162
+ file_path = "./spec/queries/#{singularized_class_name}_spec.rb"
163
+ return "RspecQuery already exist! #{file_path}" if File.exist? file_path
162
164
  rspec_query_head class_name: singularized_class_name
163
165
  rspec_query_after_head class_name: singularized_class_name
164
166
  rspec_query_params class_name: singularized_class_name
@@ -71,6 +71,8 @@ module Souls
71
71
 
72
72
  def type class_name: "souls"
73
73
  singularized_class_name = class_name.singularize
74
+ file_path = "./app/graphql/types/#{singularized_class_name}_node_type.rb"
75
+ return "Type already exist! #{file_path}" if File.exist? file_path
74
76
  create_type_head class_name: singularized_class_name
75
77
  create_type_params class_name: singularized_class_name
76
78
  [
data/lib/souls/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Souls
2
- VERSION = "0.20.9"
2
+ VERSION = "0.21.4"
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.20.9
4
+ version: 0.21.4
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-23 00:00:00.000000000 Z
13
+ date: 2021-06-09 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
@@ -84,8 +84,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
84
84
  - !ruby/object:Gem::Version
85
85
  version: '0'
86
86
  requirements: []
87
- rubygems_version: 3.2.3
88
- signing_key:
87
+ rubygems_version: 3.2.15
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.