souls 0.22.9 → 0.23.3

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: d4743791a22f8b54e87e3a64e86d1e9c1788ee935fddc3613d8d8ae199d88094
4
- data.tar.gz: 4efd188ab4db345f57cc8e74480c9bfd95ef120122f55311644cc036166a370a
3
+ metadata.gz: 4c6c49b43b4d3a645d9d7eab40a7c1ea026d070ae39e271bfbe7f9ea7d65e96c
4
+ data.tar.gz: 8765eed4824d76a38e81b3c8f2d433f4c9986f1faef00185a199ba64c4375eac
5
5
  SHA512:
6
- metadata.gz: 71938d1f307ff795e6bce9acb49825bf76d494b8677433b1b4fb84f8ccdbf9b59c397405c41ebd529b5a121cffd9ae14c56b35c304ebf737544e62e55678fd79
7
- data.tar.gz: a24bc9987ab8bdc55d170d512ef66472184ab5d69f147af49331c3f6a67055b6cc95c67ccee965ffe011177fd5bb48f2fb8acfefc589a3ec3898290a57621ac9
6
+ metadata.gz: a47fa0976ca85c201410354c5ea8c084594db000fe3c1d9ef74db72f03a539736975ba108a0656c244ea4987aa512a7ef19dd21c7644234d488c80b5c9208f43
7
+ data.tar.gz: aab9cf1284aa94d320759535025cb651da5997d8306f67a1c84ab9510bbbb4213fac2b9a7b1cb8f5017f7a7587dedb252f2a7a1e029fb2a742aa84fda68adbb0
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- souls (0.22.8)
4
+ souls (0.23.3)
5
5
  paint (= 2.2.1)
6
6
  whirly (= 0.3.0)
7
7
 
data/exe/souls CHANGED
@@ -1,15 +1,17 @@
1
1
  #!/usr/bin/env ruby
2
2
  require "souls"
3
3
  begin
4
- require "./config/souls" unless ARGV[0] == "new" || ARGV[0] == "i" || ARGV[0] == "-v"
4
+ require "./config/souls" unless ARGV[0] == "new" || ARGV[0] == "i" || ARGV[0] == "-v" || ARGV[0] == "deploy"
5
5
  rescue
6
6
  puts "Make sure you are at SOULs APP directory!"
7
7
  end
8
8
  begin
9
- case ARGV[0]
9
+ souls_command = ARGV[0]
10
+ case souls_command
10
11
  when "new"
11
12
  STRAINS = ["api", "worker", "console", "admin", "media"]
12
- if ARGV[1].nil?
13
+ app_name = ARGV[1]
14
+ if app_name.nil?
13
15
  puts Paint["you need to specify your app name", :red]
14
16
  puts Paint["`souls new app_name`", :yellow]
15
17
  exit
@@ -29,12 +31,11 @@ begin
29
31
  strain = STDIN.gets.chomp.to_i
30
32
  case strain
31
33
  when 1, 2
32
- Souls::Init.download_souls app_name: ARGV[1], repository_name: "souls_#{STRAINS[strain.to_i - 1]}"
33
- Souls::Init.initial_config_init app_name: ARGV[1], strain: STRAINS[strain.to_i - 1]
34
+ Souls::Init.download_souls app_name: app_name, repository_name: "souls_#{STRAINS[strain.to_i - 1]}"
35
+ Souls::Init.initial_config_init app_name: app_name, strain: STRAINS[strain.to_i - 1]
34
36
  else
35
37
  puts Paint["Coming Soon...", :blue]
36
38
  end
37
-
38
39
  when "s", "server"
39
40
  strain = Souls.configuration.strain
40
41
  case strain
@@ -51,7 +52,8 @@ begin
51
52
  when "media", "admin"
52
53
  system "yarn dev"
53
54
  else
54
- case ARGV[1]
55
+ rack_env = ARGV[1]
56
+ case rack_env
55
57
  when "RACK_ENV=production"
56
58
  system "RACK_ENV=production bundle exec irb"
57
59
  else
@@ -59,20 +61,28 @@ begin
59
61
  end
60
62
  end
61
63
  when "i", "infra"
62
- Souls.send ARGV[1]
64
+ send_method = ARGV[1]
65
+ Souls.send send_method
63
66
  when "gcloud"
64
- Souls::Gcloud.send ARGV[1]
67
+ status = Paint["Running Gcloud Commands...", :yellow]
68
+ Whirly.start spinner: "clock", interval: 420, stop: "🎉" do
69
+ Whirly.status = status
70
+ send_method = ARGV[1]
71
+ Souls::Gcloud.send send_method
72
+ Whirly.status = "Done!"
73
+ end
65
74
  when "-v", "--version"
