souls 0.22.2 → 0.22.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 +4 -4
- data/Gemfile +4 -2
- data/Gemfile.lock +12 -7
- data/exe/souls +7 -0
- data/lib/souls.rb +116 -2
- data/lib/souls/generate/mutation.rb +4 -6
- data/lib/souls/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bd2faa6f8e7051a032899708b1dd4bb76d7b26d4356152524033c8d5c681d53c
|
4
|
+
data.tar.gz: c348b3a03e2d0424194840c35b30406d5ce8915eb38fe0f98dab027a254d76fb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1540b390438a9f73da430fa2ffa7fa29bd134ab043e2aec9e5758f6b26ea381be1990050a6c8c77b2fe1293aadab086937c2b8dd0f93fda84eb72696ef9000a8
|
7
|
+
data.tar.gz: c3de92ab1a4305b7e4ca21cb07f31c3ee3e849d18c8d702892394fb761d42bd7cc8f778b35c4f4766af4083e6a1d6e150d71f9d43c2d8cb1d5cf653f2f945d50
|
data/Gemfile
CHANGED
@@ -4,8 +4,10 @@ source "https://rubygems.org"
|
|
4
4
|
gemspec
|
5
5
|
|
6
6
|
gem "activesupport", "6.1.4"
|
7
|
-
gem "
|
8
|
-
gem "
|
7
|
+
gem "paint", "2.2.1"
|
8
|
+
gem "parser", "3.0.2.0"
|
9
|
+
gem "rake", "13.0.6"
|
9
10
|
gem "rspec", "3.10.0"
|
10
11
|
gem "rubocop", "1.18.3"
|
11
12
|
gem "steep", "0.44.1"
|
13
|
+
gem "whirly", "0.3.0"
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
souls (0.22.
|
4
|
+
souls (0.22.5)
|
5
5
|
|
6
6
|
GEM
|
7
7
|
remote: https://rubygems.org/
|
@@ -23,11 +23,12 @@ GEM
|
|
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
|
+
paint (2.2.1)
|
26
27
|
parallel (1.20.1)
|
27
|
-
parser (3.0.
|
28
|
+
parser (3.0.2.0)
|
28
29
|
ast (~> 2.4.1)
|
29
30
|
rainbow (3.0.0)
|
30
|
-
rake (13.0.
|
31
|
+
rake (13.0.6)
|
31
32
|
rb-fsevent (0.11.0)
|
32
33
|
rb-inotify (0.10.1)
|
33
34
|
ffi (~> 1.0)
|
@@ -56,7 +57,7 @@ GEM
|
|
56
57
|
rubocop-ast (>= 1.7.0, < 2.0)
|
57
58
|
ruby-progressbar (~> 1.7)
|
58
59
|
unicode-display_width (>= 1.4.0, < 3.0)
|
59
|
-
rubocop-ast (1.
|
60
|
+
rubocop-ast (1.8.0)
|
60
61
|
parser (>= 3.0.1.1)
|
61
62
|
ruby-progressbar (1.11.0)
|
62
63
|
steep (0.44.1)
|
@@ -73,6 +74,8 @@ GEM
|
|
73
74
|
tzinfo (2.0.4)
|
74
75
|
concurrent-ruby (~> 1.0)
|
75
76
|
unicode-display_width (2.0.0)
|
77
|
+
whirly (0.3.0)
|
78
|
+
unicode-display_width (>= 1.1)
|
76
79
|
zeitwerk (2.4.2)
|
77
80
|
|
78
81
|
PLATFORMS
|
@@ -80,12 +83,14 @@ PLATFORMS
|
|
80
83
|
|
81
84
|
DEPENDENCIES
|
82
85
|
activesupport (= 6.1.4)
|
83
|
-
|
84
|
-
|
86
|
+
paint (= 2.2.1)
|
87
|
+
parser (= 3.0.2.0)
|
88
|
+
rake (= 13.0.6)
|
85
89
|
rspec (= 3.10.0)
|
86
90
|
rubocop (= 1.18.3)
|
87
91
|
souls!
|
88
92
|
steep (= 0.44.1)
|
93
|
+
whirly (= 0.3.0)
|
89
94
|
|
90
95
|
BUNDLED WITH
|
91
|
-
2.2.
|
96
|
+
2.2.23
|
data/exe/souls
CHANGED
@@ -47,6 +47,13 @@ begin
|
|
47
47
|
Souls::Gcloud.send ARGV[1]
|
48
48
|
when "-v", "--version"
|
49
49
|
puts Souls::VERSION
|
50
|
+
when "gem:update", "gemfile:update"
|
51
|
+
status = Paint["Checking for updates...", :yellow]
|
52
|
+
Whirly.start spinner: "clock", color: :false, interval: 1000, stop: "🎉" do
|
53
|
+
Whirly.status = status
|
54
|
+
Souls.update_gemfile
|
55
|
+
Whirly.status = "Done!"
|
56
|
+
end
|
50
57
|
when "add"
|
51
58
|
case ARGV[1]
|
52
59
|
when "mutation"
|
data/lib/souls.rb
CHANGED
@@ -5,6 +5,9 @@ require_relative "souls/generate"
|
|
5
5
|
require_relative "souls/gcloud"
|
6
6
|
require "json"
|
7
7
|
require "fileutils"
|
8
|
+
require "net/http"
|
9
|
+
require "paint"
|
10
|
+
require "whirly"
|
8
11
|
|
9
12
|
module Souls
|
10
13
|
SOULS_METHODS = [
|
@@ -39,9 +42,9 @@ module Souls
|
|
39
42
|
def run_mysql
|
40
43
|
system "docker run --rm -d \
|
41
44
|
-p 3306:3306 \
|
42
|
-
-v mysql-tmp:/var/lib/
|
45
|
+
-v mysql-tmp:/var/lib/mysql \
|
43
46
|
-e MYSQL_USER=mysql \
|
44
|
-
-e
|
47
|
+
-e MYSQL_ROOT_PASSWORD=mysql \
|
45
48
|
-e MYSQL_DB=souls_test \
|
46
49
|
mysql:latest"
|
47
50
|
system "docker ps"
|
@@ -51,6 +54,117 @@ module Souls
|
|
51
54
|
app = Souls.configuration.app
|
52
55
|
system "gcloud scheduler jobs create http #{app}-awake --schedule '0,10,20,30,40,50 * * * *' --uri #{url} --http-method GET"
|
53
56
|
end
|
57
|
+
|
58
|
+
def show_wait_spinner(fps = 10)
|
59
|
+
chars = %w[| / - \\]
|
60
|
+
delay = 1.0 / fps
|
61
|
+
iter = 0
|
62
|
+
spinner = Thread.new do
|
63
|
+
while iter
|
64
|
+
print chars[(iter += 1) % chars.length]
|
65
|
+
sleep delay
|
66
|
+
print "\b"
|
67
|
+
end
|
68
|
+
end
|
69
|
+
yield.tap do
|
70
|
+
iter = false
|
71
|
+
spinner.join
|
72
|
+
end
|
73
|
+
end
|
74
|
+
|
75
|
+
def gemfile_latest_version
|
76
|
+
file_path = "./Gemfile"
|
77
|
+
updated_gems = []
|
78
|
+
updated_gem_versions = []
|
79
|
+
updated_lines = []
|
80
|
+
console_log = []
|
81
|
+
from_dev = false
|
82
|
+
File.open(file_path, "r") do |f|
|
83
|
+
f.each_line do |line|
|
84
|
+
from_dev = true if line.include? "group"
|
85
|
+
next unless line.include? "gem "
|
86
|
+
gem = line.gsub("gem ", "").gsub("\"", "").gsub("\n", "").gsub(" ", "").split(",")
|
87
|
+
url = URI("https://rubygems.org/api/v1/versions/#{gem[0]}/latest.json")
|
88
|
+
res = Net::HTTP.get_response(url)
|
89
|
+
data = JSON.parse res.body
|
90
|
+
next if data["version"].to_s == gem[1].to_s
|
91
|
+
updated_lines << if from_dev
|
92
|
+
" gem \"#{gem[0]}\", \"#{data["version"]}\""
|
93
|
+
else
|
94
|
+
"gem \"#{gem[0]}\", \"#{data["version"]}\""
|
95
|
+
end
|
96
|
+
updated_gems << (gem[0]).to_s
|
97
|
+
updated_gem_versions << data["version"]
|
98
|
+
system "gem update #{gem[0]}"
|
99
|
+
console_log << "#{gem[0]} v#{gem[1]} → v#{data["version"]}"
|
100
|
+
end
|
101
|
+
end
|
102
|
+
{
|
103
|
+
gems: updated_gems,
|
104
|
+
lines: updated_lines,
|
105
|
+
console_log: console_log,
|
106
|
+
updated_gem_versions: updated_gem_versions
|
107
|
+
}
|
108
|
+
end
|
109
|
+
|
110
|
+
def update_gemfile
|
111
|
+
file_path = "./Gemfile"
|
112
|
+
tmp_file = "./tmp/Gemfile"
|
113
|
+
new_gems = gemfile_latest_version
|
114
|
+
logs = []
|
115
|
+
message = Paint["\nAlready Up to date!", :green]
|
116
|
+
return "Already Up to date!" && puts(message) if new_gems[:gems].blank?
|
117
|
+
@i = 0
|
118
|
+
File.open(file_path, "r") do |f|
|
119
|
+
File.open(tmp_file, "w") do |new_line|
|
120
|
+
f.each_line do |line|
|
121
|
+
gem = line.gsub("gem ", "").gsub("\"", "").gsub("\n", "").gsub(" ", "").split(",")
|
122
|
+
if new_gems[:gems].include? gem[0]
|
123
|
+
old_ver = gem[1].split(".")
|
124
|
+
new_ver = new_gems[:updated_gem_versions][@i].split(".")
|
125
|
+
if old_ver[0] < new_ver[0]
|
126
|
+
logs << Paint % [
|
127
|
+
"#{gem[0]} v#{gem[1]} → %{red_text}",
|
128
|
+
:white,
|
129
|
+
{
|
130
|
+
red_text: ["v#{new_gems[:updated_gem_versions][@i]}", :red]
|
131
|
+
}
|
132
|
+
]
|
133
|
+
elsif old_ver[1] < new_ver[1]
|
134
|
+
logs << Paint % [
|
135
|
+
"#{gem[0]} v#{gem[1]} → v#{new_ver[0]}.%{yellow_text}",
|
136
|
+
:white,
|
137
|
+
{
|
138
|
+
yellow_text: ["#{new_ver[1]}.#{new_ver[2]}", :yellow]
|
139
|
+
}
|
140
|
+
]
|
141
|
+
elsif old_ver[2] < new_ver[2]
|
142
|
+
logs << Paint % [
|
143
|
+
"#{gem[0]} v#{gem[1]} → v#{new_ver[0]}.#{new_ver[1]}.%{green_text}",
|
144
|
+
:white,
|
145
|
+
{
|
146
|
+
green_text: [(new_ver[2]).to_s, :green]
|
147
|
+
}
|
148
|
+
]
|
149
|
+
end
|
150
|
+
new_line.write "#{new_gems[:lines][@i]}\n"
|
151
|
+
@i += 1
|
152
|
+
else
|
153
|
+
new_line.write line
|
154
|
+
end
|
155
|
+
end
|
156
|
+
end
|
157
|
+
end
|
158
|
+
FileUtils.rm "./Gemfile"
|
159
|
+
FileUtils.rm "./Gemfile.lock"
|
160
|
+
FileUtils.mv "./tmp/Gemfile", "./Gemfile"
|
161
|
+
system "bundle update"
|
162
|
+
success = Paint["\n\nSuccessfully Updated These Gems!\n", :green]
|
163
|
+
puts success
|
164
|
+
logs.each do |line|
|
165
|
+
puts line
|
166
|
+
end
|
167
|
+
end
|
54
168
|
end
|
55
169
|
|
56
170
|
def self.configure
|
@@ -83,12 +83,10 @@ module Souls
|
|
83
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
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
{ error: #{class_name}.errors.full_messages }
|
91
|
-
end
|
86
|
+
data = ::#{class_name.camelize}.new args
|
87
|
+
raise(StandardError, data.errors.full_messages) unless data.save
|
88
|
+
|
89
|
+
{ #{class_name}_edge: { node: data } }
|
92
90
|
rescue StandardError => error
|
93
91
|
GraphQL::ExecutionError.new error
|
94
92
|
end
|
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.22.
|
4
|
+
version: 0.22.6
|
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-07-
|
13
|
+
date: 2021-07-14 00:00:00.000000000 Z
|
14
14
|
dependencies: []
|
15
15
|
description: SOULs is a Serverless Application Framework. SOULs has four strains,
|
16
16
|
API, Worker, Console, Media, and can be used in combination according to the purpose.
|