yaframework 0.4.8 → 0.4.9
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/Gemfile.lock +1 -1
- data/examples/README.md +1 -1
- data/lib/yaframework/base.rb +6 -0
- data/lib/yaframework/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: 6cfe57c449982f1b19f548975c965a520181ae0f83937efbfd60cb51c3d20446
|
4
|
+
data.tar.gz: 237e0074011df90023813924fcf40217f0f168cd0237868e56f6903ca367df9c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6459c931aaed3114f701f6d096dff733a007e94230d6d71320c64847ecba74d99656189a960ab299c58257542968e8e131c6f1dd54f6d96f2f1f1c1a6ea42cdd
|
7
|
+
data.tar.gz: 561ab785fcf23d3101249f79751b129678a3e00b0e6dd087a98ac8fb4773709e45b80363bd723b563d7f98b1066b035ab09c0911793c430ce99fc045e0771e1b
|
data/CHANGELOG.md
CHANGED
data/Gemfile.lock
CHANGED
data/examples/README.md
CHANGED
@@ -36,6 +36,7 @@ Here are some examples of applications created with Yaframework:
|
|
36
36
|
|
37
37
|
Adding and deleting cookies
|
38
38
|
|
39
|
+
|
39
40
|
8. [**Hooks**](https://github.com/maxbarsukov/yaframework/blob/master/examples/before_after_hooks.rb)
|
40
41
|
|
41
42
|
How to use `before` and `after` hooks
|
@@ -49,4 +50,3 @@ Then, run `bundle install` to install this gem.
|
|
49
50
|
## Run
|
50
51
|
|
51
52
|
Run with `ruby hello-world.rb` or any other file and view at http://localhost:4567
|
52
|
-
|
data/lib/yaframework/base.rb
CHANGED
@@ -5,6 +5,8 @@ require "rack"
|
|
5
5
|
module Yaframework
|
6
6
|
class Base
|
7
7
|
attr_reader :routes, :request, :response, :env
|
8
|
+
alias req request
|
9
|
+
alias res response
|
8
10
|
|
9
11
|
def initialize
|
10
12
|
@routes = Hash.new([])
|
@@ -38,6 +40,10 @@ module Yaframework
|
|
38
40
|
@after_hooks << block
|
39
41
|
end
|
40
42
|
|
43
|
+
def params
|
44
|
+
request.params
|
45
|
+
end
|
46
|
+
|
41
47
|
def handle(status, &block)
|
42
48
|
@inbox[status] = block
|
43
49
|
end
|
data/lib/yaframework/version.rb
CHANGED