66
- puts Souls::VERSION
75
+ puts Paint[Souls::VERSION, :white]
67
76
  when "gem:update", "gemfile:update"
68
77
  status = Paint["Checking for updates...", :yellow]
69
- Whirly.start spinner: "clock", interval: 1000, stop: "🎉" do
78
+ Whirly.start spinner: "clock", interval: 420, stop: "🎉" do
70
79
  Whirly.status = status
71
80
  Souls.update_gemfile
72
81
  Whirly.status = "Done!"
73
82
  end
74
83
  when "add"
75
- case ARGV[1]
84
+ graphql_class = ARGV[1]
85
+ case graphql_class
76
86
  when "mutation"
77
87
  Souls::Init.add_mutation class_name: "user", file_name: "hoi"
78
88
  when "type"
@@ -84,82 +94,89 @@ begin
84
94
  when "rspec_mutation"
85
95
  Souls::Init.add_rspec_mutation class_name: "user", file_name: "hoi"
86
96
  else
87
- puts "HOI!"
97
+ puts Paint["Wrong Argument!", :red]
88
98
  end
89
99
  when "g", "generate"
90
- case ARGV[1]
100
+ graphql_class = ARGV[1]
101
+ class_name = ARGV[2]
102
+ case graphql_class
91
103
  when "test_dir"
92
104
  Souls::Generate.test_dir
93
105
  when "model"
94
- Souls::Generate.model class_name: ARGV[2]
106
+ Souls::Generate.model class_name: class_name
95
107
  when "mutation"
96
- Souls::Generate.mutation class_name: ARGV[2]
108
+ Souls::Generate.mutation class_name: class_name
97
109
  when "query"
98
- Souls::Generate.query class_name: ARGV[2]
110
+ Souls::Generate.query class_name: class_name
99
111
  when "type"
100
- Souls::Generate.type class_name: ARGV[2]
112
+ Souls::Generate.type class_name: class_name
101
113
  when "edge"
102
- Souls::Generate.edge class_name: ARGV[2]
114
+ Souls::Generate.edge class_name: class_name
103
115
  when "connection"
104
- Souls::Generate.connection class_name: ARGV[2]
116
+ Souls::Generate.connection class_name: class_name
105
117
  when "resolver"
106
- Souls::Generate.resolver class_name: ARGV[2]
118
+ Souls::Generate.resolver class_name: class_name
107
119
  when "policy"
108
- Souls::Generate.policy class_name: ARGV[2]
120
+ Souls::Generate.policy class_name: class_name
109
121
  when "rspec_factory"
110
- Souls::Generate.rspec_factory class_name: ARGV[2]
122
+ Souls::Generate.rspec_factory class_name: class_name
111
123
  when "rspec_model"
112
- Souls::Generate.rspec_model class_name: ARGV[2]
124
+ Souls::Generate.rspec_model class_name: class_name
113
125
  when "rspec_mutation"
114
- Souls::Generate.rspec_mutation class_name: ARGV[2]
126
+ Souls::Generate.rspec_mutation class_name: class_name
115
127
  when "rspec_query"
116
- Souls::Generate.rspec_query class_name: ARGV[2]
128
+ Souls::Generate.rspec_query class_name: class_name
117
129
  when "rspec_resolver"
118
- Souls::Generate.rspec_resolver class_name: ARGV[2]
130
+ Souls::Generate.rspec_resolver class_name: class_name
119
131
  when "rspec_policy"
120
- Souls::Generate.rspec_policy class_name: ARGV[2]
132
+ Souls::Generate.rspec_policy class_name: class_name
121
133
  when "node_type"
122
- Souls::Generate.node_type class_name: ARGV[2]
134
+ Souls::Generate.node_type class_name: class_name
123
135
  when "job"
124
- Souls::Generate.job class_name: ARGV[2]
136
+ Souls::Generate.job class_name: class_name
125
137
  when "migrate"
126
- Souls::Generate.single_migrate class_name: ARGV[2]
138
+ Souls::Generate.single_migrate class_name: class_name
127
139
  when "migrate_all"
128
140
  Souls::Generate.migrate_all
129
141
  when "migration"
130
- class_name = ARGV[2].underscore.pluralize
131
- system "rake db:create_migration NAME=create_#{class_name}"
142
+ pluralized_class_name = class_name.underscore.pluralize
143
+ system "rake db:create_migration NAME=create_#{pluralized_class_name}"
132
144
  when "update"
133
- Souls::Generate.update_delete class_name: ARGV[2]
134
- Souls::Generate.single_migrate class_name: ARGV[2]
145
+ Souls::Generate.update_delete class_name: class_name
146
+ Souls::Generate.single_migrate class_name: class_name
135
147
  else
136
148
  "SOULs!"
137
149
  end
138
150
  when "d"
