souls 0.22.5 → 0.22.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: bed6004f3170a39620f7834cc1b84a058c389a05900b7310dba4b8a403109591
4
- data.tar.gz: 49a55fb794250d21ddb7933ced45293984d834ff9ab1ac24c77a577178cb4d1a
3
+ metadata.gz: d4743791a22f8b54e87e3a64e86d1e9c1788ee935fddc3613d8d8ae199d88094
4
+ data.tar.gz: 4efd188ab4db345f57cc8e74480c9bfd95ef120122f55311644cc036166a370a
5
5
  SHA512:
6
- metadata.gz: ece098d4c8d8ec049bffab408f89431ce876af83c2402956ee3d79c554c707c1efc28332163bb0a25cc0a3e7bb7c3c041f9f6dc4f7104731b55c7de0ed8984b4
7
- data.tar.gz: 59df6b7b6d132addba2af753c8148c2d27d67fe88974b998cb3d668aa80efab73ca49e14352e1d1bb77d56b2a6496f0db6b0e0f00309e1cd6459ff9aebe70435
6
+ metadata.gz: 71938d1f307ff795e6bce9acb49825bf76d494b8677433b1b4fb84f8ccdbf9b59c397405c41ebd529b5a121cffd9ae14c56b35c304ebf737544e62e55678fd79
7
+ data.tar.gz: a24bc9987ab8bdc55d170d512ef66472184ab5d69f147af49331c3f6a67055b6cc95c67ccee965ffe011177fd5bb48f2fb8acfefc589a3ec3898290a57621ac9
data/Gemfile CHANGED
@@ -10,3 +10,4 @@ gem "rake", "13.0.6"
10
10
  gem "rspec", "3.10.0"
11
11
  gem "rubocop", "1.18.3"
12
12
  gem "steep", "0.44.1"
13
+ gem "whirly", "0.3.0"
data/Gemfile.lock CHANGED
@@ -1,7 +1,9 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- souls (0.22.4)
4
+ souls (0.22.8)
5
+ paint (= 2.2.1)
6
+ whirly (= 0.3.0)
5
7
 
6
8
  GEM
7
9
  remote: https://rubygems.org/
@@ -57,7 +59,7 @@ GEM
57
59
  rubocop-ast (>= 1.7.0, < 2.0)
58
60
  ruby-progressbar (~> 1.7)
59
61
  unicode-display_width (>= 1.4.0, < 3.0)
60
- rubocop-ast (1.7.0)
62
+ rubocop-ast (1.8.0)
61
63
  parser (>= 3.0.1.1)
62
64
  ruby-progressbar (1.11.0)
63
65
  steep (0.44.1)
@@ -74,6 +76,8 @@ GEM
74
76
  tzinfo (2.0.4)
75
77
  concurrent-ruby (~> 1.0)
76
78
  unicode-display_width (2.0.0)
79
+ whirly (0.3.0)
80
+ unicode-display_width (>= 1.1)
77
81
  zeitwerk (2.4.2)
78
82
 
79
83
  PLATFORMS
@@ -88,6 +92,7 @@ DEPENDENCIES
88
92
  rubocop (= 1.18.3)
89
93
  souls!
90
94
  steep (= 0.44.1)
95
+ whirly (= 0.3.0)
91
96
 
92
97
  BUNDLED WITH
93
98
  2.2.23
data/README.md CHANGED
@@ -75,7 +75,7 @@ And Create Your APP
75
75
 
76
76
  ## SOULs Document
77
77
 
