sorta-http 0.1.0 → 0.1.1

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: f864c42253b9c913a75ad7c9208931b0827d4c94cae8664e44e232755cc3967f
4
- data.tar.gz: 72b8c23f6043822d7d4554b3c3b133974264cd13b5d0118997d44486acc4b45e
3
+ metadata.gz: d6b592de433b4552d16da95cd3bbbdb0e71feb3616c06081bffbf2044dfd8366
4
+ data.tar.gz: 803ea6c27978a57133d6e76d3f2aa29b7874c69a54d58befc3ab7b82023408f7
5
5
  SHA512:
6
- metadata.gz: 5af95cf516c9d83af32676271f0ab12673fe25f06288fced9a0e49f9ceff3a7723718a62ffea5d1e51c4e99f894474664a8cda0ce0ae091585b65241b8cda3da
7
- data.tar.gz: 7faa923792fb58f15f70e6f043eeae7f7817f9284310f767bdf7a56da460d958a42195b37b69895106626a369a23a4732825c38115cda96f5129eb38cfdb9bbf
6
+ metadata.gz: aad2d9e4679d9a272d259bf64a2856f5fd98a13f8bd3a30b38f6c9df4edc04528e5da08437dc0adebb9da25fce93a53c33881ccd06f3e6b8f8494811d29abfbb
7
+ data.tar.gz: 4d0fd9eb98a7931816ca4eac523968836b5fcecc6db64a6b406b384c7de0f1ae693a1c46f3e72ea5882a3d94e084430f912150c48a6993cd3fc24a8b79c1cf6b
data/Gemfile CHANGED
@@ -7,4 +7,4 @@ gem "rake", "~> 12.0"
7
7
  gem "rspec", "~> 3.0"
8
8
  gem 'rack'
9
9
 
10
- gem 'radix'
10
+ gem 'radix', git: 'https://github.com/Odebe/radix'
data/examples/simple.rb CHANGED
@@ -2,7 +2,44 @@ require_relative '../lib/sorta/http.rb'
2
2
 
3
3
  HOST = 'localhost'
4
4
  PORT = 8080
5
- WORKERS_COUNT = 1
5
+ WORKERS_COUNT = 2
6
+
7
+ module Actions
8
+ class Root
9
+ include Sorta::Http::Web::Action
10
+
11
+ def call
12
+ logger.info 'root test log'
13
+ "Welcome to RACKtor::Web!"
14
+ end
15
+ end
16
+
17
+ class Hello
18
+ include Sorta::Http::Web::Action
19
+
20
+ def call(params)
21
+ "Hello, #{params[:name]}"
22
+ end
23
+ end
24
+
25
+ module Calc
26
+ class Plus
27
+ include Sorta::Http::Web::Action
28
+
29
+ def call(params)
30
+ params[:num1] + params[:num2]
31
+ end
32
+ end
33
+
34
+ class Minus
35
+ include Sorta::Http::Web::Action
36
+
37
+ def call(params)
38
+ params[:num1] - params[:num2]
39
+ end
40
+ end
41
+ end
42
+ end
6
43
 
7
44
  hello_schema = Sorta::Http::Web::ParamsValidator.build do
8
45
  param :name, type: String
@@ -31,4 +68,4 @@ app = Sorta::Http::Web::Template::App.build do
31
68
  end
32
69
 
33
70
  server = Sorta::Http::Server.new(app,host: HOST, port: PORT, workers: WORKERS_COUNT, logger: Sorta::Http::Logger.new)
34
- server.run
71
+ server.run
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Sorta
4
4
  module Http
5
- VERSION = "0.1.0"
5
+ VERSION = "0.1.1"
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sorta-http
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
  - Mihail Odebe