souls 0.28.2 → 0.28.6

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: d998ceff4fd026479911457cd01fdb510ee712d7b913c7576170f76ae20cf8df
4
- data.tar.gz: 774c3cfa49798c62581f069694704c20040ffac2780f4c4fa8e8a2616820e166
3
+ metadata.gz: a7d285b6cc65c31bf256621732e25cf82a154d894bd842c7925cf4d9a2436d0b
4
+ data.tar.gz: b01e120cb0f88735771573afe76d35dfe20997ebb151e8d2fe487b4444a38945
5
5
  SHA512:
6
- metadata.gz: f702cfa528b2a4abdf725dd49bdeb9dcdb3f76d15d9c56b520982a764093ca1bc4995eff55538e344959d5bebaa9ab1273f750254add6520f6c19087c8c5245f
7
- data.tar.gz: ca50aaf1df8823a741b785cbf28f0ade3010409d21b025d519d94f9b6ecf0d535ec4447911dfa932bc962c88a1025181447f0ef7d5343bf580bbadeeae6b758c
6
+ metadata.gz: a35c8eb77e9284149d4e172eb0edbf9484a9515226f9f5e653e9917f8029faf18d76b609fd9e592ea98fc83afdcb37057fd0856aaa4c11a1f483de5b40e7b422
7
+ data.tar.gz: 273aca15999564d3d79555653a44e68979b79f9b39648a6e0da8283fcf9da1128af4e651fa634fcf2a0f48a4dbdfbc6017b4dbbde09a54bff296b9033c8616b4
@@ -61,12 +61,13 @@ module Souls
61
61
 
62
62
  def add_permissions(service_account: "souls-app", project_id: "souls-app")
63
63
  roles = [
64
- "roles/cloudsql.serviceAgent",
64
+ "roles/cloudsql.instanceUser",
65
65
  "roles/containerregistry.ServiceAgent",
66
66
  "roles/pubsub.serviceAgent",
67
67
  "roles/firestore.serviceAgent",
68
68
  "roles/iam.serviceAccountUser",
69
- "roles/storage.objectAdmin"
69
+ "roles/storage.objectAdmin",
70
+ "roles/run.admin"
70
71
  ]
71
72
  roles.each do |role|
72
73
  add_service_account_role(service_account: service_account, project_id: project_id, role: role)
@@ -15,7 +15,10 @@ module Souls
15
15
  project_id = Souls.configuration.project_id
16
16
  Souls::Gcloud.auth_login(project_id: project_id)
17
17
  when "enable_permissions"
18
+ service_account = Souls.configuration.app
19
+ project_id = Souls.configuration.project_id
18
20
  Souls::Gcloud.enable_permissions
21
+ Souls::Gcloud.add_permissions(service_account: service_account, project_id: project_id)
19
22
  when "create_pubsub_topic"
20
23
  topic_name = args[2] || "send-user-mail"
21
24
  Souls::Gcloud.create_pubsub_topic(topic_name: topic_name)
@@ -30,7 +30,7 @@ module Souls
30
30
  File.open(path, "r") do |f|
31
31
  f.each_line.with_index do |line, _i|
32
32
  if @on
33
- if line.include?("end") || line.include?("t.index")
33
+ if line.include?("t.index") || line.strip == "end"
34
34
  if @user_exist
35
35
  new_line.write(<<-TEXT)
36
36
 
@@ -124,7 +124,7 @@ module Souls
124
124
  File.open(path, "r") do |f|
125
125
  f.each_line.with_index do |line, _i|
126
126
  if @on
127
- if line.include?("end") || line.include?("t.index")
127
+ if line.include?("t.index") || line.strip == "end"
128
128
  if @user_exist
129
129
  new_line.write(<<-TEXT)
130
130
 
@@ -30,11 +30,12 @@ module Souls
30
30
  File.open(path, "r") do |f|
31
31
  f.each_line.with_index do |line, _i|
32
32
  if @on
33
- break if line.include?("end") || line.include?("t.index")
33
+ break if line.include?("t.index") || line.strip == "end"
34
34
 
