shatter-rb 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/README.md +0 -4
- data/exe/shatter +23 -3
- data/lib/shatter/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 779c71931585d9bb8e13eb0b22f672090d5323dcbdbe0d81369aad78571e8f77
|
4
|
+
data.tar.gz: 688822d6f2c2115247a285a3a04ad514392448562ebb6cd6fb7afdf5f412375a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c770c0d2dd76d847ce9d1265a460b55aa8b5d7a772baaf61d7e85a85580a83155270ad05fd27508869f0d44024fd6df4cdddccdf6dc0194270d27e31ec14e446
|
7
|
+
data.tar.gz: f7a9c9269405e7636eca758850507d571923818cd4e20ceeb24a15b7c22d7b0cd8948486e400841021ead2d3a10f59428364f14d4a22e396449928ee7f0537f1
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -7,10 +7,6 @@ An async first RPC app server built in Ruby. Supported by DRb, Puma, and Zookeep
|
|
7
7
|
</p>
|
8
8
|
|
9
9
|
|
10
|
-
## Why
|
11
|
-
|
12
|
-
Small apps are very common and RPC is a great simple alternative to REST, GraphQL, SOAP, and others. Shatter allows you to very simply, without too much opinion, define your business functions and invoke them with a premade HTTP endpoint.
|
13
|
-
|
14
10
|
## Whats needed
|
15
11
|
|
16
12
|
* Ruby3.1 and later
|
data/exe/shatter
CHANGED
@@ -6,6 +6,8 @@ require "thor"
|
|
6
6
|
require "erb"
|
7
7
|
require "fileutils"
|
8
8
|
require 'zk'
|
9
|
+
require 'puma/cli'
|
10
|
+
|
9
11
|
$stdout.sync = true
|
10
12
|
|
11
13
|
def safe_makedir(path)
|
@@ -29,6 +31,24 @@ class ShatterCLI < Thor
|
|
29
31
|
zk.close
|
30
32
|
end
|
31
33
|
|
34
|
+
desc "service", "starts the service layer"
|
35
|
+
def service
|
36
|
+
Shatter.load_environment
|
37
|
+
begin
|
38
|
+
Shatter::Service::Base.init
|
39
|
+
rescue Interrupt => e
|
40
|
+
puts e.message
|
41
|
+
puts e.backtrace
|
42
|
+
Shatter::Service::Base.close
|
43
|
+
end
|
44
|
+
end
|
45
|
+
|
46
|
+
desc "server", "starts the web server layer"
|
47
|
+
def server
|
48
|
+
cli = Puma::CLI.new ["#{Shatter.root}/config.ru"]
|
49
|
+
puts cli.run
|
50
|
+
end
|
51
|
+
|
32
52
|
desc "generate_typescript", "generates typescript defs of your service definition"
|
33
53
|
option :path
|
34
54
|
def generate_typescript
|
@@ -45,9 +65,9 @@ class ShatterCLI < Thor
|
|
45
65
|
system("bundle install")
|
46
66
|
|
47
67
|
puts "Generating scripts"
|
48
|
-
FileUtils.mkdir("./bin", noop: Dir.exist?("./bin"))
|
49
|
-
FileUtils.cp("#{__dir__}/../bin/service", "./bin/service", verbose: true)
|
50
|
-
FileUtils.cp("#{__dir__}/../bin/server", "./bin/server", verbose: true)
|
68
|
+
#FileUtils.mkdir("./bin", noop: Dir.exist?("./bin"))
|
69
|
+
#FileUtils.cp("#{__dir__}/../bin/service", "./bin/service", verbose: true)
|
70
|
+
#FileUtils.cp("#{__dir__}/../bin/server", "./bin/server", verbose: true)
|
51
71
|
|
52
72
|
puts "Generating boilerplate"
|
53
73
|
|
data/lib/shatter/version.rb
CHANGED