souls 0.20.7 → 0.21.2
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 +4 -4
- data/.ruby-version +1 -1
- data/Gemfile +5 -5
- data/Gemfile.lock +34 -33
- data/exe/souls +9 -4
- data/lib/souls/generate.rb +16 -45
- data/lib/souls/generate/application.rb +3 -1
- data/lib/souls/generate/mutation.rb +6 -1
- data/lib/souls/generate/policy.rb +5 -4
- data/lib/souls/generate/query.rb +2 -0
- data/lib/souls/generate/resolver.rb +2 -1
- data/lib/souls/generate/rspec_factory.rb +1 -1
- data/lib/souls/generate/rspec_model.rb +1 -1
- data/lib/souls/generate/rspec_mutation.rb +2 -0
- data/lib/souls/generate/rspec_policy.rb +1 -0
- data/lib/souls/generate/rspec_query.rb +2 -0
- data/lib/souls/generate/type.rb +2 -0
- data/lib/souls/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9b5d1173eefe9342b59f6b403dbc575a08df5c422ec3e7818da37438b87694b5
|
4
|
+
data.tar.gz: dda825a1c7e89125354a42d8930a54ac9ed59ab5f9138694ba0ac4290248eda9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d86172233a071be4ad87fbe6cf8db1845c4a2f5b82f08f2e2f963b2a3290b79f4242e4316fd09d48646d4fac4907d7afbd5f5766ab884eb9f2910d9877a50f40
|
7
|
+
data.tar.gz: 60549c9c85efa3572492fb9a7afbbb14c2cd4d7ffc78f8f55bd4c546fd7d637d4d7c401733e673c9df12bdb3ac34272331e577aa4e55ac7261f2706d2e5851e6
|
data/.ruby-version
CHANGED
@@ -1 +1 @@
|
|
1
|
-
3.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.
|
7
|
-
gem "parser", "3.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.
|
10
|
-
gem "rubocop", "1.
|
11
|
-
gem "steep", "0.
|
9
|
+
gem "rspec", "3.10.0"
|
10
|
+
gem "rubocop", "1.15.0"
|
11
|
+
gem "steep", "0.44.1"
|
data/Gemfile.lock
CHANGED
@@ -1,12 +1,12 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
souls (0.
|
4
|
+
souls (0.21.2)
|
5
5
|
|
6
6
|
GEM
|
7
7
|
remote: https://rubygems.org/
|
8
8
|
specs:
|
9
|
-
activesupport (6.1.
|
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)
|
@@ -15,63 +15,64 @@ GEM
|
|
15
15
|
ast (2.4.2)
|
16
16
|
concurrent-ruby (1.1.8)
|
17
17
|
diff-lcs (1.4.4)
|
18
|
-
ffi (1.15.
|
18
|
+
ffi (1.15.1)
|
19
19
|
i18n (1.8.10)
|
20
20
|
concurrent-ruby (~> 1.0)
|
21
|
-
language_server-protocol (3.16.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.
|
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.
|
31
|
+
rb-fsevent (0.11.0)
|
32
32
|
rb-inotify (0.10.1)
|
33
33
|
ffi (~> 1.0)
|
34
|
-
rbs (1.
|
34
|
+
rbs (1.2.1)
|
35
35
|
regexp_parser (2.1.1)
|
36
36
|
rexml (3.2.5)
|
37
|
-
rspec (3.
|
38
|
-
rspec-core (~> 3.
|
39
|
-
rspec-expectations (~> 3.
|
40
|
-
rspec-mocks (~> 3.
|
41
|
-
rspec-core (3.1
|
42
|
-
rspec-support (~> 3.
|
43
|
-
rspec-expectations (3.1
|
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.
|
46
|
-
rspec-mocks (3.
|
47
|
-
|
48
|
-
|
49
|
-
|
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.15.0)
|
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.
|
56
|
+
rubocop-ast (>= 1.5.0, < 2.0)
|
56
57
|
ruby-progressbar (~> 1.7)
|
57
58
|
unicode-display_width (>= 1.4.0, < 3.0)
|
58
|
-
rubocop-ast (1.
|
59
|
-
parser (>=
|
59
|
+
rubocop-ast (1.6.0)
|
60
|
+
parser (>= 3.0.1.1)
|
60
61
|
ruby-progressbar (1.11.0)
|
61
|
-
steep (0.
|
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 (
|
69
|
+
rbs (>= 1.2.0)
|
69
70
|
terminal-table (>= 2, < 4)
|
70
|
-
terminal-table (3.0.
|
71
|
-
unicode-display_width (
|
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 (
|
75
|
+
unicode-display_width (2.0.0)
|
75
76
|
zeitwerk (2.4.2)
|
76
77
|
|
77
78
|
PLATFORMS
|
@@ -79,13 +80,13 @@ PLATFORMS
|
|
79
80
|
x86_64-linux
|
80
81
|
|
81
82
|
DEPENDENCIES
|
82
|
-
activesupport (= 6.1.
|
83
|
-
parser (= 3.0.
|
83
|
+
activesupport (= 6.1.3.2)
|
84
|
+
parser (= 3.0.1.1)
|
84
85
|
rake (= 13.0.3)
|
85
|
-
rspec (= 3.
|
86
|
-
rubocop (= 1.
|
86
|
+
rspec (= 3.10.0)
|
87
|
+
rubocop (= 1.15.0)
|
87
88
|
souls!
|
88
|
-
steep (= 0.
|
89
|
+
steep (= 0.44.1)
|
89
90
|
|
90
91
|
BUNDLED WITH
|
91
|
-
2.2.
|
92
|
+
2.2.18
|
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.delete_all 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
|
-
|
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"
|
data/lib/souls/generate.rb
CHANGED
@@ -1,49 +1,20 @@
|
|
1
|
-
|
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"
|
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"
|
16
|
+
|
2
17
|
module Souls
|
3
18
|
module Generate
|
4
|
-
def self.policy class_name: "souls"
|
5
|
-
dir_name = "./app/policies"
|
6
|
-
FileUtils.mkdir_p dir_name unless Dir.exist? dir_name
|
7
|
-
file_path = "#{dir_name}/#{class_name.singularize}_policy.rb"
|
8
|
-
File.open(file_path, "w") do |f|
|
9
|
-
f.write <<~EOS
|
10
|
-
class #{class_name.camelize}Policy < ApplicationPolicy
|
11
|
-
def show?
|
12
|
-
admin_permissions?
|
13
|
-
end
|
14
|
-
|
15
|
-
def index?
|
16
|
-
admin_permissions?
|
17
|
-
end
|
18
|
-
|
19
|
-
def create?
|
20
|
-
admin_permissions?
|
21
|
-
end
|
22
|
-
|
23
|
-
def update?
|
24
|
-
admin_permissions?
|
25
|
-
end
|
26
|
-
|
27
|
-
def delete?
|
28
|
-
admin_permissions?
|
29
|
-
end
|
30
|
-
|
31
|
-
private
|
32
|
-
|
33
|
-
def staff_permissions?
|
34
|
-
@user.master? or @user.admin? or @user.staff?
|
35
|
-
end
|
36
|
-
|
37
|
-
def admin_permissions?
|
38
|
-
@user.master? or @user.admin?
|
39
|
-
end
|
40
|
-
end
|
41
|
-
EOS
|
42
|
-
end
|
43
|
-
file_path
|
44
|
-
rescue StandardError => error
|
45
|
-
puts "method error"
|
46
|
-
puts error.backtrace
|
47
|
-
end
|
48
19
|
end
|
49
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
|
|
@@ -194,6 +194,8 @@ module Souls
|
|
194
194
|
end
|
195
195
|
|
196
196
|
def update_mutation class_name: "souls"
|
197
|
+
file_path = "./app/graphql/mutations/#{class_name}/update_#{class_name}.rb"
|
198
|
+
return "Mutation already exist! #{file_path}" if File.exist? file_path
|
197
199
|
update_mutation_head class_name: class_name
|
198
200
|
relation_params = update_mutation_params class_name: class_name
|
199
201
|
update_mutation_after_params class_name: class_name, relation_params: relation_params
|
@@ -203,6 +205,7 @@ module Souls
|
|
203
205
|
# 3. Mutation - Delete
|
204
206
|
def delete_mutation class_name: "souls"
|
205
207
|
file_path = "./app/graphql/mutations/#{class_name}/delete_#{class_name}.rb"
|
208
|
+
return "Mutation already exist! #{file_path}" if File.exist? file_path
|
206
209
|
File.open(file_path, "w") do |f|
|
207
210
|
f.write <<~EOS
|
208
211
|
module Mutations
|
@@ -230,6 +233,7 @@ module Souls
|
|
230
233
|
# 4. Mutation - Destroy Delete
|
231
234
|
def destroy_delete_mutation class_name: "souls"
|
232
235
|
file_path = "./app/graphql/mutations/#{class_name}/destroy_delete_#{class_name}.rb"
|
236
|
+
return "Mutation already exist! #{file_path}" if File.exist? file_path
|
233
237
|
File.open(file_path, "w") do |f|
|
234
238
|
f.write <<~EOS
|
235
239
|
module Mutations
|
@@ -258,7 +262,8 @@ module Souls
|
|
258
262
|
|
259
263
|
def mutation class_name: "souls"
|
260
264
|
singularized_class_name = class_name.singularize
|
261
|
-
|
265
|
+
file_path = "./app/graphql/mutations/#{singularized_class_name}/create_#{singularized_class_name}.rb"
|
266
|
+
return "Mutation already exist! #{file_path}" if File.exist? file_path
|
262
267
|
create_mutation_head class_name: singularized_class_name
|
263
268
|
relation_params = create_mutation_params class_name: singularized_class_name
|
264
269
|
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
|
-
|
14
|
+
true
|
14
15
|
end
|
15
16
|
|
16
17
|
def index?
|
17
|
-
|
18
|
+
true
|
18
19
|
end
|
19
20
|
|
20
21
|
def create?
|
21
|
-
|
22
|
+
staff_permissions?
|
22
23
|
end
|
23
24
|
|
24
25
|
def update?
|
25
|
-
|
26
|
+
staff_permissions?
|
26
27
|
end
|
27
28
|
|
28
29
|
def delete?
|
data/lib/souls/generate/query.rb
CHANGED
@@ -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
|
@@ -142,6 +141,8 @@ module Souls
|
|
142
141
|
|
143
142
|
def resolver class_name: "souls"
|
144
143
|
singularized_class_name = class_name.singularize.underscore
|
144
|
+
file_path = "./app/graphql/resolvers/#{singularized_class_name}_search.rb"
|
145
|
+
return "Resolver already exist! #{file_path}" if File.exist? file_path
|
145
146
|
resolver_head class_name: singularized_class_name
|
146
147
|
resolver_params class_name: singularized_class_name
|
147
148
|
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
|
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
|
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
|
data/lib/souls/generate/type.rb
CHANGED
@@ -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
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.
|
4
|
+
version: 0.21.2
|
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-05-
|
13
|
+
date: 2021-05-27 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
|
@@ -84,7 +84,7 @@ 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.
|
87
|
+
rubygems_version: 3.2.15
|
88
88
|
signing_key:
|
89
89
|
specification_version: 4
|
90
90
|
summary: SOULS is a GraphQL Based Web Application Framework for Microservices on Multi
|