139
- Souls::Generate.delete_all class_name: ARGV[1]
151
+ class_name = ARGV[1]
152
+ Souls::Generate.delete_all class_name: class_name
140
153
  when "db:create"
141
- case ARGV[1]
154
+ rack_env = ARGV[1]
155
+ case rack_env
142
156
  when "RACK_ENV=production"
143
157
  system "rake db:create RACK_ENV=production"
144
158
  else
145
159
  system "rake db:create && rake db:create RACK_ENV=test"
146
160
  end
147
161
  when "db:migrate"
148
- case ARGV[1]
162
+ rack_env = ARGV[1]
163
+ case rack_env
149
164
  when "RACK_ENV=production"
150
165
  system "rake db:migrate RACK_ENV=production"
151
166
  else
152
167
  system "rake db:migrate && rake db:migrate RACK_ENV=test"
153
168
  end
154
169
  when "db:seed"
155
- case ARGV[1]
170
+ rack_env = ARGV[1]
171
+ case rack_env
156
172
  when "RACK_ENV=production"
157
173
  system "rake db:seed RACK_ENV=production"
158
174
  else
159
175
  system "rake db:seed"
160
176
  end
161
177
  when "db:migrate:reset"
162
- case ARGV[1]
178
+ rack_env = ARGV[1]
179
+ case rack_env
163
180
  when "RACK_ENV=production"
164
181
  system "rake db:migrate:reset RACK_ENV=production DISABLE_DATABASE_ENVIRONMENT_CHECK=1"
165
182
  else
@@ -184,10 +201,11 @@ begin
184
201
  system "docker build . -t souls -f Dockerfile.dev"
185
202
  system "docker run --rm --env-file .env -p 3000:3000 souls:latest"
186
203
  when "deploy"
187
- system "gcloud builds submit --config=cloudbuild.yml --project #{ARGV[1]}"
204
+ project_id = Souls.configuration.project_id
205
+ system "gcloud builds submit --config=cloudbuild.yml --project #{project_id}"
188
206
  else
189
207
  puts Paint["Welcome to SOULs!", :green]
190
208
  end
191
209
  rescue StandardError => error
192
- puts Paint["Something Wrong...", :red]
210
+ puts Paint[error, :red]
193
211
  end
data/lib/souls.rb CHANGED
@@ -96,7 +96,7 @@ module Souls
96
96
  updated_gems << (gem[0]).to_s
97
97
  updated_gem_versions << data["version"]
98
98
  system "gem update #{gem[0]}"
99
- console_log << if gem[0] == "souls"
99
+ console_log << if gem[0].to_s == "souls"
100
100
  "#{gem[0]} v#{gem[1]} → v#{data["version"]}\n\nSOULs Doc: https://souls.elsoul.nl"
101
101
  else
102
102
  "#{gem[0]} v#{gem[1]} → v#{data["version"]}"
@@ -11,7 +11,7 @@ module Souls
11
11
  end
12
12
  EOS
13
13
  end
14
- puts "Created file! : #{file_path}"
14
+ puts Paint % ["Created file! : %{white_text}", :green, { white_text: [file_path.to_s, :white] }]
15
15
  file_path
16
16
  rescue StandardError => e
17
17
  raise StandardError, e
@@ -11,7 +11,7 @@ module Souls
11
11
  end
12
12
  EOS
13
13
  end
14
- puts "Created file! : #{file_path}"
14
+ puts Paint % ["Created file! : %{white_text}", :green, { white_text: [file_path.to_s, :white] }]
15
15
  file_path
16
16
  rescue StandardError => e
17
17
  raise StandardError, e
@@ -13,7 +13,7 @@ module Souls
13
13
  end
14
14
  EOS
15
15
  end
16
- puts "Created file! : #{file_path}"
16
+ puts Paint % ["Created file! : %{white_text}", :green, { white_text: [file_path.to_s, :white] }]
17
17
  file_path
18
18
  rescue StandardError => e
19
19
  raise StandardError, e
@@ -270,7 +270,7 @@ module Souls
270
270
  update_mutation(class_name: singularized_class_name)
271
271
  delete_mutation(class_name: singularized_class_name)
272
272
  destroy_delete_mutation(class_name: singularized_class_name)
273
- puts "Created file! : #{file_path}"
273
+ puts Paint % ["Created file! : %{white_text}", :green, { white_text: [file_path.to_s, :white] }]
274
274
  file_path
275
275
  rescue StandardError => e
276
276
  raise StandardError, e
@@ -42,7 +42,7 @@ module Souls
42
42
  end
43
43
  EOS
44
44
  end
45
- puts "Created file! : #{file_path}"
45
+ puts Paint % ["Created file! : %{white_text}", :green, { white_text: [file_path.to_s, :white] }]
46
46
  file_path