35
35
  field = "[String]" if line.include?("array: true")
36
36
  type, name = get_type_and_name(line)
37
37
  field ||= type_check(type)
38
+ puts(line)
38
39
  case name
39
40
  when "user_id"
40
41
  @user_exist = true
@@ -57,21 +58,21 @@ module Souls
57
58
  file_path = "./app/graphql/resolvers/#{class_name.singularize}_search.rb"
58
59
  File.open(file_path, "a") do |f|
59
60
  f.write(<<-TEXT)
60
- argument :start_date, String, required: false
61
- argument :end_date, String, required: false
62
- end
61
+ argument :start_date, String, required: false
62
+ argument :end_date, String, required: false
63
+ end
63
64
 
64
- option :filter, type: #{class_name.camelize}Filter, with: :apply_filter
65
- option :first, type: types.Int, with: :apply_first
66
- option :skip, type: types.Int, with: :apply_skip
65
+ option :filter, type: #{class_name.camelize}Filter, with: :apply_filter
66
+ option :first, type: types.Int, with: :apply_first
67
+ option :skip, type: types.Int, with: :apply_skip
67
68
 
68
- def apply_filter(scope, value)
69
- branches = normalize_filters(value).inject { |a, b| a.or(b) }
70
- scope.merge branches
71
- end
69
+ def apply_filter(scope, value)
70
+ branches = normalize_filters(value).inject { |a, b| a.or(b) }
71
+ scope.merge branches
72
+ end
72
73
 
73
- def normalize_filters(value, branches = [])
74
- scope = ::#{class_name.camelize}.all
74
+ def normalize_filters(value, branches = [])
75
+ scope = ::#{class_name.camelize}.all
75
76
  TEXT
76
77
  end
77
78
  end
@@ -86,7 +87,7 @@ module Souls
86
87
  File.open(path, "r") do |f|
87
88
  f.each_line.with_index do |line, _i|
88
89
  if @on
89
- break if line.include?("end") || line.include?("t.index")
90
+ break if line.include?("t.index") || line.strip == "end"
90
91
 
91
92
  type, name = get_type_and_name(line)
92
93
  if line.include?("array: true")
@@ -20,7 +20,7 @@ module Souls
20
20
  File.open(path, "r") do |f|
21
21
  f.each_line.with_index do |line, _i|
22
22
  if @on
23
- new_line.write("\n" && break) if line.include?("end") || line.include?("t.index")
23
+ new_line.write("\n" && break) if line.include?("t.index") || line.strip == "end"
24
24
  field = '["tag1", "tag2", "tag3"]' if line.include?("array: true")
25
25
  type, name = line.split(",")[0].gsub("\"", "").scan(/((?<=t\.).+(?=\s)) (.+)/)[0]
26
26
  field ||= get_test_type(type)
@@ -23,7 +23,7 @@ module Souls
23
23
  File.open(path, "r") do |f|
24
24
  f.each_line.with_index do |line, _i|
25
25
  if @on
26
- if line.include?("end") || line.include?("t.index")
26
+ if line.include?("t.index") || line.strip == "end"
27
27
  if @relation_params.empty?
28
28
  new_line.write(<<-TEXT)
29
29
  let(:#{class_name}) { FactoryBot.attributes_for(:#{class_name}) }
@@ -72,7 +72,7 @@ module Souls
72
72
  File.open(path, "r") do |f|
73
73
  f.each_line.with_index do |line, _i|
74
74
  if @on
75
- if line.include?("end") || line.include?("t.index")
75
+ if line.include?("t.index") || line.strip == "end"
76
76
  new_line.write(" }) {\n #{class_name.singularize.camelize(:lower)}Edge {\n node {\n")
77
77
  new_line.write(" id\n")
78
78
  break
@@ -113,7 +113,7 @@ module Souls
113
113
  File.open(path, "r") do |f|
114
114
  f.each_line.with_index do |line, _i|
115
115
  if @on
116
- if line.include?("end") || line.include?("t.index")
116
+ if line.include?("t.index") || line.strip == "end"
117
117
  if @user_exist
118
118
  new_line.write(<<-TEXT)
119
119
  }
