souls 0.21.4 → 0.21.9
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/.irbrc +1 -0
- data/Gemfile +3 -3
- data/Gemfile.lock +9 -9
- data/README.md +1 -1
- data/config/souls.rb +2 -1
- data/exe/souls +4 -2
- data/lib/souls.rb +14 -1
- data/lib/souls/gcloud.rb +6 -0
- data/lib/souls/gcloud/compute.rb +47 -0
- data/lib/souls/gcloud/iam.rb +24 -0
- data/lib/souls/generate/mutation.rb +14 -13
- data/lib/souls/generate/resolver.rb +9 -8
- data/lib/souls/generate/rspec_factory.rb +1 -0
- data/lib/souls/generate/rspec_mutation.rb +6 -6
- data/lib/souls/generate/rspec_policy.rb +1 -1
- data/lib/souls/generate/rspec_query.rb +1 -2
- data/lib/souls/version.rb +1 -1
- data/souls.gemspec +2 -2
- metadata +13 -10
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e62ee458db54f14b4eb73158ee91850fd48f433d9a001dedd34abfd1ccc96929
|
4
|
+
data.tar.gz: e5640bbbcbae9b4448419109bef6baeb7b71e5da11906a26a21d52d6711c62ac
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2440762274094f5be438ac9167790a7ee8d4238d5503f8de8550c5b13fdcb207380887757fe16d57a64391a0e60c464f691e15bab6d3ff09111b52c96a3a7efd
|
7
|
+
data.tar.gz: b65cc2ed70929ae7db331f73ccd184543935198d286711ca5304dc637ae1fe6149dbbef4b13eeb8700e90c053098f5e318e0af982de3804c5f4d004fb09c4d05
|
data/.irbrc
CHANGED
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.
|
6
|
+
gem "activesupport", "6.1.4"
|
7
7
|
gem "parser", "3.0.1.1"
|
8
|
-
gem "rake", "13.0.
|
8
|
+
gem "rake", "13.0.4"
|
9
9
|
gem "rspec", "3.10.0"
|
10
|
-
gem "rubocop", "1.
|
10
|
+
gem "rubocop", "1.18.3"
|
11
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.21.
|
4
|
+
souls (0.21.8)
|
5
5
|
|
6
6
|
GEM
|
7
7
|
remote: https://rubygems.org/
|
8
8
|
specs:
|
9
|
-
activesupport (6.1.
|
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)
|
@@ -15,7 +15,7 @@ GEM
|
|
15
15
|
ast (2.4.2)
|
16
16
|
concurrent-ruby (1.1.9)
|
17
17
|
diff-lcs (1.4.4)
|
18
|
-
ffi (1.15.
|
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.
|
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,7 +47,7 @@ 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.
|
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)
|
@@ -79,13 +79,13 @@ PLATFORMS
|
|
79
79
|
x86_64-linux
|
80
80
|
|
81
81
|
DEPENDENCIES
|
82
|
-
activesupport (= 6.1.
|
82
|
+
activesupport (= 6.1.4)
|
83
83
|
parser (= 3.0.1.1)
|
84
|
-
rake (= 13.0.
|
84
|
+
rake (= 13.0.4)
|
85
85
|
rspec (= 3.10.0)
|
86
|
-
rubocop (= 1.
|
86
|
+
rubocop (= 1.18.3)
|
87
87
|
souls!
|
88
88
|
steep (= 0.44.1)
|
89
89
|
|
90
90
|
BUNDLED WITH
|
91
|
-
2.2.
|
91
|
+
2.2.21
|
data/README.md
CHANGED
data/config/souls.rb
CHANGED
data/exe/souls
CHANGED
@@ -43,6 +43,8 @@ begin
|
|
43
43
|
end
|
44
44
|
when "i", "infra"
|
45
45
|
Souls.send ARGV[1]
|
46
|
+
when "gcloud"
|
47
|
+
Souls::Gcloud.send ARGV[1]
|
46
48
|
when "-v", "--version"
|
47
49
|
puts Souls::VERSION
|
48
50
|
when "add"
|
@@ -138,8 +140,8 @@ begin
|
|
138
140
|
system "rubocop -a"
|
139
141
|
system "bundle exec rspec"
|
140
142
|
when "run"
|
141
|
-
system "docker build . -t souls
|
142
|
-
system "docker run --rm -p 3000:3000 souls:latest"
|
143
|
+
system "docker build . -t souls -f Dockerfile.dev"
|
144
|
+
system "docker run --rm --env-file .env -p 3000:3000 souls:latest"
|
143
145
|
when "deploy"
|
144
146
|
system "gcloud builds submit --config=cloudbuild.yml --project #{ARGV[1]}"
|
145
147
|
else
|
data/lib/souls.rb
CHANGED
@@ -2,6 +2,7 @@ require_relative "souls/version"
|
|
2
2
|
require "active_support/core_ext/string/inflections"
|
3
3
|
require_relative "souls/init"
|
4
4
|
require_relative "souls/generate"
|
5
|
+
require_relative "souls/gcloud"
|
5
6
|
require "json"
|
6
7
|
require "fileutils"
|
7
8
|
|
@@ -35,6 +36,17 @@ module Souls
|
|
35
36
|
system "docker ps"
|
36
37
|
end
|
37
38
|
|
39
|
+
def run_mysql
|
40
|
+
system "docker run --rm -d \
|
41
|
+
-p 3306:3306 \
|
42
|
+
-v mysql-tmp:/var/lib/mysqlql/data \
|
43
|
+
-e MYSQL_USER=mysql \
|
44
|
+
-e MYSQL_PASSWORD=mysql \
|
45
|
+
-e MYSQL_DB=souls_test \
|
46
|
+
mysql:latest"
|
47
|
+
system "docker ps"
|
48
|
+
end
|
49
|
+
|
38
50
|
def run_awake url
|
39
51
|
app = Souls.configuration.app
|
40
52
|
system "gcloud scheduler jobs create http #{app}-awake --schedule '0,10,20,30,40,50 * * * *' --uri #{url} --http-method GET"
|
@@ -47,10 +59,11 @@ module Souls
|
|
47
59
|
end
|
48
60
|
|
49
61
|
class Configuration
|
50
|
-
attr_accessor :app, :strain
|
62
|
+
attr_accessor :app, :strain, :project_id
|
51
63
|
|
52
64
|
def initialize
|
53
65
|
@app = nil
|
66
|
+
@project_id = nil
|
54
67
|
@strain = nil
|
55
68
|
end
|
56
69
|
end
|
data/lib/souls/gcloud.rb
ADDED
@@ -0,0 +1,47 @@
|
|
1
|
+
module Souls
|
2
|
+
module Gcloud
|
3
|
+
class << self
|
4
|
+
def enable_permissions
|
5
|
+
system "gcloud services enable compute.googleapis.com"
|
6
|
+
puts "Operating permission to compute.googleapis.com ..."
|
7
|
+
system "gcloud services enable sqladmin.googleapis.com"
|
8
|
+
puts "Operating permission to sqladmin.googleapis.com ..."
|
9
|
+
system "gcloud services enable sql-component.googleapis.com"
|
10
|
+
puts "Operating permission to sql-component.googleapis.com ..."
|
11
|
+
system "gcloud services enable servicenetworking.googleapis.com"
|
12
|
+
puts "Operating permission to servicenetworking.googleapis.com ..."
|
13
|
+
end
|
14
|
+
|
15
|
+
def create_network
|
16
|
+
return "Error: Please Set Souls.configuration" if Souls.configuration.app.nil?
|
17
|
+
network = Souls.configuration.app
|
18
|
+
system "gcloud compute networks create #{network}"
|
19
|
+
rescue StandardError => e
|
20
|
+
raise StandardError, e
|
21
|
+
end
|
22
|
+
|
23
|
+
def create_firewall ip_range: "10.140.0.0/20"
|
24
|
+
network = Souls.configuration.app
|
25
|
+
system "gcloud compute firewall-rules create #{network} --network #{network} --allow tcp,udp,icmp --source-ranges #{ip_range}"
|
26
|
+
system "gcloud compute firewall-rules create #{network}-ssh --network #{network} --allow tcp:22,tcp:3389,icmp"
|
27
|
+
end
|
28
|
+
|
29
|
+
def create_private_access
|
30
|
+
network = Souls.configuration.app
|
31
|
+
project_id = Souls.configuration.project_id
|
32
|
+
system "gcloud compute addresses create #{network}-my-network \
|
33
|
+
--global \
|
34
|
+
--purpose=VPC_PEERING \
|
35
|
+
--prefix-length=16 \
|
36
|
+
--description='peering range for SOULs' \
|
37
|
+
--network=#{network} \
|
38
|
+
--project=#{project_id}"
|
39
|
+
end
|
40
|
+
|
41
|
+
def create_sql_instance root_pass: "Postgre123!", zone: "asia-northeast1-b"
|
42
|
+
app = "#{Souls.configuration.app}-db"
|
43
|
+
system "gcloud sql instances create #{app} --database-version=POSTGRES_13 --cpu=2 --memory=7680MB --zone=#{zone} --root-password='#{root_pass}' --database-flags cloudsql.iam_authentication=on"
|
44
|
+
end
|
45
|
+
end
|
46
|
+
end
|
47
|
+
end
|
@@ -0,0 +1,24 @@
|
|
1
|
+
module Souls
|
2
|
+
module Gcloud
|
3
|
+
class << self
|
4
|
+
def create_service_account service_account: "souls-app"
|
5
|
+
`gcloud iam service-accounts create #{service_account} \
|
6
|
+
--description="Souls Service Account" \
|
7
|
+
--display-name="#{service_account}"`
|
8
|
+
end
|
9
|
+
|
10
|
+
def create_service_account_key service_account: "souls-app"
|
11
|
+
project_id = Souls.configuration.project_id
|
12
|
+
`gcloud iam service-accounts keys create ./config/keyfile.json \
|
13
|
+
--iam-account #{service_account}@#{project_id}.iam.gserviceaccount.com`
|
14
|
+
end
|
15
|
+
|
16
|
+
def add_service_account_role service_account: "souls-app", role: "roles/firebase.admin"
|
17
|
+
project_id = Souls.configuration.project_id
|
18
|
+
`gcloud projects add-iam-policy-binding #{project_id} \
|
19
|
+
--member="serviceAccount:#{service_account}@#{project_id}.iam.gserviceaccount.com" \
|
20
|
+
--role="#{role}"`
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
@@ -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
|
@@ -117,7 +117,7 @@ module Souls
|
|
117
117
|
end
|
118
118
|
|
119
119
|
def update_mutation_params class_name: "souls"
|
120
|
-
file_path = "./app/graphql/mutations/#{class_name}/update_#{class_name}.rb"
|
120
|
+
file_path = "./app/graphql/mutations/base/#{class_name}/update_#{class_name}.rb"
|
121
121
|
path = "./db/schema.rb"
|
122
122
|
@on = false
|
123
123
|
@user_exist = false
|
@@ -167,7 +167,7 @@ module Souls
|
|
167
167
|
|
168
168
|
def update_mutation_after_params class_name: "article", relation_params: []
|
169
169
|
return false if relation_params.empty?
|
170
|
-
file_path = "./app/graphql/mutations/#{class_name}/update_#{class_name}.rb"
|
170
|
+
file_path = "./app/graphql/mutations/base/#{class_name}/update_#{class_name}.rb"
|
171
171
|
relation_params.each do |params_name|
|
172
172
|
File.open(file_path, "a") do |new_line|
|
173
173
|
new_line.write " _, args[:#{params_name}] = SoulsApiSchema.from_global_id(args[:#{params_name}])\n"
|
@@ -177,7 +177,7 @@ module Souls
|
|
177
177
|
end
|
178
178
|
|
179
179
|
def update_mutation_end class_name: "souls"
|
180
|
-
file_path = "./app/graphql/mutations/#{class_name}/update_#{class_name}.rb"
|
180
|
+
file_path = "./app/graphql/mutations/base/#{class_name}/update_#{class_name}.rb"
|
181
181
|
File.open(file_path, "a") do |new_line|
|
182
182
|
new_line.write <<~EOS
|
183
183
|
#{class_name} = ::#{class_name.camelize}.find args[:id]
|
@@ -195,7 +195,7 @@ module Souls
|
|
195
195
|
end
|
196
196
|
|
197
197
|
def update_mutation class_name: "souls"
|
198
|
-
file_path = "./app/graphql/mutations/#{class_name}/update_#{class_name}.rb"
|
198
|
+
file_path = "./app/graphql/mutations/base/#{class_name}/update_#{class_name}.rb"
|
199
199
|
return "Mutation already exist! #{file_path}" if File.exist? file_path
|
200
200
|
update_mutation_head class_name: class_name
|
201
201
|
relation_params = update_mutation_params class_name: class_name
|
@@ -205,7 +205,7 @@ module Souls
|
|
205
205
|
|
206
206
|
# 3. Mutation - Delete
|
207
207
|
def delete_mutation class_name: "souls"
|
208
|
-
file_path = "./app/graphql/mutations/#{class_name}/delete_#{class_name}.rb"
|
208
|
+
file_path = "./app/graphql/mutations/base/#{class_name}/delete_#{class_name}.rb"
|
209
209
|
return "Mutation already exist! #{file_path}" if File.exist? file_path
|
210
210
|
File.open(file_path, "w") do |f|
|
211
211
|
f.write <<~EOS
|
@@ -233,7 +233,7 @@ module Souls
|
|
233
233
|
|
234
234
|
# 4. Mutation - Destroy Delete
|
235
235
|
def destroy_delete_mutation class_name: "souls"
|
236
|
-
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"
|
237
237
|
return "Mutation already exist! #{file_path}" if File.exist? file_path
|
238
238
|
File.open(file_path, "w") do |f|
|
239
239
|
f.write <<~EOS
|
@@ -263,11 +263,12 @@ module Souls
|
|
263
263
|
|
264
264
|
def mutation class_name: "souls"
|
265
265
|
singularized_class_name = class_name.singularize
|
266
|
-
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"
|
267
267
|
return "Mutation already exist! #{file_path}" if File.exist? file_path
|
268
268
|
create_mutation_head class_name: singularized_class_name
|
269
269
|
relation_params = create_mutation_params class_name: singularized_class_name
|
270
270
|
create_mutation_after_params class_name: singularized_class_name, relation_params: relation_params
|
271
|
+
# puts "File Created!\n#{file_path}"
|
271
272
|
[
|
272
273
|
create_mutation_end(class_name: singularized_class_name),
|
273
274
|
update_mutation(class_name: singularized_class_name),
|
@@ -123,14 +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
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
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
|
134
134
|
EOS
|
135
135
|
end
|
136
136
|
file_path
|
@@ -144,6 +144,7 @@ module Souls
|
|
144
144
|
resolver_params class_name: singularized_class_name
|
145
145
|
resolver_after_params class_name: singularized_class_name
|
146
146
|
resolver_before_end class_name: singularized_class_name
|
147
|
+
# puts "File Created!\n#{file_path}"
|
147
148
|
resolver_end class_name: singularized_class_name
|
148
149
|
end
|
149
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
|
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
data/souls.gemspec
CHANGED
@@ -6,8 +6,8 @@ Gem::Specification.new do |spec|
|
|
6
6
|
spec.authors = ["POPPIN-FUMI", "KishiTheMechanic", "James Neve"]
|
7
7
|
spec.email = ["f.kawasaki@elsoul.nl", "s.kishi@elsoul.nl", "jamesoneve@gmail.com"]
|
8
8
|
|
9
|
-
spec.summary = "
|
10
|
-
spec.description = "
|
9
|
+
spec.summary = "SOULs is a Serverless Application Framework. SOULs has four strains, API, Worker, Console, Media, and can be used in combination according to the purpose. SOULs Backend GraphQL Ruby & Frontend Relay are Scalable and Easy to deploy to Google Cloud and Amazon Web Services"
|
10
|
+
spec.description = "SOULs is a Serverless Application Framework. SOULs has four strains, API, Worker, Console, Media, and can be used in combination according to the purpose. SOULs Backend GraphQL Ruby & Frontend Relay are Scalable and Easy to deploy to Google Cloud and Amazon Web Services"
|
11
11
|
spec.homepage = "https://github.com/elsoul/souls"
|
12
12
|
spec.license = "Apache-2.0"
|
13
13
|
spec.required_ruby_version = Gem::Requirement.new(">= 3.0.0")
|
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.21.
|
4
|
+
version: 0.21.9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- POPPIN-FUMI
|
@@ -10,12 +10,12 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: exe
|
12
12
|
cert_chain: []
|
13
|
-
date: 2021-
|
13
|
+
date: 2021-07-12 00:00:00.000000000 Z
|
14
14
|
dependencies: []
|
15
|
-
description:
|
16
|
-
|
17
|
-
|
18
|
-
|
15
|
+
description: SOULs is a Serverless Application Framework. SOULs has four strains,
|
16
|
+
API, Worker, Console, Media, and can be used in combination according to the purpose.
|
17
|
+
SOULs Backend GraphQL Ruby & Frontend Relay are Scalable and Easy to deploy to Google
|
18
|
+
Cloud and Amazon Web Services
|
19
19
|
email:
|
20
20
|
- f.kawasaki@elsoul.nl
|
21
21
|
- s.kishi@elsoul.nl
|
@@ -44,6 +44,9 @@ files:
|
|
44
44
|
- db/schema.rb
|
45
45
|
- exe/souls
|
46
46
|
- lib/souls.rb
|
47
|
+
- lib/souls/gcloud.rb
|
48
|
+
- lib/souls/gcloud/compute.rb
|
49
|
+
- lib/souls/gcloud/iam.rb
|
47
50
|
- lib/souls/generate.rb
|
48
51
|
- lib/souls/generate/application.rb
|
49
52
|
- lib/souls/generate/model.rb
|
@@ -87,8 +90,8 @@ requirements: []
|
|
87
90
|
rubygems_version: 3.2.15
|
88
91
|
signing_key:
|
89
92
|
specification_version: 4
|
90
|
-
summary:
|
91
|
-
|
92
|
-
|
93
|
-
|
93
|
+
summary: SOULs is a Serverless Application Framework. SOULs has four strains, API,
|
94
|
+
Worker, Console, Media, and can be used in combination according to the purpose.
|
95
|
+
SOULs Backend GraphQL Ruby & Frontend Relay are Scalable and Easy to deploy to Google
|
96
|
+
Cloud and Amazon Web Services
|
94
97
|
test_files: []
|