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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f44b926ef9ef04ce878e7fd7a178560dc4f60038360627c8ed9cffa2dfba6eb3
4
- data.tar.gz: cc4471e4f4d4da99db000efc779402673fe4fd843393cef0d9e5d62826952007
3
+ metadata.gz: 779c71931585d9bb8e13eb0b22f672090d5323dcbdbe0d81369aad78571e8f77
4
+ data.tar.gz: 688822d6f2c2115247a285a3a04ad514392448562ebb6cd6fb7afdf5f412375a
5
5
  SHA512:
6
- metadata.gz: f3422d6cd07a1977b6d2d8f293932716f3dea5ce8ce39bee5d925efae211c9163e4a3f0e06f566b7f983f6719a9b80db949fd76da08d8a4191a2ba047d011a53
7
- data.tar.gz: e76434e400acaa9e0796d068b7ee792bdcdd866e2ea2c85d13bf5f2851a571fad696dbdd892d205d52ee789607cd655335eec4e8cae7dc6ff9e7dd23f7d394e8
6
+ metadata.gz: c770c0d2dd76d847ce9d1265a460b55aa8b5d7a772baaf61d7e85a85580a83155270ad05fd27508869f0d44024fd6df4cdddccdf6dc0194270d27e31ec14e446
7
+ data.tar.gz: f7a9c9269405e7636eca758850507d571923818cd4e20ceeb24a15b7c22d7b0cd8948486e400841021ead2d3a10f59428364f14d4a22e396449928ee7f0537f1
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- shatter-rb (0.1.0)
4
+ shatter-rb (0.1.1)
5
5
  concurrent-ruby (~> 1.1)
6
6
  erb (~> 2.2.0)
7
7
  puma (~> 6.0)
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
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Shatter
4
- VERSION = "0.1.0"
4
+ VERSION = "0.1.1"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: shatter-rb
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Eric Roos