47
47
  rescue StandardError => e
48
48
  raise StandardError, e
@@ -20,7 +20,7 @@ module Souls
20
20
  end
21
21
  EOS
22
22
  end
23
- puts "Created file! : #{file_path}"
23
+ puts Paint % ["Created file! : %{white_text}", :green, { white_text: [file_path.to_s, :white] }]
24
24
  file_path
25
25
  rescue StandardError => e
26
26
  raise StandardError, e
@@ -45,7 +45,7 @@ module Souls
45
45
  end
46
46
  end
47
47
  EOS
48
- puts "Created file! : #{file_path}"
48
+ puts Paint % ["Created file! : %{white_text}", :green, { white_text: [file_path.to_s, :white] }]
49
49
  file_path
50
50
  rescue StandardError => e
51
51
  raise StandardError, e
@@ -145,7 +145,7 @@ module Souls
145
145
  resolver_after_params class_name: singularized_class_name
146
146
  resolver_before_end class_name: singularized_class_name
147
147
  resolver_end class_name: singularized_class_name
148
- puts "Created file! : #{file_path}"
148
+ puts Paint % ["Created file! : %{white_text}", :green, { white_text: [file_path.to_s, :white] }]
149
149
  file_path
150
150
  rescue StandardError => e
151
151
  raise StandardError, e
@@ -58,7 +58,7 @@ module Souls
58
58
  rspec_factory_head class_name: singularized_class_name
59
59
  rspec_factory_params class_name: singularized_class_name
60
60
  rspec_factory_end class_name: singularized_class_name
61
- puts "Created file! : #{file_path}"
61
+ puts Paint % ["Created file! : %{white_text}", :green, { white_text: [file_path.to_s, :white] }]
62
62
  file_path
63
63
  rescue StandardError => e
64
64
  raise StandardError, e
@@ -16,7 +16,7 @@ module Souls
16
16
  end
17
17
  EOS
18
18
  end
19
- puts "Created file! : #{file_path}"
19
+ puts Paint % ["Created file! : %{white_text}", :green, { white_text: [file_path.to_s, :white] }]
20
20
  file_path
21
21
  rescue StandardError => e
22
22
  raise StandardError, e
@@ -243,7 +243,7 @@ module Souls
243
243
  rspec_mutation_params class_name: singularized_class_name
244
244
  rspec_mutation_params_response class_name: singularized_class_name
245
245
  rspec_mutation_end class_name: singularized_class_name
246
- puts "Created file! : #{file_path}"
246
+ puts Paint % ["Created file! : %{white_text}", :green, { white_text: [file_path.to_s, :white] }]
247
247
  file_path
248
248
  rescue StandardError => e
249
249
  raise StandardError, e
@@ -36,7 +36,7 @@ module Souls
36
36
  end
37
37
  EOS
38
38
  end
39
- puts "Created file! : #{file_path}"
39
+ puts Paint % ["Created file! : %{white_text}", :green, { white_text: [file_path.to_s, :white] }]
40
40
  file_path
41
41
  rescue StandardError => e
42
42
  raise StandardError, e
@@ -164,7 +164,7 @@ break
164
164
  rspec_query_after_head class_name: singularized_class_name
165
165
  rspec_query_params class_name: singularized_class_name
166
166
  rspec_query_end class_name: singularized_class_name
167
- puts "Created file! : #{file_path}"
167
+ puts Paint % ["Created file! : %{white_text}", :green, { white_text: [file_path.to_s, :white] }]
168
168
  file_path
169
169
  rescue StandardError => e
170
170
  raise StandardError, e
@@ -183,7 +183,7 @@ module Souls
183
183
  rspec_resolver_after_head class_name: singularized_class_name
184
184
  rspec_resolver_params class_name: singularized_class_name
185
185
  rspec_resolver_end class_name: singularized_class_name
186
- puts "Created file! : #{file_path}"
186
+ puts Paint % ["Created file! : %{white_text}", :green, { white_text: [file_path.to_s, :white] }]
187
187
  file_path
188
188
  rescue StandardError => e
189
189
  raise StandardError, e
@@ -60,7 +60,7 @@ module Souls
60
60
  create_type_head class_name: singularized_class_name
61
61
  create_type_params class_name: singularized_class_name
62
62
  create_type_end class_name: singularized_class_name
63
- puts "Created file! : #{file_path}"
63
+ puts Paint % ["Created file! : %{white_text}", :green, { white_text: [file_path.to_s, :white] }]
64
64
  file_path
65
65
  rescue StandardError => e
66
66
  raise StandardError, e
data/lib/souls/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Souls
2
- VERSION = "0.22.9"
2
+ VERSION = "0.23.3"
3
3
  end
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.22.9
4
+ version: 0.23.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - POPPIN-FUMI