souls 0.18.1 → 0.18.2

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: ecd7bd535b9dd6f53563f18d66405389d21f1dca3e8dd9a34409d33ae19b52dc
4
- data.tar.gz: 96d87720d10184363a3ba66f92e8abffa5a132c0540372e9fbfa02709eb5bf10
3
+ metadata.gz: a322a1b2aa38e8c02422ae7c8d7987c057d9c4f9f4067e6bacd13452396dd249
4
+ data.tar.gz: 289abfe312f2aec1e2b6647d519c941a63dabe6a3ece1f1b2a3e5f97d4d53eb2
5
5
  SHA512:
6
- metadata.gz: cd5baac0984a41f18edd23f9b98f333b37acb1ad32ce01c788cb8222a11b7059789f58e02b03f9c886fbf3d78776ea9953a9f9e57da4bb21161b62d3c96506b3
7
- data.tar.gz: cb2d77c3915d11bb56fe357858468b2a559c05f206d4eb08cc15727f56d12d8b293861bd83a9443a82b1e2ae9d957c0694c5c18d3f2d0f5e9b1f493a9d1756ec
6
+ metadata.gz: d2e8645c69414f7dc89b6ff8599b304515199884e59140e3029e4df3d3c73ed8ddd76455b326b51137d4cb949919827297d2b4ce2799cf7c792b2f53f9c04b8f
7
+ data.tar.gz: 23d6e1ce47025aa568196876d388cfc9d33acb19d2eda0ecaff48f9fe3ee2cb075c9cb61582aafc79a5c51c05a97f4fcf34b43de189249bbf7ee96ee6e011f2b
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- souls (0.17.8)
4
+ souls (0.18.1)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
data/config/souls.rb CHANGED
@@ -1,4 +1,4 @@
1
1
  Souls.configure do |config|
2
2
  config.app = "souls"
3
- config.strain = "api"
3
+ config.strain = "graph"
4
4
  end
data/exe/souls CHANGED
@@ -1,6 +1,5 @@
1
1
  #!/usr/bin/env ruby
2
2
  require "souls"
3
- STRAINS = ["graph", "worker", "media", "admin"]
4
3
  begin
5
4
  require "./config/souls" unless ARGV[0] == "new" || ARGV[0] == "i"
6
5
  rescue
@@ -9,6 +8,7 @@ end
9
8
  begin
10
9
  case ARGV[0]
11
10
  when "new"
11
+ STRAINS = ["api", "worker", "media", "admin"]
12
12
  if ARGV[1].nil?
13
13
  puts "you need to specify your app name \n `souls new app_name`"
14
14
  exit
@@ -17,7 +17,7 @@ begin
17
17
  strain = STDIN.gets.chomp.to_i
18
18
  (1..4).include?(strain) ? puts("Generating SOULs.. \n") : raise(StandardError, "Choose Number 1..4")
19
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: "souls", project: { strain: STRAINS[strain.to_i - 1] }
20
+ Souls::Init.initial_config_init app_name: ARGV[1], strain: STRAINS[strain.to_i - 1]
21
21
  when "s", "server"
22
22
  strain = Souls.configuration.strain
23
23
  case strain
data/lib/souls.rb CHANGED
@@ -69,10 +69,11 @@ module Souls
69
69
  end
70
70
 
71
71
  class Configuration
72
- attr_accessor :app
72
+ attr_accessor :app, :strain
73
73
 
74
74
  def initialize
75
75
  @app = nil
76
+ @strain = nil
76
77
  end
77
78
  end
78
79
  end
data/lib/souls/init.rb CHANGED
@@ -1,33 +1,54 @@
1
1
  module Souls
2
2
  module Init
3
3
  class << self
4
- def get_version repository_name: "souls_service"
4
+ def get_version repository_name: "souls_api"
5
5
  data = JSON.parse `curl \
6
6
  -H "Accept: application/vnd.github.v3+json" \
7
7
  -s https://api.github.com/repos/elsoul/#{repository_name}/releases`
8
8
  data[0]["tag_name"]
9
9
  end
10
10
 
11
- def initial_config_init app_name: "souls", project: {}
12
- `touch "#{app_name}/config/souls.rb"`
13
- file_path = "#{app_name}/config/souls.rb"
11
+ def initial_config_init app_name: "souls", strain: "api"
12
+ FileUtils.touch "./#{app_name}/config/souls.rb"
13
+ file_path = "./#{app_name}/config/souls.rb"
14
14
  File.open(file_path, "w") do |f|
15
15
  f.write <<~EOS
16
16
  Souls.configure do |config|
17
17
  config.app = "#{app_name}"
18
- config.strain = "#{project[:strain]}"
18
+ config.strain = "#{strain}"
19
19
  end
20
20
  EOS
21
21
  end
22
+ rescue StandardError => error
23
+ puts error
22
24
  end
23
25
 
24
- def download_souls app_name: "souls", repository_name: "souls_service"
26
+ def config_init app_name: "souls", strain: "api"
27
+ file_dir = "#{__dir__}/config"
28
+ FileUtils.mkdir_p file_dir unless Dir.exist? file_dir
29
+ FileUtils.touch "#{__dir__}/config/souls.rb"
30
+ file_path = "#{__dir__}/config/souls.rb"
31
+ puts "Generating souls conf..."
32
+ sleep(rand(0.1..0.3))
33
+ puts "Generated!"
34
+ puts "Let's Edit SOULs Conf: `#{file_path}`"
35
+ File.open(file_path, "w") do |f|
36
+ f.write <<~EOS
37
+ Souls.configure do |config|
38
+ config.app = "#{app_name}"
39
+ config.strain = "#{strain}"
40
+ end
41
+ EOS
42
+ end
43
+ end
44
+
45
+ def download_souls app_name: "souls", repository_name: "souls_api "
25
46
  version = get_version repository_name: repository_name
26
47
  system "curl -OL https://github.com/elsoul/#{repository_name}/archive/#{version}.tar.gz"
27
48
  system "tar -zxvf ./#{version}.tar.gz"
28
49
  system "mkdir #{app_name}"
29
50
  folder = version.delete "v"
30
- system "cp -r #{repository_name}-#{folder}/* #{app_name}/"
51
+ system "cp -r #{repository_name}-#{folder}/. #{app_name}/"
31
52
  system "rm -rf #{version}.tar.gz && rm -rf #{repository_name}-#{folder}"
32
53
  txt = <<~TEXT
33
54
  _____ ____ __ ____#{' '}
data/lib/souls/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Souls
2
- VERSION = "0.18.1"
2
+ VERSION = "0.18.2"
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.18.1
4
+ version: 0.18.2
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-04-07 00:00:00.000000000 Z
13
+ date: 2021-04-08 00:00:00.000000000 Z
14
14
  dependencies: []
15
15
  description: SOULS is a Web Application Framework for Microservices on Multi Cloud
16
16
  Platform such as Google Cloud Platform, Amazon Web Services, and Alibaba Cloud.