souls 0.22.2 → 0.22.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 +4 -4
- data/Gemfile +3 -2
- data/Gemfile.lock +7 -5
- data/exe/souls +2 -0
- data/lib/souls.rb +70 -0
- 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: 57c46163d64005f9cd46d9ca0fd6aefcd8ed5f9fea2b6cd51af43ce137dead5f
|
|
4
|
+
data.tar.gz: 773998842799f40773d33d2b9a250b75f343e2c48e150b0d3dc2478e72555767
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 7a5128b2314875e096a6a65778741537a5ed6ae53965bf639045d77afefa0cde620ae5de778de9c854e3b10e8d180e8bab21d1f806dabd42e8a78521bc81aebe
|
|
7
|
+
data.tar.gz: 149ce9a5bdafc29572c2b49c45e47d7adc7098aab022424dbcdab561810658c101e72d36d5d1fc7f75930d556c611627d86b0b9a4aa865a4b0e2ad144639be5b
|
data/Gemfile
CHANGED
|
@@ -4,8 +4,9 @@ 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"
|
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.3)
|
|
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)
|
|
@@ -80,8 +81,9 @@ PLATFORMS
|
|
|
80
81
|
|
|
81
82
|
DEPENDENCIES
|
|
82
83
|
activesupport (= 6.1.4)
|
|
83
|
-
|
|
84
|
-
|
|
84
|
+
paint (= 2.2.1)
|
|
85
|
+
parser (= 3.0.2.0)
|
|
86
|
+
rake (= 13.0.6)
|
|
85
87
|
rspec (= 3.10.0)
|
|
86
88
|
rubocop (= 1.18.3)
|
|
87
89
|
souls!
|
data/exe/souls
CHANGED
data/lib/souls.rb
CHANGED
|
@@ -5,6 +5,8 @@ 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"
|
|
8
10
|
|
|
9
11
|
module Souls
|
|
10
12
|
SOULS_METHODS = [
|
|
@@ -51,6 +53,74 @@ module Souls
|
|
|
51
53
|
app = Souls.configuration.app
|
|
52
54
|
system "gcloud scheduler jobs create http #{app}-awake --schedule '0,10,20,30,40,50 * * * *' --uri #{url} --http-method GET"
|
|
53
55
|
end
|
|
56
|
+
|
|
57
|
+
def gemfile_latest_version
|
|
58
|
+
file_path = "./Gemfile"
|
|
59
|
+
updated_gems = []
|
|
60
|
+
updated_gem_versions = []
|
|
61
|
+
updated_lines = []
|
|
62
|
+
console_log = []
|
|
63
|
+
File.open(file_path, "r") do |f|
|
|
64
|
+
f.each_line do |line|
|
|
65
|
+
next unless line.include? "gem "
|
|
66
|
+
gem = line.gsub("gem ", "").gsub("\"", "").gsub("\n", "").gsub(" ", "").split(",")
|
|
67
|
+
url = URI("https://rubygems.org/api/v1/versions/#{gem[0]}/latest.json")
|
|
68
|
+
res = Net::HTTP.get_response(url)
|
|
69
|
+
data = JSON.parse res.body
|
|
70
|
+
next if data["version"].to_s == gem[1].to_s
|
|
71
|
+
updated_lines << "gem \"#{gem[0]}\", \"#{data["version"]}\""
|
|
72
|
+
updated_gems << (gem[0]).to_s
|
|
73
|
+
updated_gem_versions << data["version"]
|
|
74
|
+
system "gem update #{gem[0]}"
|
|
75
|
+
console_log << "#{gem[0]} v#{gem[1]} → v#{data["version"]}"
|
|
76
|
+
end
|
|
77
|
+
end
|
|
78
|
+
{
|
|
79
|
+
gems: updated_gems,
|
|
80
|
+
lines: updated_lines,
|
|
81
|
+
console_log: console_log,
|
|
82
|
+
updated_gem_versions: updated_gem_versions
|
|
83
|
+
}
|
|
84
|
+
end
|
|
85
|
+
|
|
86
|
+
def update_gemfile
|
|
87
|
+
file_path = "./Gemfile"
|
|
88
|
+
tmp_file = "./tmp/Gemfile"
|
|
89
|
+
new_gems = gemfile_latest_version
|
|
90
|
+
logs = []
|
|
91
|
+
return "Already Up to date!" && puts("Already Up to date!") if new_gems[:gems].blank?
|
|
92
|
+
@i = 0
|
|
93
|
+
File.open(file_path, "r") do |f|
|
|
94
|
+
File.open(tmp_file, "w") do |new_line|
|
|
95
|
+
f.each_line do |line|
|
|
96
|
+
gem = line.gsub("gem ", "").gsub("\"", "").gsub("\n", "").gsub(" ", "").split(",")
|
|
97
|
+
if new_gems[:gems].include? gem[0]
|
|
98
|
+
logs << Paint % [
|
|
99
|
+
"#{gem[0]} %{yellow_text} → %{green_text}",
|
|
100
|
+
:blue,
|
|
101
|
+
{
|
|
102
|
+
yellow_text: ["v#{gem[1]}", :yellow],
|
|
103
|
+
green_text: ["v#{new_gems[:updated_gem_versions][@i]}", :green]
|
|
104
|
+
}
|
|
105
|
+
]
|
|
106
|
+
new_line.write "#{new_gems[:lines][@i]}\n"
|
|
107
|
+
@i += 1
|
|
108
|
+
else
|
|
109
|
+
new_line.write line
|
|
110
|
+
end
|
|
111
|
+
end
|
|
112
|
+
end
|
|
113
|
+
end
|
|
114
|
+
FileUtils.rm "./Gemfile"
|
|
115
|
+
FileUtils.rm "./Gemfile.lock"
|
|
116
|
+
FileUtils.mv "./tmp/Gemfile", "./Gemfile"
|
|
117
|
+
system "bundle update"
|
|
118
|
+
success = Paint["\n\nSuccessfully Updated These Gems!\n", :green]
|
|
119
|
+
puts success
|
|
120
|
+
logs.each do |line|
|
|
121
|
+
puts line
|
|
122
|
+
end
|
|
123
|
+
end
|
|
54
124
|
end
|
|
55
125
|
|
|
56
126
|
def self.configure
|
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.3
|
|
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.
|