@@ -193,7 +193,7 @@ module Souls
193
193
  File.open(path, "r") do |f|
194
194
  f.each_line.with_index do |line, _i|
195
195
  if @on
196
- if line.include?("end") || line.include?("t.index")
196
+ if line.include?("t.index") || line.strip == "end"
197
197
  new_line.write(<<~TEXT)
198
198
  )
199
199
  end
@@ -23,7 +23,7 @@ module Souls
23
23
  File.open(path, "r") do |f|
24
24
  f.each_line.with_index do |line, _i|
25
25
  if @on
26
- if line.include?("end") || line.include?("t.index")
26
+ if line.include?("t.index") || line.strip == "end"
27
27
  if @relation_params.empty?
28
28
  new_line.write(<<-TEXT)
29
29
  let!(:#{class_name}) { FactoryBot.create(:#{class_name}) }
@@ -69,7 +69,7 @@ module Souls
69
69
  File.open(path, "r") do |f|
70
70
  f.each_line.with_index do |line, _i|
71
71
  if @on
72
- if line.include?("end") || line.include?("t.index")
72
+ if line.include?("t.index") || line.strip == "end"
73
73
  new_line.write(<<-TEXT)
74
74
  }
75
75
  }
@@ -114,7 +114,7 @@ module Souls
114
114
  File.open(path, "r") do |f|
115
115
  f.each_line.with_index do |line, _i|
116
116
  if @on
117
- if line.include?("end") || line.include?("t.index")
117
+ if line.include?("t.index") || line.strip == "end"
118
118
  new_line.write(<<~TEXT)
119
119
  )
120
120
  end
@@ -23,7 +23,7 @@ module Souls
23
23
  File.open(path, "r") do |f|
24
24
  f.each_line.with_index do |line, _i|
25
25
  if @on
26
- if line.include?("end") || line.include?("t.index")
26
+ if line.include?("t.index") || line.strip == "end"
27
27
  if @relation_params.empty?
28
28
  new_line.write(<<-TEXT)
29
29
  let!(:#{class_name}) { FactoryBot.create(:#{class_name}) }
@@ -77,7 +77,7 @@ module Souls
77
77
  File.open(path, "r") do |f|
78
78
  f.each_line.with_index do |line, _i|
79
79
  if @on
80
- if line.include?("end") || line.include?("t.index")
80
+ if line.include?("t.index") || line.strip == "end"
81
81
  new_line.write(<<-TEXT)
82
82
  }
83
83
  }
@@ -133,7 +133,7 @@ module Souls
133
133
  File.open(path, "r") do |f|
134
134
  f.each_line.with_index do |line, _i|
135
135
  if @on
136
- if line.include?("end") || line.include?("t.index")
136
+ if line.include?("t.index") || line.strip == "end"
137
137
  new_line.write(<<~TEXT)
138
138
  )
139
139
  end
@@ -24,7 +24,7 @@ module Souls
24
24
  File.open(path, "r") do |f|
25
25
  f.each_line.with_index do |line, _i|
26
26
  if @on
27
- new_line.write("\n" && break) if line.include?("end") || line.include?("t.index")
27
+ new_line.write("\n" && break) if line.include?("t.index") || line.strip == "end"
28
28
  field = "[String]" if line.include?("array: true")
29
29
  type, name = line.split(",")[0].gsub("\"", "").scan(/((?<=t\.).+(?=\s)) (.+)/)[0]
30
30
  field ||= type_check(type)
data/lib/souls/version.rb CHANGED
@@ -1,4 +1,4 @@
1
1
  module Souls
2
- VERSION = "0.28.2".freeze
2
+ VERSION = "0.28.6".freeze
3
3
  public_constant :VERSION
4
4
  end
@@ -1 +1 @@
1
- 0.7.2
1
+ 0.7.6
@@ -1 +1 @@
1
- 0.7.2
1
+ 0.7.6
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.28.2
4
+ version: 0.28.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - POPPIN-FUMI