78
- - [SOULs Document](https://souls-doc.el-soul.com/)
78
+ - [SOULs Document](https://souls.elsoul.nl/)
79
79
 
80
80
 
81
81
 
data/exe/souls CHANGED
@@ -8,20 +8,37 @@ end
8
8
  begin
9
9
  case ARGV[0]
10
10
  when "new"
11
- STRAINS = ["api", "worker", "media", "admin"]
11
+ STRAINS = ["api", "worker", "console", "admin", "media"]
12
12
  if ARGV[1].nil?
13
- puts "you need to specify your app name \n `souls new app_name`"
13
+ puts Paint["you need to specify your app name", :red]
14
+ puts Paint["`souls new app_name`", :yellow]
14
15
  exit
15
16
  end
16
- puts "Which framework: \n 1. SOULs GraphQL API \n 2. SOULs Worker \n 3. SOULs Media Web \n 4. SOULs Admin Web \n Enter Number: "
17
+ first_message = Paint % [
18
+ "Select Strain: %{red_text} %{yellow_text} %{green_text} %{blue_text} %{cyan_text}",
19
+ :white,
20
+ {
21
+ red_text: ["\n1. SOULs GraphQL API", :red],
22
+ yellow_text: ["\n2. SOULs Worker", :yellow],
23
+ green_text: ["\n3. SOULs Console Web", :green],
24
+ blue_text: ["\n4. SOULs Admin Web", :blue],
25
+ cyan_text: ["\n5. SOULs Media Web", :cyan]
26
+ }
27
+ ]
28
+ puts first_message
17
29
  strain = STDIN.gets.chomp.to_i
18
- (1..4).include?(strain) ? puts("Generating SOULs.. \n") : raise(StandardError, "Choose Number 1..4")
19
- Souls::Init.download_souls app_name: ARGV[1], repository_name: "souls_#{STRAINS[strain.to_i - 1]}"
20
- Souls::Init.initial_config_init app_name: ARGV[1], strain: STRAINS[strain.to_i - 1]
30
+ case strain
31
+ 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
+ else
35
+ puts Paint["Coming Soon...", :blue]
36
+ end
37
+
21
38
  when "s", "server"
22
39
  strain = Souls.configuration.strain
23
40
  case strain
24
- when "media", "admin"
41
+ when "media", "admin", "console"
25
42
  system "yarn dev"
26
43
  when "worker"
27
44
  system "bundle exec puma -p 3000 -e development"
@@ -48,7 +65,12 @@ begin
48
65
  when "-v", "--version"
49
66
  puts Souls::VERSION
50
67
  when "gem:update", "gemfile:update"
51
- Souls.update_gemfile
68
+ status = Paint["Checking for updates...", :yellow]
69
+ Whirly.start spinner: "clock", interval: 1000, stop: "🎉" do
70
+ Whirly.status = status
71
+ Souls.update_gemfile
72
+ Whirly.status = "Done!"
73
+ end
52
74
  when "add"
53
75
  case ARGV[1]
54
76
  when "mutation"
@@ -164,10 +186,8 @@ begin
164
186
  when "deploy"
165
187
  system "gcloud builds submit --config=cloudbuild.yml --project #{ARGV[1]}"
166
188
  else
167
- puts "Welcome to SOULs!"
189
+ puts Paint["Welcome to SOULs!", :green]
168
190
  end
169
191
  rescue StandardError => error
170
- puts error.backtrace
171
- puts "Thank you!!"
172
- puts "SOULs"
192
+ puts Paint["Something Wrong...", :red]
173
193
  end
data/lib/souls.rb CHANGED
@@ -7,6 +7,7 @@ require "json"
7
7
  require "fileutils"
8
8
  require "net/http"
9
9
  require "paint"
10
+ require "whirly"
10
11
 
11
12
  module Souls
12
13
  SOULS_METHODS = [
@@ -54,6 +55,23 @@ module Souls
54
55
  system "gcloud scheduler jobs create http #{app}-awake --schedule '0,10,20,30,40,50 * * * *' --uri #{url} --http-method GET"
55
56
  end
56
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
+
57
75
  def gemfile_latest_version
58
76
  file_path = "./Gemfile"
59
77
  updated_gems = []
@@ -78,7 +96,11 @@ module Souls
78
96
  updated_gems << (gem[0]).to_s
79
97
  updated_gem_versions << data["version"]
80
98
  system "gem update #{gem[0]}"
81
- console_log << "#{gem[0]} v#{gem[1]} → v#{data["version"]}"
99
+ console_log << if gem[0] == "souls"
100
+ "#{gem[0]} v#{gem[1]} → v#{data["version"]}\n\nSOULs Doc: https://souls.elsoul.nl"
101
+ else
102
+ "#{gem[0]} v#{gem[1]} → v#{data["version"]}"
103
+ end
82
104
  end
83
105
  end
84
106
  {
@@ -94,21 +116,41 @@ module Souls
94
116
  tmp_file = "./tmp/Gemfile"
95
117
  new_gems = gemfile_latest_version
96
118
  logs = []
97
- return "Already Up to date!" && puts("Already Up to date!") if new_gems[:gems].blank?
119
+ message = Paint["\nAlready Up to date!", :green]
120
+ return "Already Up to date!" && puts(message) if new_gems[:gems].blank?
98
121
  @i = 0
99
122
  File.open(file_path, "r") do |f|
100
123
  File.open(tmp_file, "w") do |new_line|
101
124
  f.each_line do |line|
102
125
  gem = line.gsub("gem ", "").gsub("\"", "").gsub("\n", "").gsub(" ", "").split(",")
103
126
  if new_gems[:gems].include? gem[0]
104
- logs << Paint % [
105
- "#{gem[0]} %{yellow_text} → %{green_text}",
106
- :blue,
107
- {
108
- yellow_text: ["v#{gem[1]}", :yellow],
109
- green_text: ["v#{new_gems[:updated_gem_versions][@i]}", :green]
110
- }
111
- ]
127
+ old_ver = gem[1].split(".")
128
+ new_ver = new_gems[:updated_gem_versions][@i].split(".")
129
+ if old_ver[0] < new_ver[0]
130
+ logs << Paint % [
131
+ "#{gem[0]} v#{gem[1]} → %{red_text}",
132
+ :white,
133
+ {
134
+ red_text: ["v#{new_gems[:updated_gem_versions][@i]}", :red]
135
+ }
136
+ ]
137
+ elsif old_ver[1] < new_ver[1]
138
+ logs << Paint % [
139
+ "#{gem[0]} v#{gem[1]} → v#{new_ver[0]}.%{yellow_text}",
140
+ :white,
141
+ {
142
+ yellow_text: ["#{new_ver[1]}.#{new_ver[2]}", :yellow]
143
+ }
144
+ ]
145
+ elsif old_ver[2] < new_ver[2]
146
+ logs << Paint % [
147
+ "#{gem[0]} v#{gem[1]} → v#{new_ver[0]}.#{new_ver[1]}.%{green_text}",
148
+ :white,
149
+ {
150
+ green_text: [(new_ver[2]).to_s, :green]
151
+ }
152
+ ]
153
+ end
112
154
  new_line.write "#{new_gems[:lines][@i]}\n"
113
155
  @i += 1
114
156
  else
data/lib/souls/init.rb CHANGED
@@ -29,8 +29,11 @@ module Souls
29
29
  system "tar -zxvf ./#{version}.tar.gz"
30
30
  system "mkdir #{app_name}"
31
31
  folder = version.delete "v"
32
- system "cp -r #{repository_name}-#{folder}/. #{app_name}/"
33
- system "rm -rf #{version}.tar.gz && rm -rf #{repository_name}-#{folder}"
32
+ `cp -r #{repository_name}-#{folder}/. #{app_name}/`
33
+ `rm -rf #{version}.tar.gz && rm -rf #{repository_name}-#{folder}`
34
+ line = Paint["====================================", :yellow]
35
+ puts "\n"
36
+ puts line
34
37
  txt = <<~TEXT
35
38
  _____ ____ __ ____#{' '}
36
39
  / ___// __ \\/ / / / / _____
@@ -38,13 +41,17 @@ module Souls
38
41
  ___/ / /_/ / /_/ / /___(__ )#{' '}
39
42
  /____/\\____/\\____/_____/____/#{' '}
40
43
  TEXT
41
- puts txt
42
- puts "=============================="
43
- puts "Welcome to SOULs!"
44
- puts "SOULs Version: #{Souls::VERSION}"
45
- puts "=============================="
46
- puts "$ cd #{app_name}"
47
- puts "------------------------------"
44
+ message = Paint[txt, :blue]
45
+ puts message
46
+ puts line
47
+ welcome = Paint["Welcome to SOULs!", :white]
48
+ puts welcome
49
+ souls_ver = Paint["SOULs Version: #{Souls::VERSION}", :white]
50
+ puts souls_ver
51
+ puts line
52
+ cd = Paint["Easy to Run\n$ cd #{app_name}\n$ bundle\n$ souls s\nGo To : http://localhost:3000\n\nDoc: https://souls.elsoul.nl", :white]
53
+ puts cd
54
+ puts line
48
55
  end
49
56
  end
50
57
  end
data/lib/souls/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Souls
2
- VERSION = "0.22.5"
2
+ VERSION = "0.22.9"
3
3
  end
data/souls.gemspec CHANGED
@@ -8,7 +8,7 @@ Gem::Specification.new do |spec|
8
8
 
9
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
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
- spec.homepage = "https://github.com/elsoul/souls"
11
+ spec.homepage = "https://souls.elsoul.nl"
12
12
  spec.license = "Apache-2.0"
13
13
  spec.required_ruby_version = Gem::Requirement.new(">= 3.0.0")
14
14
 
@@ -24,4 +24,6 @@ Gem::Specification.new do |spec|
24
24
  spec.bindir = "exe"
25
25
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
26
26
  spec.require_paths = ["lib"]
27
+ spec.add_runtime_dependency "paint", "2.2.1"
28
+ spec.add_runtime_dependency "whirly", "0.3.0"
27
29
  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.5
4
+ version: 0.22.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - POPPIN-FUMI
@@ -11,7 +11,35 @@ autorequire:
11
11
  bindir: exe
12
12
  cert_chain: []
13
13
  date: 2021-07-14 00:00:00.000000000 Z
14
- dependencies: []
14
+ dependencies:
15
+ - !ruby/object:Gem::Dependency
16
+ name: paint
17
+ requirement: !ruby/object:Gem::Requirement
18
+ requirements:
19
+ - - '='
20
+ - !ruby/object:Gem::Version
21
+ version: 2.2.1
22
+ type: :runtime
23
+ prerelease: false
24
+ version_requirements: !ruby/object:Gem::Requirement
25
+ requirements:
26
+ - - '='
27
+ - !ruby/object:Gem::Version
28
+ version: 2.2.1
29
+ - !ruby/object:Gem::Dependency
30
+ name: whirly
31
+ requirement: !ruby/object:Gem::Requirement
32
+ requirements:
33
+ - - '='
34
+ - !ruby/object:Gem::Version
35
+ version: 0.3.0
36
+ type: :runtime
37
+ prerelease: false
38
+ version_requirements: !ruby/object:Gem::Requirement
39
+ requirements:
40
+ - - '='
41
+ - !ruby/object:Gem::Version
42
+ version: 0.3.0
15
43
  description: SOULs is a Serverless Application Framework. SOULs has four strains,
16
44
  API, Worker, Console, Media, and can be used in combination according to the purpose.
17
45
  SOULs Backend GraphQL Ruby & Frontend Relay are Scalable and Easy to deploy to Google
@@ -67,11 +95,11 @@ files:
67
95
  - lib/souls/version.rb
68
96
  - rbs/init.rbs
69
97
  - souls.gemspec
70
- homepage: https://github.com/elsoul/souls
98
+ homepage: https://souls.elsoul.nl
71
99
  licenses:
72
100
  - Apache-2.0
73
101
  metadata:
74
- homepage_uri: https://github.com/elsoul/souls
102
+ homepage_uri: https://souls.elsoul.nl
75
103
  source_code_uri: https://github.com/elsoul/souls
76
104
  changelog_uri: https://github.com/elsoul/souls
77
105
  post_install_message: